Skip to content

Instantly share code, notes, and snippets.

WooCommerce.com Documentation woogist

Block or report user

Report or block woogist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@woogist
woogist / customize_providers.php
Last active Feb 25, 2019
Customize Shipping Providers
View customize_providers.php
add_filter( 'wc_shipment_tracking_get_providers', 'custom_shipment_tracking' );
function custom_shipment_tracking( $providers ) {
unset($providers['Australia']);
unset($providers['Austria']);
unset($providers['Brazil']);
unset($providers['Belgium']);
unset($providers['Canada']);
unset($providers['Czech Republic']);
@woogist
woogist / change-products-per-page-storefront.php
Created Oct 11, 2017
Documentation: Storefront Filters example: Change the number of products displayed per page
View change-products-per-page-storefront.php
function alter_sf_products_per_page() {
// Return the number of products per page ( default: 12 ).
return 8;
}
add_filter('storefront_products_per_page', 'alter_sf_products_per_page' );
@woogist
woogist / storefront-add-featured-product-text-example.php
Created Oct 11, 2017
Documentation: Storefront Actions example: Adding content below the featured product title
View storefront-add-featured-product-text-example.php
@woogist
woogist / prevent_registered_learners_from_starting_courses.php
Created Feb 10, 2017
This code prevents Sensei learners from starting a course unless they've been specifically added to that course by a site administrator or a teacher.
View prevent_registered_learners_from_starting_courses.php
<?php
function sensei_display_start_course_form_when_admin_or_teacher( $should_display_start, $course_id ) {
global $current_user;
if ( empty( $current_user ) ) {
$current_user = wp_get_current_user();
}
if ( !( $current_user instanceof WP_User ) || 0 === $current_user->ID ) {
@woogist
woogist / fue-template.html
Created Dec 2, 2016
Follow-up emails template name
View fue-template.html
<!-- Template Name: Unique name of your choosing -->
@woogist
woogist / functions.php
Created Oct 26, 2016
Dynamic Pricing - Product Ineligible for Discounts
View functions.php
add_filter('woocommerce_dynamic_pricing_process_product_discounts', 'exclude_some_products', 10, 4);
function is_product_eligible( $eligible, $product, $discounter_name, $discounter_object ) {
if ($product->ID == 200){
$eligible = false;
}
return $eligible;
}
@woogist
woogist / functions.php
Created Oct 15, 2015
Remove the extra 'Quiz' on the single quiz page
View functions.php
add_filter( 'sensei_single_title', 'sensei_dl_custom_double_quiz_remove' );
function sensei_dl_custom_double_quiz_remove( $title ){
if( 'quiz' == get_post_type()
&& 1 < substr_count( strtoupper( $title ), 'QUIZ' ) ){
// remove all possible appearances of quiz
$title_with_no_quizzes = str_replace( 'quiz', '', $title );
$title_with_no_quizzes = str_replace( 'Quiz', '', $title_with_no_quizzes );
@woogist
woogist / gist:4f6f2532758d554075f6
Last active Sep 25, 2015
WooCommerce Australia Post: adjust tax rate
View gist:4f6f2532758d554075f6
add_filter( 'woocommerce_shipping_australia_post_tax_rate' , 'woocommerce_shipping_australia_post_custom_tax_rate' );
/**
* Adjust tax rate
*
* @access public
* @since 1.0
* @return void
*/
function woocommerce_shipping_australia_post_custom_tax_rate() {
@woogist
woogist / gist:95623941598caadba795
Created Sep 23, 2015
Ninja forms addon: hide all sub prices
View gist:95623941598caadba795
<?php
add_filter( 'wc_nf_addons_cart_option', 'wc_ninja_forms_price' );
function wc_ninja_forms_price( $display ) {
return '';
}
@woogist
woogist / gist:65dcb3ce250104936ab2
Created Sep 23, 2015
Ninja Forms hide addon costs equal to zero
View gist:65dcb3ce250104936ab2
<?php
add_filter( 'wc_nf_addons_format_cart_item_price' , 'wc_ninja_forms_hide_zero_price' );
function wc_ninja_forms_hide_zero_price( $value ) {
$hide_price = ' (' . wc_price( '0.00' ) . ')';
if ( $value == $hide_price ) {
return '';
You can’t perform that action at this time.