1

I am using the Drupal Commerce module (in Drupal 7) for products.

I need to create different-different group like phone and shirts. And need to add parameters for phones.

Also I need variation by using taxonomy.

Please refer to the image below for more details:

enter image description here

Some more details:

  • I am using 2 attributes: Color and Memory, implemented as taxonomies (vocabularies). But they are not showing as a select list on the cart page.
  • Color is a vocabulary, with terms in it like black, silver and red.
  • I added Color on product type fields and checked 'attribute option'.
  • But still this widget not showing up on the cart page (it's only showing the selected value).

Or to phrase it in yet another way: I need attribute on cart page. I have added attribute by using taxonomy, but it's giving me only a link. Which means that when I select 'black', then it only shows 'black color' on the cart page (it does not show a 'select option').

  • I've integrated one of your comments in the question (which is where it belongs I think). And slightly corrected the grammar. Please double check to ensure I did correctly do so, and further refine (edit) where needed. Also, please refine edit that "different-different" phrasing, which I really don't understand (I'm probably not the only one ...). – Pierre.Vriens Jul 10 '15 at 10:39
1

I guess you need to create a new product type (since you want to add "parameters", which I assume are "fields") :

/admin/commerce/products/types/add

Then add fields to your new product type (picture, size, screen resolution for phones...), choose chich fields will be used as attributes (like size for shirts), then create products using this new product type, then create a new product display (which is a regular node with a multiple product reference field) for this product type and reference your products with the product reference field on the product display. You can also use an existing product display to display all your types of product (in this case you have to allow the product display's product reference field to reference products of the new product type first).

Note that if you have several attribute fields, you need to create as many products as there is possible combinations. Say you have 3 sizes (S, M, L) and 2 colors (red, blue), you need to create 6 products :

  • S blue
  • S red
  • M blue
  • M red
  • L blue
  • L red

You may consider using Commerce Product Option or similar module for your use case.

It can be confusing at first, but the Drupal Commerce way of dealing with products is really effective.

Good luck

EDIT

To make a field act as an attribute on your add to cart form (i.e shirt sizes : a drop down with XS, S...), you need to define a field on your product type (see my URL), then on the manage field form (admin/commerce/products/types/your_product_type_machine_name/fields/your_field_machine_name), you need to check the checkbox "Enable this field to function as an attribute field on Add to Cart forms".

Then you create your product, one with size S, one with size M, one with size L (so you have 3 products, one per size), on your product display you set up references to the 3 product variations (S, M, L), and there it is, on your product display page you'll find a drop down allowing to choose the size in the add to cart form. When selecting a size, the node fields are refreshed with AJAX (you can see it as an AJAX product selector).

This system allows you to have different SKUs and prices for each variations. Typically, everything that needs to be different across products variations (SKU obviously, but maybe price, maybe the product picture) needs to be represented by a field on the product (each product has its own field value). Everything that is the same across product variations can be represented by a field on the product display (which is common to several products.

See here for official doc.

Hope it helps and sorry for my english, not my first language.

  • Managing products (and orders) can indeed be a bit confusing, however, Commerce Backoffice (drupal.org/project/commerce_backoffice) helps with that in a good way (especially the auto creation of product display nodes). – Watergate Jul 10 '15 at 9:16
  • @Watergate Never tried that, I'll check it out thanks ! – Florian Motteau Jul 10 '15 at 9:23
  • thanks.. I am using 2 attribute color and memory by using taxonomy vocabs. but its not showing as a select list on cart page. – jsh Jul 10 '15 at 9:23
  • If you use Commerce Backoffice, you most probably also want to use the Shiny administration theme: drupal.org/project/shiny – Watergate Jul 10 '15 at 10:04
  • @Flo I followed your step. but still I am not getting dropdown on product page. – jsh Jul 10 '15 at 10:57
1

Option 1 - Use Commerce Backoffice

As mentioned also in one of the comments, managing products (and orders) can be confusing. However, the Commerce Backoffice module helps with that. Especially because of the auto creation of product display nodes.

So consider using the Commerce Backoffice module. It provides the backoffice functionality present in Commerce Kickstart (V2). It contains these sub-modules:

  • Commerce Backoffice Product (commerce_backoffice_product).
  • Commerce Backoffice Order (commerce_backoffice_order).
  • Commerce Backoffice Content (commerce_backoffice_content).

This module (and a few dependencies) provides the rich store owner experience that has made Commerce Kickstart 2 so popular (and prevents that you have to install the entire Commerce Kickstart distribution). And there is a great video introduction about it also.

Note (as suggested in a comment here also): if you use Commerce Backoffice, you most probably also want to use the Shiny administration theme, also used in Commerce Kickstart (V2).

Option 2 - Roll your own cookies

If you're ready to possible get confused, and/or don't mind all the required effort (if you have a lot of "attributes" to configure), then you may want to go over the various steps as explained in these 5 videos.

  • Please see above image. I need attribute on cart page,, I have added attribute by using taxonomy .. but its giving me only link.. means when I select black then it only show black color on cart page not show select option. – jsh Jul 10 '15 at 9:44
  • @jsh Edited my answer. So Memory, Color, Provider and Contract must be product fields, and you'll have to create as many products as there is possible combinations for these fields values (16Go/red, 16Go/blue, 32Go/red and so on...can be a lot with 4 attributes fields...). Quantity is managed by Drupal Commerce. – Florian Motteau Jul 10 '15 at 9:57
  • If you use Commerce Backoffice, you most probably also want to use the Shiny administration theme: drupal.org/project/shiny – Watergate Jul 10 '15 at 10:05
  • color is a vocab and black,silver and red. are term. And I added color on product type fileds with checked attribue option...but still this widget not showing on cart page.its only show selected value. – jsh Jul 10 '15 at 10:08
  • It gives me awesomescreenshot.com/0fc5212696 – jsh Jul 10 '15 at 10:11

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