Hi There, i am making a store for my client where his requirement is to sell food on weekly basis so there are 4 menus for 4 weeks so i created a weekly menu page and showing four products Week1, Week2, Week3 & Week4 now problem is my client wants to enable “Add to cart” button only for running week and for rest 3 weeks “Add to cart” should be disabled so buyer can see all 4 weeks menu but can add to cart only the available one for example if the date is 9th of october means add to cart button is disabled for week1, week3 and week4 but enabled for week2 .. how can i do this? please tell me the way or app or whatever is possible .. thank you
Hi @mughal ,
This seems to be custom development task.
Let me know if you want to hire me
Regards
Reena
A smart approach would be using conditional logic tied to the current date so only the active week’s product has an enabled “Add to Cart” button. The other weeks can stay visible but disabled, letting buyers preview menus (menufreddys) without purchasing ahead. Plugins or custom code in WooCommerce can handle this setup easily.
Hi @mughal
You can do this with a bit of custom code in your product template. Use Liquid to check your weekly ranges against the current date, and then hide or disable the “Add to Cart” button for any other weeks. Example: {% if ‘now’ | date: ‘%U’ == product.metafields.custom.week_number %} show button {% endif %}.