Discussions

How to approach a product attribute situation with customisable options some of which cost more?

Hi,

Having used D7 for various sites, I would like to use D7 commerce to upgrade a shopping cart site and I am stuck on how to approach a customisation problem.

One of the products for sale is rope, which is customised in various ways.

Having selected a type of rope (e.g. Polyester Braid) the customer has to then select the diameter (e.g. 2.5mm) and the colour (e.g. white with red fleck).

I have set up the rope product type and added the fields for diameter (float list) and colour (term reference to colour vocabulary).

I then set up a product for each combination of colour and diameter and used the 'product attributes' module to set up the cart. So far so good, looks to be working.

The complication is now I need the customer to be able to select what end finish they want at each end of the rope, (e.g. a hot knife cut, a whipping or an eye splice etc)

I do not need to manage stock of the end options, as they are just customisations of the end of the rope, however I do need to charge more for the splicing than the whipping where as the hot knife cut will be free.

How do I make the end finish options available at the add to cart stage so that the price is increased for some of the end finish options but not the default hot knife cut.

I do not want to make separate products for every combination of end option as I have with the other attributes of colour and diameter.

I have looked into the 'customisable products' module and 'custom line items' but can not find anywhere explaining how to get the customisation to alter the price for the line item. The 'commerce product option' seams to cover this sort of situation however I can not work out how to set it all up and the module page has the following which is a concern: "The integration with the Commerce Product Bundle is not complete. The price alteration does also not really work."

Can anyone offer advice on the best approach and help me get this set up correctly. Any help much appreciated as I am new to Drupal and very new to Drupal Commerce.

Thanks
Andrew

Posted: Mar 25, 2012

Comments

andrews on April 9, 2012

As this post has not really sparked much interest, I thought I would follow up with what I have done since for the benefit of others.

In summary I have almost achieved my goals in a round about way:

1 - I set up a custom line item with fields for the rope end finish options, hot knife cut, splicing etc as term references to taxonomy.

2 - I set up products for the end finishes to the rope which cost money, whipping and splicing options. The splicing options has further customisation which causes slight problems in this method explained further down.

3 - I set up a rule firing on add product to cart, remove product from cart and update cart. This removes all whipping products from cart then loops through all line items in cart and adds a whipping product for every line item with custom line item whipping option. This means that the cart price is updated for the number of whipping options selected by showing that number of whipping products as a separate line item. This is a messy way of achieving the goal.

4 - This could not be done with the splicing as all this option is customisable by size of splice loop, so these options could not be combined into an automatically added line item as above. For this I added a rule firing on add to cart which checks for the splicing option and re-directs to the splicing product display node for that rope type. They then have to select the options they want and add it to the cart separately.

This seams to me to be a very complex way of getting custom line item options to adjust the price of the line item. The problem is that you do not want to adjust the base price because this then gets multiplied by the quantity of the the rope ordered.

Is there a way of getting a rule to add an amount to the line item total, as this would seam like a much simpler solution.
The rule would:
Loop through cart line items, check for a custom line item field value, add an amount to that line item total, (not the base price which gets multiplied by the quantity.)

Any thoughts to improve my temporary solution and help on achieving the simpler solution is much appreciated.

Andrew