This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* sourced from several StackOverflow posts */ | |
/* | |
* YOU MUST CHANGE REFERENCES TO "corporate" TO YOUR | |
* OWN CATEGORY SLUG, ELSE THIS WILL BE USELESS (lines 16 & 28) | |
*/ | |
function custom_pre_get_posts_query( $q ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_admin_order_data_after_order_details', 'wc_add_user_role_admin_order_details' ); | |
function wc_add_user_role_admin_order_details( $order ){ ?> | |
<br class="clear" /> | |
<?php | |
$user_id = $order->get_user_id(); | |
$user_meta = get_userdata($user_id); | |
$roles = $user_meta->roles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Hide the price string if set to $0 | |
*/ | |
add_filter( 'woocommerce_get_price_html', 'wc_hide_price_string_0', 9999, 2 ); | |
function wc_hide_price_string_0( $price, $product ){ | |
if ( '' === $product->get_price() || 0 == $product->get_price() ) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.wc-pao-addon-container.wc-pao-addon > p:nth-child(3) { display: none!important; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount_surcharge' ); | |
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount_surcharge' ); | |
add_action( 'woocommerce_cart_calculate_fees','wc_minimum_order_amount_surcharge' ); | |
function wc_minimum_order_amount_surcharge() { | |
global $woocommerce; | |
// Set this variable to specify a minimum order value | |
$minimumTotal = .99; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_billing_fields', 'wc_remove_shipping_billing_state' ); | |
add_filter( 'woocommerce_shipping_fields', 'wc_remove_shipping_billing_state' ); | |
function wc_remove_shipping_billing_state( $fields ) { | |
unset( $fields[ 'billing_state' ] ); | |
unset( $fields[ 'shipping_state' ] ); | |
return $fields; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_product_backorders_require_notification', '__return_true', 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_product_addons_option_price', 'PAO_remove_percentage', 1); | |
function PAO_remove_percentage() { | |
$price_raw = '( . $price_prefix . $price_raw )'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wc_price', 'wc_price_add_USD', 10, 3 ); | |
function wc_price_add_USD( $return, $price, $args){ | |
$price= "$" . $price . " USD"; | |
return $price; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_persistent_cart_enabled', function () { | |
return false; | |
}); |