How do I use extra product attributes like size and color?
Let's say you want to have a product with the "size" and "color" attributes separately.
In our case we'll use the default product product type from admin/commerce/products/types/product and add size and color as fields.
- Add the size and color fields to the
productproduct type. Their type must beList (text). Check the "Enable this field to function as an attribute field on Add to Cart forms" checkbox. - Create products with a variety of sizes and colors.
- Edit the
productfield of theproduct displaycontent type (admin/structure/types/manage/product-display/fields/field_product) to set the number of values to "unlimited". - Create a
product displaynode (node/add/product-display). In the
"product" field, select the products that should be shown on this node. - Save the node and it should work as expected, with select fields for size and color


Comments
Hi Everyone, I read through
Hi Everyone,
I read through this thread and I tried what Funana suggested, but I have a different scenario going on. On my page, I have a View that is showing published Content as Teaser. This content consists of products that are each linked to a Taxonomy Term. For example: The view is showing floor tile that is of a kind, known as (taxonomy term) Saltillo. So this View displays products that are associated with that taxonomy term. Here's the page in case you want to see it in action: https://www.hitflooring.com/tile-material-type/mexican-saltillo. (Sorry for being redundant, I just want to be sure that whoever reads this and can help me, fully understands what this view is showing).
Ok, my issue that is that some of these product displays have more than one product referenced to them. That's exactly what I want because what I'm trying to do is have 1 display for 2 products that are of the same name, but have a different size and different price.
In this View, I'm seeing a little box above the Add to Cart form that shows that the customer can choose the same product, but in a different size.
I don't want that box to appear in the View that displays teaser products associated with that taxonomy term. I want that box to only appear in the default view when the customer clicks on the product.
I tried doing what Funana suggested with Query settings and Aggregation, but it doesn't keep the box from showing in the View.
Looking at Manage Display in this Product Type, teaser view, I only see: "Title", "Image", and "Price" as fields that are being shown. I don't see any field for displaying product references.
Is there a way of getting rid of the box that displays the product references on a View that displays teasers?
CSS display:none
You could do what you need with css by targeting that particular select list by id with ..
#edit-product-id--3 {display: none;
}
To do that more generally you could target some of the classes on the wrapper elements for the select list
so it would apply to other such select lists if you need that.
But that drop-down select list is part of the add-to-cart form and that includes the add-to-cart button.
That makes other solutions likely more complex.
Wetcoaster, I used your CSS
Wetcoaster, I used your CSS solution and it worked! Thanks a million!
I'll try what you're
I'll try what you're suggesting with CSS and see how that goes. The thought of using CSS for that hadn't even crossed my mind! I had spent a good few hours in Views trial and error-ing there with no such luck. Thank you for your reply wetcoaster :-)
Select fields are wrong
Instead of seeing a size select field I'm seeing the different product titles (listed in the product display) appearing in the select list.
The product names are the same, the price table is the same, as it's only the size field that needs to appear in the drop down. Everything I read implies that it's the size that will appear as an add to cart option as I selected but I'm just not seeing it. Basically - I have 20 products, same name, same price table but different dimensions and want the dimension to appear in the select option before adding to cart.
Deleted everything, redone it, gone through it all slowly... same results, feeling very dumb.
Any ideas please?
display those fields in the shopping cart
How do I display those fields in my Shopping Cart? I want the user to see what exact options he selected to purchase and if possible make those options dropdown box so he can change it if it is wrong?
I checked around in Views of my shopping cart but couldn't see the exact fields to display...
Thanks for the help
Create a product display node
Create a product display node (node/add/product-display). In the
"product" field, select the products that should be shown on this node.
Was expecting separate fields here but it seems that you enter al the products on one line i.e. sku1, sku2, sku3...
How to create attributes with unique SKU's
Hi, do I understand it correct that each product attribute requires the admin to create a seperate node and node-type?
Say my shop is selling food (www.ruudmaaz.nl, built with Ubercart 6.2.x) and among other products it sells bread and coffee.
Each bread can be sold either sliced or unsliced. Every coffe can be sold ground or unground. Every attribute (sliced/unsliced; ground/unground) needs to have a unique SKU and different price.
Does this mean I need to create a coffee content-type and then reference the ground and unground coffee-node? And the same story goes for bread, meat, fish, tea, cheese etc??
That seems undoable to me.
it created a product display for every variation
Thanks Ryan for the help...I did as you mentioned at the beginning of this post. My extra field I added was "File Type" because I am selling downloadable images that comes in different file formats...
I then created a Product in Store for every different file format of the one product which gives me 5 products at the end.
But when I go and create a product display of the item and I add all the products (seperated by commas) it needs to associate together into the "Product" field...it goes and create a Product Display for every variation... is this how it's gonna be? I understood it would create 1 product display with the different options within to choose from?
(I just checked now and saw that in "Content", there is only 1 Product Display which references all the different products for the fileformats...but somehow Views is showing 5 product displays even though there is only 1 of them in content...)
Thank you for your help
...anyone else experiencing this problem?
Question
Sorry....kind of new to this. Got all the way down to creating a new "product display node". Got lost here on how to do. Can anyone help?
Thanks!
This should help
Visit yoursite.com/node/add/product-display or in the 2nd top menu bar "Add product display" is the 2nd link from the left in the default install of drupal commerce. Add your node from there.
If this true, DC is toast.
If this is how attributes work, I hate to say it but this only works for new businesses with no prior catalog and with few variations. You try telling a business that has been in business 10 years with 2.500 products and skus: "Hey...Guess what? If you want to use DC you will need to create an additional 7500 SKU numbers and pay me an additional 10K to seat here and create all possible combinations of all your products."
They will laugh you out of the room.
I have a client with 59 products EACH with 29 possible fabrics. If this is correct, it means I will need to create 1711 PRODUCTS and 1625 new SKUS.....I think not.
Unless this post is completely incomplete....this is BEYOND acceptable and pretty much puts DC out of game for anyone with a considerable large shop.
This MUST be incorrect. It has to be.
Not so fast....
@kannary. DC is not toast. Please learn more about Drupal Commerce before publishing your criticisms. There is an easy way to accomplish your goals for your client with a total of 59 products. Drupal is free and all of the modules are free as well. No user is entitled to support. That being said, one should expect to spend a significant amount of time learning.
Your use-case scenario includes custom product that may not have their own SKU. Maybe you should check out the Commerce Product Option Module.
http://drupal.org/project/commerce_option
Thanks for the tip. By the
Thanks for the tip.
By the way....I have been a Drupal dev for 3 1/2 years. I run a full Aegir-backed system with 20 clienst on Drupal; I appreciate the information, but for the love of God, I wish people WOULD STOP presuming just because someone puts out a little bit of frustrated criticism they MUST BE noobies with no clue. As helpful as your intentions may be, the condescending angle is annoying as hell. Try to avoid it in the future.
And nobody here is demanding anything, just asking a question.
Its quite easy to tell you
Its quite easy to tell you are a noob. 1stly your complaint is none constructive , in IT there tends to be discussion using constructive linguistics where we can not use negatives and only discuss in solutions. You have not pointed out any. 2ndly you do not point out any code that seems to hinder your companies objectives nor code related solutions to your problem. The manner in which you present this argument is fairly poor ,so getting angry of the interpretation and manner in which you think the reply has responded is .. time wasted.
I would suggest heavy to exaggerated learning of php && module development to try and improve on the code instead of very unhelpful comments. Developers comments are in the code.. not on a sites comment box.
BTW - Blaspheming ( you just happened to capitalise "G-d" ) is a bit harsh. Just as I believe you to respect the anarchy and self obsession of atheism so too should you maybe consider respecting the sanctity of another's ideologies.
//There is always a bigger fish and by that I mean compared to Dries you are a noob.
I came here for the same
I came here for the same reason he did, hoping I would come across a missing bit of information which spelled out why anyone would push for using hand coded lists instead of reusable taxonomies. A question I have yet to find the answer to.
I've been racking my brain trying to figure out what use case would even require this reinvention of the node display wheel, seeing as nodes already support multiple displays, so why the desire to force people to make a generic 'product' node type as well as a half duplicate 'product display' eludes me. If such a use case were needed, Drupal would have the same issue with all node types, not just product node types.
I plan to keep searching, as I have a furniture store (700 products, many of which have vendor specific material and size selection options) which is expecting a product they can add a single product to without needing a 100 page owner's manual and a week of training.
BTW - How about you keep your name calling, religious hatred and arrogant assumptions to your pulpit sessions. You don't know him, his experience level or his religious affiliation.
Read about import techniques
There are a variety of automated ways to import products, including feeds, migrate, etc. And there are bulk product creators and automated SKU creators. You should probably calm down and read more.
Sorry, not cutting it. I have
Sorry, not cutting it.
I have read EVERYTHING. I have used Feeds and I have used the bulk creation. And NEITHER comes even close to being as easy and a good old taxonomy system. Just because someone complaints about something does not mean they are noobs who have read nothing.
The issue is not just the amount of work but the logic: Why on earth would anyone have to go through the process of generating 1711 products when you can use another shopping system that implements a proper taxonomy which is THE LOGICAL THING, something that can be reused across products, needs to be edited only once and can be assigned to any product? Suppose you need to edit or delete one product? What? Search for the 200 products EACH with their own SKU number? What happens with clients that have their store synced to Quickbooks? They now ALSO need to edit their accounting? And how ONE EARTH do you even convience a client that they now suddenly need to add and additional 1711 products to their Quickbooks?
But thanks for the reply anyways.
but why not?
I understand your perspective, but I still think you are considering it from the wrong angle. Without unique SKUS, how does your client manage inventory? I'm guessing they don't or they make everything custom to order. Often, a client may have inefficient systems in place and ask you to work around them. There are many benefits to creating unique SKUS. Stock control and detailed reporting to name a few. Unique SKUS also make for easier order management in my experience. If your client is unwilling to change their current system and adopt better practices, well fine. You can work around that. Research modules that have been built to accomodate your use-case and you will find a solution. I'm not trying to belittle you, I just think you are asking the wrong questions and you will find your solution in a module that has already been created.
I Agree
Also, the client SKU does not have to be the Drupal internal SKU. I'm happy that my supplier provides unique IDs for ervery product combination (color, pattern...). If he wouldn't I'd create them in a spread sheet and map them with the client product IDs.
Not able to create field level dropdowns in Product Display...
I followed the above instructions word to word but still not getting the field level drop-downs for Color and Size. I created a new product type of "t-shirts" with 2 fields COLOR(with 2 colors) and SIZES(with 3 sizes). Also set the parameters as "unlimited" for the Product Reference field in the Product Display and "Enable this field to function as an attribute field on Add to Cart forms" in the Product Types. As mentioned in one of the comments, all the products referenced were also the same Product Type. Please help if I am missing something... thanks.
I had same problem
Check your content type display to make sure it is set up correctly.
structure > content types > edit (beside whichever product you want a dropdown)
Click 'manage fields' tab
Click 'edit' beside your "Product reference" field. If you don't have a product reference field, add one!
Scroll down to bottom of this pane and make sure "Number of values" is set to UNLIMITED. (I had set mine to unlimited in the product by accident instead of the product display!!!!)
When you go to add a product you should be able to select multiple options from the list that are going to display to the end user when they view your product:
(add content > "content type for your product")
You should see a list of multiple options your can shift-click to add all of them to your product.
End user should now be able to see a dropdown menu of attributes when viewing product! I like this system because it is so flexible and it will reload the image depending on what is selected in dropdown. I think people maybe are getting frustrated by the unintuitive way setup works, but I'm liking the flexibility.
Then again I'm coming from using Catalook cart with .net which was the worst cart ever from a designer standpoint
1 makes 16?
I get the impression that if I, say, want to sell a hat that comes in 4 colours and 4 sizes, I have to MANUALLY enter (and reenter) the exact same information in every field of the 16 product varitions. Please tell me I am wrong.
Can't I just create this product ONCE and give the customer two drop downs to choose colour and size respectively? Possible with automatic generation of SKU (e.g. HAT1-GREEN-S, HAT1-GREEN-M, HAT1-GREEN-L, HAT1-RED-S etc.).
Or can't I at least clone the first product and then only change the content of the two fields (size & colour) necessary for each of the next 15 variations? All other fields contain exactly the same descriptive text information, and work load is increased immensely if cloning is not possible.
I love Drupal flexibility. I want to love Drupal Commerce too ...
Thank you.
Please look at Feeds and
Please look at Feeds and Commerce Bulk Product Creation
Thanks, will have a look ...
Thanks, will have a look ...
Field with user entry
Ubercart attributes allows text field for shoppers to be able to add custom text to a product as an attribute of the product. For example, if you sell award plaques you can give the shopper the ability to include the award recipient's name to be inscribed on the plaque.
Is it possible to provide custom text fields in commerce products?
Custom Line Item
That's a field on the line item. See http://www.drupalcommerce.org/node/973#comment-2102 -
I'll probably do a little screencast on this before long.
Edit:
Here are two screencasts on custom line items.
Introduction to Custom Line Items and Using Custom Line Items to Provide a Donation Feature
Using Vocabulary terms instead of List(text)
Is there any way to use vocabulary to achieve this? If we create a vocabulary for color and a seperate vocabulary for size, we could add both of these vocabularies to the product field so that if we need to add a new color, we could add it to the vocabulary. This would make the creation and management process a lot more flexible.
Thanks,
bbjay
Update: I tried it today and it seems to work as long as the "Enable this field to function as an attribute field on Add to Cart forms" is checked and number of values is set to 1.
Must be same product type
I just found out by digging into the code that these attribute fields only work in product displays if all the referenced products are of the same type.
Field with user entry
Thanks for above example, but it works with predefined selection. But what if a user needs to enter manually some data? We have a SW modules for sale, and there user must choose licence type (above example covers that), but then enter number of users he wants to have (text field/integer). How can I do that?
Allowed values
Is it possible to not use the 'allowed values' restriction from the list(text) field? I need to be able to import the product attributes, but when an unknown value is encountered, I want it to be created ad hoc.
The unknown attributes are truncated right now, the product display (add to cart form) shows only the product title, but those are all the same (because I want to discriminate on size/color/whatever).
So what I really need is a way to use a normal 'text' field as the attribute selector on the add-to-cart form.
Did you ever find a solution
Did you ever find a solution to this problem?
Allowed values not normally respected on import
You don't mention what technique you're using to import, but I know of no non-custom import technique that would automatically provide default values on a list(text) for you.
You may be interested in using commerce_migrate with customizations, etc.
thousands of combinations
Hi!
We have a situation where the product has 4 different attributes with 3-30 different options! This means that we'll have to add all these hundreds of different products in the system as different products????
That's totally unproductive. Because if tomorrow there is a new option, the client will be impossible to add all the different combinations.
There should be a better way. Could you please point me to the right direction?
thank you,
Yannis
Need solutions in contrib
You may need a custom module to generate the products.
We'll be looking forward to good general solutions to this in contrib, but I don't believe there are any yet. The Bulk Product Creator has potential, but I don't believe it works right now. The list is at http://drupalcommerce.org/contrib.
A better module
I think the right solution is to show to user (content creator) "the same thing".
A field widget (for product reference) that in new node show one column for each attribute (then MxN rows for example), and in each row: stock level, price, and any other field specific.
In edit node, the reference should show the same thing .. is it possible to write such a module? I am working on other project but I can spare some time for this if it look as a viable solution
missing ...
for each row a checkbox "product present"
Does it mean the number of
Does it mean the number of (sub)-products would grow exponentially with the number of attributes?
Yes, every unique combination
Yes, every unique combination of attributes is a separate product. Every unique item has its own SKU.
Note that this is the way Amazon does it as well - every unique item has its own ASIN. (The difference there is that they also have ASINs for higher-level items, like bundles and master products.)
I dont think this should be
I dont think this should be called attributes as users from the ubercart community will think it will act in the same manner. From the admin's perspective this is just a cool way that cck fields are used.
Many such as myself will want the ability to fix a different price for each of the option of the size and color as suggested here.
Real price attributes will become available or not ?
It's surprising to see how drupal can be flexible, and how rigid can be drupal commerce. No ?
You really think that if a webmaster have 10 000 products and create only one more attribute, he will have to (re)create 10 000 products ?
Of course, rule can (certainly ?) make the job for us, but would it not be fantastic to have attributes linked to an increased (or decreased) price ?
I mean, take an exemple (my own): I want to sell pictures (photos): the initial image is always the same, but when you order, the customer can choose the dimensions, linked to a different price...
So if I have
• 3 different dimensions, (and so different prices)
• 4 different paper + 3 different other support (for ex. wood, plastic and aluminium)
• +2 numeric resolution for numeric downloaded images: low and high res.,
each time I upload an image, I have to create 23 different products ???
If so, the commerce module is just not usable for products with price linked attributes, no ?
Sometimes, I hope I really have forgotten an option that will solve all the (my) problems, but when I read other posts, I unfortenately understand that no
is this problem not solved
is this problem not solved yet? I'm looking for the same thing for one of my sites.
not solved, Commerce bulk
not solved,
Commerce bulk product handle the job amazingly, but one problem remain, at the product display level, since I have product with several attributes, and within, I for test, did limit to 3 options, I have the following message : "Product cannot be longer than 128 characters but is currently 11086 characters long"
Which I am not surprised at all.
You end up with thousands sku and you're suppose to let them fit in 128 characters.
What bugs me is how you could miss that? I check the commerce guys website and you present yourselves as the top notch e-commerce/drupal.
Well, if you make such statement, you may have to deliver. Otherwise if the rest is not that bad may be it should have come with a nicer workflow, automated.
I may have a client that want to use the website without me in his back. So how will I have to tell him he has to go there, and there and there... and I haven't tested yet a additional attribute or option to see how Commerce bulk product handle the update... It might not work at all.
So DC not toast, but not ready.
When you find a bug, file an issue
Drupal Commerce is an open-source, community driven project. It has bugs, as all software does. I don't know if you've found one or not. But when you find a bug, you describe it clearly in a new issue in the issue queue, not by venting your frustration in a forum entry.
I would change the widget of the product reference field from autocomplete (which is a text field) to a select list. I would suggest you're using a widget that isn't right for your application.
Well then you tell me if I
Well then you tell me if I have to create a "frustration" issue if forums are not appropriate anymore for express a point of view.
According to Commerce Guy Vision (video) : "Our aim is for Drupal to be the number one e-commerce plateform in the world."
Then deliver. I haven't ask no one to make such statement. It has to be founded.
I did change for list, but don't think it's a bug, it's a choice made from you guys @ Commerce to go with autocomplete. May be you missed the possibility that a product could have several attributes/options.
And still the approach to deal with the skus, is way too hard to manage, if I ever have a new option, I have to regenerate the all possible combinations. Make little sens. At least that should be optional.
I know you wanted to change what UC did regarding option, based on the fact it was complicated at DB level... I thought I was not suppose to go there anyway so I'd rather have an easy dev way.
But you might find yourselves finding limitation as well since I haven't seen nowhere how to implement a variable price based on an option.
Ok, Rules should achieve that, and that another understanding, that Commerce actually is Rules.
But can a Rule impact an option? An attribute I could find.
Anyhow, I have a hard time to seize the adopted logic, and then I have a hard time to clear the process up without missing interventions.
Otherwise, there is hope in the contributed modules,
I found that Commerce Product Option allow some room to deal with option. I haven't tested it yet. But on paper sounds good.
The other good thing with this module is that there is no more need to generate sku for all combinations.
But since it might work with a different logic than Commerce itself, how compatible it is?
Commerce is a toolkit
You won't be much able to come to terms with Commerce unless you recognize it as a toolkit, rather than a finished ready-to-use product. It's not intended to be a one-size-fits-some product, but rather a toolkit that can build a huge number of different possibilities.
Changing widgets for fields in Drupal is a normal thing. The autocomplete text field would be inappropriate for your use. Drupal lets you use many.
I should note that it's the Commerce Kickstart distribution that sets the field to autocomplete. You seem to have chosen that and let it do all your "default" configuration. But you didn't have to do that. You could have created the node type yourself, and made explicit choices for your field widget.
Sorry to repost this
Hi Randy
Sorry to repost this query but I didn't know if it got missing through the cracks. I did as you said in your original post, but it created a product display for every variation... My extra field I added was "File Type" because I am selling downloadable images that comes in different file formats...
I then created a Product in Store for every different file format of the one product which gives me 5 products at the end.
But when I go and create a product display of the item and I add all the products (seperated by commas) it needs to associate together into the "Product" field...it goes and create a Product Display for every variation... is this how it's gonna be? I understood it would create 1 product display with the different options within to choose from?
(I just checked now and saw that in "Content", there is only 1 Product Display which references all the different products for the fileformats...but somehow Views is showing 5 product displays even though there is only 1 of them in content...)
Thank you for your help
Works fine for me
Hi,
I have to say that the module works fine for me, although I had to search for some solutions. I just want to share my experience here.
Possible solution A:
1) I click on "Query settings" in the third column, and in query settings enable "Distinct" (it's a checkbox).
That kills the duplicates.
However, DISTINCT is usually a bit stupid, so it might not work in all cases. In those cases, you can try possible solution B:
2) I enable Aggregation (again, it's in the third column). I make sure to have a "Content: Nid" field added at the top of the fields list, so that it groups by that first. Might need to apply "MIN' to the title (by setting: Aggregation type to "Minimum" in "Aggregation settings" for that field).
Note that once you do that, the image will stop displaying. The solution for that is to go into "Aggregation settings" for the image field, and change the "Group column" from "fid" to "Entity ID". That makes it display again.
After doing this Drupal shows an error message "Undefined index: currency_code in commerce_price_field_formatter_view()" which might be solved with setting "Group Column" setting for all fields to "Entity ID" (http://drupal.org/node/1251522#comment-5106672).
I hope I could help and again thanks to all DCommerce developers and contributors for this amazing module. Great work! (Nice Captcha by the way ;-)
[Edit] Note: I don't know if this is related, but after playing around with the group configuration I found the product content type not displaying the price anymore. This could be solved by enabling the field in the field configuration of the content type though.
thank you funana
Thank you so much funana for taking the time to post your solution...I really appreciate it!!! I did as you posted and it works!!! I've been struggling with this issue for so long...it's a huge relief!
I did however not have the same problem as you did with the price disappearing...but then again I don't have the modules "bulk product creation" or "product display manager" installed so maybe the problem lies therein. But all the other behaviors you mentioned I experienced :)
Thank you for your help!