Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 Nov 24 '12 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. –  MPD Nov 24 '12 at 18:15
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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