Skip to content

Instantly share code, notes, and snippets.

@lucasstark
Created May 20, 2013 14:55
Show Gist options
  • Save lucasstark/5612750 to your computer and use it in GitHub Desktop.
Save lucasstark/5612750 to your computer and use it in GitHub Desktop.
WooCommerce Dynamic Pricing - Display the discounts available for a particular product category.
add_action('woocommerce_single_product_summary', 'my_after_woocommerce_single_product_summary', 21);
function my_after_woocommerce_single_product_summary() {
global $post, $product;
if (is_object_in_term($post->ID, 'product_cat', array('tshirts'))) {
echo 'Your Custom Pricing Table';
}
}
@ThePixelPixie
Copy link

All that happens when I put this code in my functions.php file is that I get the text "Your Custom Pricing Table", which of course makes sense because that's all in the echo command. But how do I get the dynamic pricing table to actually display?

@AmitDeo
Copy link

AmitDeo commented Apr 2, 2015

This must be April 1st solution.

@azizultex
Copy link

Here is what i got to show the pricing table. But we might need to made some customization to suit out need.

http://blueskysessions.com/2014/03/31/woocommerce-dynamic-pricing-plugin-how-to-show-the-quantity-pricing-rules-for-all-product-variations-on-the-product-page/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment