Hello,
I'm trying to use Drupal commerce for an online store selling services to tourists, my problem right now is that the buyer has to select WHEN is he going to enjoy the service bought, i.e. they buy a tour with a price and a date. Nothing should change depending on the dates they are coming (same price, same conditions).
I've already read through all the post/issues/documentation/modules available and so far my conclusion is that the only way to do this in a proper way is to make an attribute “date” and replicate the SKU for every single date but I’m afraid this would become unmanageable since I would have to replicate all my products 365 times per year !!!
How can I solve this? Is there any module solving this?
Thanks in advance and congratulations for this commerce solution.
Comments
Comment #1
rszrama commentedYou can add a date field to your product line item type and expose that to the Add to Cart form. It's fairly new functionality, so it may not be documented.
Comment #2
pardalman commentedCOMPLETELY SOLVED
Thank you soo much, I've been trying for one-two days... and actually it is really simple once you know how it's done :P
Comment #4
davidwhthomas commentedI did something similar by adding a new customer profile type, in code, and added the date field to that.
It appears for the user to select during checkout and is visible as a field on the order.
Comment #5
merauluka commented@pardalman, would you be willing to post how you exposed your field to the Add to Cart form? I've looked and looked and can't find the way to do it.
Drupal Commerce is awesome, but its rapid development is leaving documentation in the dust it seems. :-(
Comment #6
davidwhthomas commented@merauluka,
I'm not sure about showing the new line item field in the add to cart form,
However, In case you're interested in an alternative approach, I documented my other approach, using another customer profile entity, here.
http://www.drupalcommerce.org/node/626#comment-2017
Feel free to add notes, as needed.
DT
Comment #7
Tmanagement commentedJust for Google purposes.
Make sure that when you are ready you add the views you want them to show. And make sure you add a relationship within views (you will find this under advanced -right side views 3-) of type line item. Then add the field to your fields and make sure you select the relationship line item.
Comment #8
stgogiant commentedHi, I'm doing this exact same thing and have it set up as indicated in comment #1 and it's working fine. However, I need to add one wrinkle to this, which is to be able to "grey out" certain dates on different products once they are no longer available for that particular date. It's kind of like inventory I suppose, but there are no real hard numbers to attach to this inventory, and as I try to explain below, no need to track inventory either.
The best way to think of it is probably tour guides available for given dates. Think of a pool with an undefined number of guides for each product for every day of the year, but at some point the pool will be (or at least could be) empty for any given day. Only the administrator would be able to (or need to) determine when the pool is empty (i.e., there's no need for this to be tracked and indicated by the orders purchased by customers and update in real time). Once the administrator is aware that the pool is empty for product X on date Y, he would "grey out", or disallow that particular date for that product.
Any ideas on how I might be able to add that functionality would be much appreciated.
Thank you in advance!
Comment #9
bluesman2014 commentedHi stgogiant, did you find a solution to the problem you mentioned in #8? I'd be interested to know how to do this too.
Comment #10
elvin - albania drupal developeri too am interested in the problem that #8 described. Please any suggestions guys?
Comment #11
stgogiant commentedHi Elvin,
I figured out a way to do something similar to what I'd described here by using Date Restrictions for Commerce Line Item (https://www.drupal.org/project/date_restrictions_commerce_line_item) module. With that you can restrict the selectable dates based "allowed" dates you enter in a field on the product display (so it restricts at the product display level, not product level....although I guess you could have only one product per product display to work around that).
It's an OK solution for what I was asking about here, however, as I noted in one of the issues in the queue on that project, once the date restrictions are enabled, the pop-up calendar on the product display (front end for the user) loads a bit slowly, which is kind of a drag. But it does function for the most part in the way I needed.
Hope that helps.
Comment #12
elvin - albania drupal developerthanks a lot stgogiant !!! this is a lifesaver!
Comment #13
elvin - albania drupal developeractually not. the module is buggy :( thanks for suggesting anyway
Comment #14
stgogiant commentedHi Elvin, you're welcome. In what way did you find the date restrictions module buggy? Other than the issue of the pop up calendar loading slow when the date restrictions are enabled, I haven't experienced any other issues or errors with the module. What were you referring to exactly (out of curiosity more than anything...)
Thanks.
Comment #15
elvin - albania drupal developerhello Stgogiant
I installed the module and the dependencies. i tried adding the restriction by having one datefield value (with collect end date to specify dates only from may to july)
it threw some javascript erros and it wouldnt work. the popup wouldnt work either.
maybe i need to add all dates one by one manually but it would be easier to specify from X to Y date and then also add additional dates.