Since installing the plugin and running the query I've had an issue with my sales results. Items no longer on sale show up and newly onsale items don't, even when I re-run the query.
I've tried clearing the product/shop transients cache and regenerating product lookup table data without success. The "Sale" badges are however displaying correctly.
[products limit="60" columns="4" on_sale="true" orderby="rand" visibility="visible"]
Is there a way to reset everything back the way it was, or can you suggest another possible solution?
Any help would be greately appreciated.
This definitely sounds like the query to update the on-sale flag has not run. The plugin basically uses an on-sale flag in wp_postmeta to tell if a product is on sale or not. The default WooCommerce way is to actually compare the regular price with the on-sale price and if the on-sale price is lower, then it shows the on-sale flag. That’s very slow to run that code every time, which is why running an overnight job works better.
If you are saying that even after you’ve run the code to update the flag, and it’s run successfully, that products don’t show then maybe this is coming from the object cache. If this is the case, please update your question to provide in the ‘private info’ box your access credentials and a URL where the on-sale flag IS or ISN’T showing as expected and I’ll take a look.
I’m having a similar issue. Only a small number of on sale items show up. I do not know if it is related, but I am also using a plugin that will put entire categories on sale.
They show as on sale, but on a sales page with the short code:
[products limit="200" columns="6" orderby="popularity" class="quick-sale" on_sale="true" ]
only displays 7 products. (https://420now.ca/sales/).
Yet, there are likely 200 products on sale right now, using the Woo Product Category Discount by WooExtend.
What I’ve done:
Cleared Cache (WP-Rocket)
Cleared WP cache with wp-cli.
Also cleared WooCommerce Transients and Expired Transients (just in case).
Any ideas? I see the plugin appears to be no longer available.
Hi – the functionality of the onsale plugin has been moved inside Super Speedy Filters, but in any case all Super Speedy on Sale page did was this:
1) Add postmeta sale flag for products that are on sale (i.e. calculate retailprice – price > 0 up front)
2) Provide you with a URL parameter to add this postmeta check
The Woo Product Category discount is presumably calculating on-sale on-the-fly in a slow way.
In any case, I’ve not had any reports of this issue existing inside Super Speedy Filters so I recommend everyone upgrade to using that. The filters are better than others, the speed is better than others, and all this stuff just works.