I'm building a foodhub site using Commerce. A foodhub works by having a collection day every week, so sales of products need to be attached to one of the collection days, such that what the consumer bought will be available on the day they selected (typically the next upcoming day). At a certain time, e.g. 24 hours before, sales for the next collection day should be disabled.

I am wondering how I can approach this using Commerce, or a with a Commerce extension.

I'm thinking one approach would be to create a "collection day" content type that would show all the products that have been purchased and added to that day. A number of collection day nodes could be created defining upcoming days. A field on a product would show which collection day it will be added to. This would show the next upcoming day but can be changed (I need to figure this part out).

Is this a good approach, or is there a better way to tackle this problem?

  • This could be a scoping/specification exercise that's not answerable on here. I don't think there's any existing Commerce functionality/contrib for this.
    – pushka
    Commented Nov 24, 2012 at 14:19
  • 2
    I don't see this as scoping/specs. I see it as an interesting problem, and @pmackay is looking to see how Commerce can be used.
    – mpdonadio
    Commented Nov 24, 2012 at 18:15

1 Answer 1


What you can certainly do is proceed as you've outlined it and then create a view of all products that don't have their collection day within the next 24 hours. This will display all the products that can be bought in time for your collection preparations.

Approach 2: Set up a rule that checks after an order has been saved or before payment is done whether there is any product that has its collection day within the next 24 hours and if so, display an error message and set the number of these products in the cart to 0.

Approach 3: Set up a rule that runs periodically (say every day) and loops through all the products and disables those that have their collection day within the next 24 hours.

If you want more detailed information on how to achieve any of these, comment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.