Support » Plugin: Advanced Dynamic Pricing for WooCommerce » Discounts and Woocommerce shortcodes

  • Resolved essmeier


    I’ve installed this plugin with the intention of creating various sales that put entire product categories on sale.

    That seems to work; when I set up a discount for a particular category, items in that category show discounted sale prices in the store.

    I’m trying to create a page in my store that shows items that are on sale, and Woocommerce has a shortcode for that:


    When I use that shortcode, the discounted items do not appear on the page. In fact, nothing does.

    Am I using the wrong shortcode for this? Or does Woocommerce not see items discounted by this plugin as being “on sale”?

    Just not sure how to do that. The plugin works great otherwise.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author



    Yes, shortcode [sale_products] doesn’t see products discounted by this plugin.

    My plugin adjust prices on-fly ( price can depend on user role or cart items),
    But this shortcode reads “sale price” directly from database.

    This problem was already reported. And I don’t have common solution for it yet.

    Can you upload screenshots(of your rules) to helpdesk?

    thanks, Alex

    I’ve tried several different discount plugins for Woocommerce, and none of them produce sales that Woocommerce actually recognizes as being “on sale.” Looks like it’s just a deficiency with Woocommerce itself.

    I’m migrating to Woocommerce from Shopp, which came with an onsale page and the ability to put entire categories on sale built in to the software. The company that developed Shopp has gone out of business and they were the sole source of tech support, so I’m having to migrate to Woo as quickly as I can manage it.

    I have an entire category of products on sale each week, and my primary menu and a sidebar graphic point to the “on sale” page. I was hoping to be able to create a page for that so I could keep a static link in those two positions.

    Fortunately, Woocommerce does have pages for individual categories, so I can just link to the appropriate one each week.

    The workaround, for me at least, is just to change those two links every Monday when I change the sale category. A minor nuisance that will take 60 seconds, so I’ll deal with it.

    The ability to put categories on sale seems like something that should have been built in to the Woocommerce plugin in the first place.

    Still, your Advanced Dynamic Pricing for WooCommerce plugin works well for creating category discounts, so I’ll stick with it.

    Thanks for the help.

    I put in a ticket at the support desk, and Alex came up with a simple solution to save me from changing my URLS every time I changed a sale category.


    Plugin Author


    This user uses only one rule and one product category as “product filter”.

    Following code allows to use url . It just redirects to active category (which you set in the rule).

    add_filter( 'parse_request', function( $query ) {
    	if( $query->request != "category-on-sale-redirect" )
    	//analyse rules
    	$active_rules = WDP_Rules_Registry::get_instance()->get_active_rules()->to_array();
    	foreach ( $active_rules as $index => $rule ) {
    		foreach( $rule->get_product_dependencies() as $dependency) {
    			if( 'product_categories' === $dependency['type'] ) { // just take first ID
    				$category_id = array_shift($dependency['values']);
    				$link = get_term_link( (int)$category_id , 'product_cat' );
    				//do redirect ?
    				if( !is_wp_error($link) ) {
    • This reply was modified 11 months, 2 weeks ago by

    Actually, I have about 30 categories, (I was testing the cart with just one and that’s what Alex saw) but I only have one on sale at any given time, so the code above will redirect the user to the page for the category of the current sale.

    I occasionally have a sale where everything is on sale, and I accomplished that by creating a global category “items” to which every item belongs.

    Plugin Author



    If you still need separate page for “on sale” products – please submit ticket to helpdesk.

    We’ll provide beta for tests, we added new shortcode.
    But it works for simple rules (not bulk or role-based).
    thanks, Alex

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Discounts and Woocommerce shortcodes’ is closed to new replies.