4

I'm creating a Drupal Commerce based solution with 2 product types. One product has a constant price; it will be added to the cart, and that's all. The other product has many attributes (more complicated than color and size), and usually price depends from the selected attributes. Prices for various attributes are set by the administrator users. These prices are then multiplied by various other attributes, and added to the product price. For example:

  • additional price = some attribute unit price * customer entered width
  • complete product price = customer entered width * customer entered height * product default price + additional price

First attribute is width and height, which is entered from the customers before adding to the cart; the default value is 1x1.

More complicated attributes contain checkbox. If customers check it, the radio buttons becomes visible (first selected by default with no price; if customers select a different radio, they will enter a custom value). Another complicated attribute is price set individually for taxonomy term. I have colors, and for each color I can set the price for the current product. Thus I can't set price as a field of taxonomy term.

Now I'm trying to accomplish this with the Commerce Option and the Commerce Product Attributes modules.
Is there any simpler way to get the result?

The biggest problem is that the Drupal Commerce module adds to cart products with different attributes as a single product. So administrator Commerce/Order, or even customers viewing the cart don't really know what was added to cart.
Is there any simple way to distinguish the same product (ID) but with different attributes?

1
  • You can disable combining of the products(line items) in cart. There is an option for add to cart form(check manage display or views field, depending on how you add products)
    – milkovsky
    Feb 25, 2015 at 13:33

3 Answers 3

1

The biggest problem is that the Drupal Commerce module adds to cart products with different attributes as a single product.

Have you tried unchecking the option to: "Attempt to combine like products on the same line item in the cart."

It's on the "Add to cart" product reference field formatter settings on the product display content type

e.g: admin/structure/types/manage/product-display/display

0

Drupal Commerce is built on Views, so if you want your attributes to show up in any list (like the shopping cart, checkout page, or admin views) you can simply add the appropriate fields using Views.

I highly recommend two approaches:

1) Commerce Bulk Operations: https://vimeo.com/34385004 -- you can select multiple attributes and it will create all of the product with each of those variations.

and/or

2) Drupal Commerce Inline Entity: https://vimeo.com/40933753 -- once your products are created, you can edit them like a single product with the variations inline with the display node form.

2
  • Also, your pricing needs can be accomplished using the Pricing Rules in Drupal Commerce: vimeo.com/22625018 May 30, 2012 at 12:09
  • 1
    OK, you said, that this could be resolved by using Pricing Rules, but how/where create this complex attributes. Product Attributes allows only to create selectable, not editable fields when adding to cart. May 30, 2012 at 13:32
0

I' m sure you achieved your project now, but this could be useful to anybody : you were definitively looking for Commerce Customizable Products.

Commerce Customizable Products allows you to sell customizable products that require customer input when added to the cart. Use cases for this functionality include:

  • Business cards that require contact information and a logo upload.
  • Event registrations that require attendee information.
  • Donations : allow the customer to specify a donation amount.

(...) It gives you the ability to define new line item types on the fly at Administration > Store > Configuration > Line item types.

  1. Install the module, then set up a new product line item type to begin adding fields to it, i.e your fields customer height/width
  2. Configure a product display node type to use the custom product line item type, through the Add to Cart form display formatter of your node type's Product reference field.
  3. Using Pricing Rules, do the magic to calculate each custom product price
  4. You could even ask these detailed information a step further, in the shopping cart instead of add to cart form, with Commerce Line Item Cart Form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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