Discussions

Updating the Price - Adding an On Sale price

As I understand it, I have to create a separate product node for each color and size variation. I combine those product variations using a Product Display node. This Product Display node becomes the "parent" or container for the child variations. The question becomes "does the Product Display node become aware of this parent-child relationship?"
Currently in Drupal Commerce, if I want to change the price shown in this parent product display, I have to manually go back to each child variation and change the price there. If I want to add an On Sale price, again I have to go back to each child variation and change an On Sale price field.
I would like to see a widget that I can add to my Product Display Type that would be able to read the contents of the product reference widget, know which child products are being grouped together, and then provide a means to override and update the original Price and On Sale fields for all the child nodes at once.
The original price would change it's output to something like "Was $10.00" The On Sale price field would become visible and read "Now $ 8.00" The On Sale price would then override the original price at checkout.
As far as I know this parent-child capability currently doesn't exist.
The question remains how can I do this? As far as changing the display of an On Sale price field I quess I could create a rule that would be able to detect if a product node has an On Sale checkbox checked and then change the output of the original Price field and the visibilty and priority of an On Sale price field.
If someone could tell me how to create such a Rule I would really appreciate it?

Posted: Apr 19, 2011

Comments

echodos on April 20, 2011

Your tutorials are great. They are a life saver.

I would like to see an additional tutorial on how to update the Product Display to SHOW the buyer that the item is on sale. Perhaps a Rule that would change the display of the Original Price to something like "Was $10.00 Now $8.00" or make visible another field that announces that the price I'm looking at has been marked down 20%.

Thanks in advance.

rfay Randy Fay on April 20, 2011

I agree. I think that right now that takes some extra code, so perhaps a commerce_discount module will be in the wings. Ryan says that all that's required is a formatter that looks in the price array, so perhaps it's not too hard.