Created
August 19, 2015 18:26
-
-
Save lucasstark/d3e0a40e7a39b59cad24 to your computer and use it in GitHub Desktop.
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
add_filter( 'woocommerce_dynamic_pricing_is_cumulative', 'wcdp_cumulative_pricing', 10, 2 ); | |
function wcdp_cumulative_pricing( $cumulative, $module_id ) { | |
if ( $module_id == 'advanced_category' || $module_id == 'simple_membership' ) { | |
$cumulative = true; | |
} | |
return $cumulative; | |
} | |
add_filter('wc_dynamic_pricing_load_modules', 'custom_dynamic_pricing_module_order'); | |
function custom_dynamic_pricing_module_order($modules) { | |
$modules = array(); | |
//Need to have advanced category first. | |
$modules['advanced_category'] = WC_Dynamic_Pricing_Advanced_Category::instance(); | |
$modules['simple_membership'] = WC_Dynamic_Pricing_Simple_Membership::instance(); | |
$modules['simple_product'] = WC_Dynamic_Pricing_Simple_Product::instance(); | |
$modules['simple_category'] = WC_Dynamic_Pricing_Simple_Category::instance(); | |
$modules['advanced_product'] = WC_Dynamic_Pricing_Advanced_Product::instance(); | |
$modules['advanced_totals'] = WC_Dynamic_Pricing_Advanced_Totals::instance(); | |
return $modules; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment