Does anyone know if it’s possible to link a products’ visibility in Woocommerce to specific days of the week? i.e. Monday, Products 1-4 visible, Tuesday, Products 5-10 etc, which would enable a restaurant menu to show only daily options that repeat each week?
Any help would be much appreciated, thanks
Code
content-product.php
to your theme’swoocommerce
directoryChange the area where it checks for visibility
FROM
TO
Add the following to your functions.php file
WooCommerce Admin Setup
Add tags to all of your products
$all_days
above to whatever you set it to be – monday, tuesday, wednesdayThinking
I couldn’t find a method to break out of WooCommerce’s loop and set the product visibility before hand so a template update was necessary
Result
The results aren’t updated to match with this code, but it shows in this example that there is more products than are displayed.
Solution Crossposted