Woocommerce and custom content

Hello,

With the latest pro 6.x.19 update, is it possible to control context displayed on a page based on what products are sold? The idea here is to market products that have not yet been purchaed…if it can, are you able to give me a few pointers?

Hey @fxground,

Thanks for writing in! Assuming that each product has metadata to know whether it has been purchased or not, we can use this as a condition. You can add a Section element withthe condition that will only display when the product is not yet purchased.

Hope this makes sense.

Hello,

Thanks… i had that same idea but i couldn’t figure out what i would select. It seems like everything there by default doesn’t have an option if the Product (is) Sold etc. So this attribute would have to be done custom before hand to make it work ? or is there a condition out of the box that works?

Hey @fxground,

You can install the JSM Post Meta plugin to check whether there is an indication that a product is sold or not. Usually, it is in the product meta. Normally, you can use string condition {{dc:post:meta key="total_sales"}} > 0

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

Hello, thanks for this - I really need to revisit it as I gave up and got really busy. I’m not sure if this has changed since the newest biggest release but assuming its the same, how does this “{{dc:post:meta key=“total_sales”}} > 0” know what product to look at? if i had 2 products that were both $99 then i wouldn’t be able to know which one the user had purchased. Is there a way to take into consideration the product?

Hi @fxground,

If you are using the Dynamic Content within the Looper then it will check the sales of specific products. If you are using it in the Single Product layout, it will take the product showing currently and check the sales.

Hope it helps.
Thanks