Hello everyone,
I'm working on a website where users can order specific food items from a shop page, with each item being available on certain days of the week. I want to add a condition on the shop page that allows users to place an order only if it's at least 48 hours or more in advance. If there are less than 48 hours left for a specific food item, it should not be possible to add it to the cart.
Could anyone advise how to implement this? Would a scheduled action be the right approach?
Any suggestions?
Thanks in advance for your help!

Every Oder will be place via the Website app in the shop page:
Sandwich: Available to order: ( Tuesday, Wednesday, Thursday, Friday and Saturday) not Available to order: (Sunday and Monday)
Pasta Salad: Available to order: ( Wednesday, Thursday, Friday Saturday and Sunday) not Available to order: (Monday and Tuesday)
Mini Pizza: Available to order: (Thursday, Friday, Saturday, Sunday and Monday) not Available to order: ( Tuesday and Wednesday)
Chicken Nuggets: Available to order: (Friday, Saturday, Sunday, Monday and Tuesday) Not Available to Order ( Wednesday and Thursday)
Fish and Chips: Available to order: (Saturday, Sunday, Monday, Tuesday and Wednesday Not Available to Order: ( Thursday and Friday)
( >>> Making the menu unavailable doesn't seem quite right. Today is Monday, user can't order for tomorrow (Tuesday), can the user not order for a week Monday or Tuesday? If Monday & Tuesday's menu isn't published they wouldn't be able to place that order.<<<)
What approach do you propose?
I tried this approach because of preparations. so that I have the number of a specific new that need to be prepared for a specific day 48 hours in advance.
If you have a better solution let me know please.
( >>> Not sure how you plan to capture the date of delivery. I would have used the extra step at checkout option. Settings > Website > Shop checkout section
Configure the form to include delivery date and probably have some automation here to not accept order less than 48 hrs.<<<)
or this part is it possible in Odoo V17.4 online? Can you give more details please.
Thanks
Yes, it is possible to have a form input at checkout.
1 Navigate to Website > Configuration > Settings and enable extra step at checkout
2 You would then have the option to configure the form Or navigate to a cart and click 'checkout'. While on the form, click edit top right of the page.
3. Click a field and change type or add a new field and set type to 'Delivery date'.
Once this field is set, it updated the delivery date on the order (other info tab) as well as updates the delivery order's 'Scheduled date'.
If your business model is to only accept orders between 48hr and 7 days (effective 5 days), then you should follow your method since it does not require any input from customer as to when they wish the delivery as it is possible only on a certain day of the week within 7 days