Skip to content

Instantly share code, notes, and snippets.

@lucasstark
Created August 19, 2015 18:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasstark/d3e0a40e7a39b59cad24 to your computer and use it in GitHub Desktop.
Save lucasstark/d3e0a40e7a39b59cad24 to your computer and use it in GitHub Desktop.
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