Discussions

Altering the quantity widget

I created a shop for a bakery.
There is a producttype 'pies'. Here users must be able to choose between a quantity of 4, 6, 8, 10 and 12 persons.
The price in backend is entered a piece and in frontend price must be calculated upon this.

So basically i need three functions:

  • display prices for above quantities
  • the quantity widget must be a selectlist of these quantities so users don't get confused
  • the text of the calculated currency must have a finishing line 'per person'

I'm novice in drupal so i don't have any programming language experience.
I did some prospection and fell onto the commerce table price widget but needs further customisation.
Please advise!

Thanks!

Posted: Apr 17, 2011

Comments

rfay Randy Fay on April 18, 2011

I *think* what you want is 5 separate products, for 4, 6 8, 10, and 12 people. Then display them all on the same Product Display node. Note that your product display node must have a multivalue "product" field, so you can select all 5 of these to be displayed by the one product display node.

So:

  1. Configure the product field on your product display node to be multivalue.
  2. Create 5 products (pie for 4 people, pie for 6 people, etc.)
  3. Create a product display node and select all 5 products

WilliamV on April 18, 2011

This is a good suggestion, and we already thought about that, but this is a last option due to massive work pressure.

Better would be if the quantity field could be set with multiple values per product type and that this could be displayed as a 'select list'.
In this way, prices would be autocalculated upon fixed (read: set) quantities.

Can this be implemented?

latulipeblanche on April 20, 2011

When you use the multivalue "product" field you get a dropdown menu to chose the different products 4,6,8,10 and 12 people.
I you want to replace the dropdown menu by images representing the number of peoples, how would you do that ?