This may already be possible, but I can't figure out how to do it. What I want is to give the user some options, but I want them to be in checkbox form. This way, if they choose any of them, then those options are added, otherwise none are added. Is there a way to do this? Or possibly making them radio buttons instead? Checkboxes are ideal.
In the latest code (after beta 6) attributes get display options which let you choose between textfields, select boxes, and radio buttons. Checkboxes don't fit with the way the data is stored, and changing things to allow for them would make the model adjustments very difficult to deal with. Maybe that can be addressed again for version 2.0, but it's looking doubtful. We'll see.
Thanks for the response. That makes sense. I do have a question, the version of ubercart that is on the site I am working on is 5.x-1.0-beta1. I have created an attribute with no options (thus a textfield appears for the attribute). However, there is no checking done on that attribute, so if I type in </td></tr></table></div> then it messes the page up quite a bit. I was wondering if there is a way that I can hook in to a product and check the attribute once it is entered so that I can verify it is valid?
Wow, that's no good. There needs to be a check_plain() on line 1433 of uc_attribute.module. That'll be in the next release.
Users looking for update instructions, read this. The line number above may be incorrect and doesn't really show the fix, so look for a function in uc_attribute.module named _uc_cart_product_get_options() and change the following:
<?php
// From:
'name' => $oid,
// To:
'name' => check_plain($oid),
?>(Lyle, please correct this if I missed anything.
)
If I wanted to implement some sort of checkbox style attributes for Ubercart, where would I start? (I.e., a list of 20 different "additions", each of which add a small amount to the cost.) I have use for this, and am willing to put some time into coding it. Is there any way this could be done as a contributed module?
Check boxes are one of the most basic (and useful) elements of HTML input forms Ubercart not supporting the basic html form elements is shocking. It is a shame you don't warn your users before developers waste valuable time on an incomplete shopping cart. Has there been any progress on this bug or a module that fixes it? I cannot imagine any series e-commerce site going without check mark boxes.
It's hard to form a constructive response to your post... Attributes by nature were designed to have a single option from a group of options. There's nothing to warn here, and there is no bug. If you want a different behavior, you have to develop for it, and in this case you can make a whole list of on/off attributes and alter the form display to render as checkboxes... maybe. Please do some research before firing off random criticism that doesn't even pertain to the poster's question or the module's intended functionality.
Thank you very much for your thoughtful reply to my, very poor post. I should have taken the time to construct a thoughtful and fair post that might be helpful to you. I posted that after a 12 hour session with Uber-cart... I should have taken several days off before commenting on the forums.
Having said that let me go ahead and give a worth while post a try because I think checkmark boxes are extremely important for Uber cart's growing market.
I ended up going with a different shopping cart because they supported check mark boxes for item attributes. However, I still feel the client got a weaker site because of it. Ubercart is one of the best shopping carts out there, and I commend you for building an amazing community and great documentation! the "Other" drupal cart guys have a lot to learn from you.
I will use Ubercart for any site that does require check mark box for item attributes. A silly example to demostrate this that we can all follow is a sandwich. A sandwich can come with lettuce, tomatoes, or cheese, or all 3. Having a sandwich with only chesse or lettuce is a deal breaker.
I did extensive Google searches of the site and a ton of research into what it would take for me to add this feature to ubercart, and I quickly realized it was beyond my project scope. I did the best I could to locate the appropriate thread as I believe this user is having the same interface problem that I have. If there is a better place for me to post, and my need for ubercart to support check mark boxes, I'd be happy to have my comment moved to the correct place.
While I understand it maybe difficult for you to support check mark boxes as well as radio buttons, I think it is a core feature of a shopping cart, and all the major carts have them except ubercart. In all the e-commerce sites I have built, there is at least one key product that has multiple options where a check mark box is simply the required html form element to capture user input.
Greg
I'm curious to know a little more, as I don't see any reason we can't support checkboxes in some form...
1) How does the cart handle the display of these multiple-select options? Does it handle them altogether or display them separately? I ask this because....
2) Perhaps you could accomplish this using several attributes on one product. Each attribute has essentially two options... Yes and No (or some variation of that). A small custom module can turn the appropriate form elements into checkboxes from radio selects and make sure when the form is submitted that a checked box is represented as the "Yes" choice and an unchecked one as the "No."
I know that's not an ideal solution, but I'm still having a hard time understanding what a multiple select attribute would even look like. It sounds like it could be used mainly for add-on products (yes I want this and that with my purchase of product x) or marking multiple attributes at once (I want the manual transmission but not the spoiler).
I don't remember what we initially wanted to do with this, but we got around it. I am currently in the process of making a module that is basically the abstraction of products. Here is the basic idea of what we did and how we accomplished it.
We sale school courses and a user can buy Q1, Q2, Q3, or Q4 or a combination for semesters or for a full year. We had this as an attribute that the user would select. Recently, we decided to create each course-quarter as it's own product. So math-Q1 and math-Q2 were it's own product. Similarly, a course may have materials that need to be purchased with it, and so the user can either say yes or no to those materials (the materials were also simply an attribute, but we decided to extract them as well for ease in reporting). So now the issue has become that we want a user to purchase Math and still see the same options (Q1, Q2, Q3, materials, etc.).
To overcome this, we created a new content type that we named the same thing, and then set up fields that would correspond to each product. So there is a quarter 1 field and you need to map it to the product that this corresponds to. Similarly, do the same for Q2, Q3, Q4, and course materials. Then in the content template body section, we wrote code that creates a form based off of these options (We are still using select boxes, but simply changing the '#type' to checkboxes would solve the issue above). The submit hook looks at the different selections, and adds the corresponding products to the cart. I had the code setup so that this could create a product kit if needed and add that to the cart, but we decided against that.
Anyways, this sounds kind of like what Ryan is getting at, but I agree that it would be nice if there was some other way to do this or to allow checkboxes for options. The code I wrote is very specific, and at the current time I don't see me having time to make it into a module that everyone could use, but I would be happy to answer any questions about more of the setup I created.
Having several attributes, each with a "Yes/No" option does basically work, but it's a pain to enter all those.
We're building a site, for example, where people register for conferences (each conference being a product.) But conference registration can get complicated. Aside from the differences in base price for different levels of group membership, there's issues of:
How many days will you be at the conference? Do individual days have specific prices? Do different meal plans (Vegetarian, Kosher, etc) have different prices? Does each session have a price attached to it?
Representing these as "Yes/No" radios would be fine; the real issue is one of generating these options.
For example, for the individual sessions example above, I'd have to create an attribute for *each* session, then create an "Yes" option with the price and a "No" option. This is at least 3 screens to click through per option. For an organization with a lot of conferences and a lot of options per conferences, this can really eat up time.
Whereas, if we could create one attribute, and then one option per "add-on", each of which adds to the price, this would go a lot faster. (And make more semantic sense - since each of these options would be grouped together.)
I wonder if your situation wouldn't be better served by an enhanced UC Node Checkout module? I've posted it at http://drupal.org/project/uc_node_checkout and used it for Lullabot's Do It With Drupal conference. The idea is that I can add any CCK element to the registration node, instantly giving me access to all the different widgets CCK provides. The only drawback as I see it for your situation is that choices on the node form don't affect the product price. That's where you'd need to customize it.
But if the attributes are limited that need to alter the price, perhaps that can be solved by my proposal to get attributes into the node form for UC Node Checkout governed node types.
Check it out and let me know what you think.
Do any of the more recent versions of Ubercart support checkboxes yet?
I'm building an order form for a "tailor-made vacation" and one of the attributes is, "What kind of experience would you like", with options for "Safari", "Birding", "Fishing", etc. Now someone might want a Safari experience and a Birding experience but, currently, they can only select one of the options.
Help?
Will have a look at UC Node Checkout!
But still I can't believe that Ubercart isn't supporting checkboxes, I just can't!
I'm hoping j_ten_man will post his code here and maybe I can use it to try and develop some kind of module to implement checkboxes.
If I can get checkboxes working ubercart might just start ruling all them carts that do have checkboxes... 
Cheers
well I'm going to add my two cents in on this, after banging my head on this problem for a bit...
here is what we need to do, you can see some examples. The first one you can see here:
http://www.conference-board.org/economics/bci/data_search.cfm?cid=1&o=2&...
I could add up the prices with javascript, but these are all one-off attributes for the content.
The second item is similar to other posts on this thread in regards to conferences. I believe UC node checkout is a flawed way to impliment conferences, and definitely not scalable for large projects. Imagine if you're running a website that hosts 5 to 20 conferences a year, each with 500-25,000 people. That meas an extra 2500 to 500,000 nodes PER year! nope. But I digress. We need attendees to select sub conferences per main conference, in a checkbox.
I'll report back my findings here. My guess is a new module is coming to replace attributes.
Please see this patch: http://drupal.org/node/400660
Looks like checkboxes will be available in UC 6.x-2.0-rc4.
By using product kit for adding product with sub product , i want to that sub product as checkbox on cart page. whenever add product from node/add/product , then having option to change attribute type but there is no option whenever add product with node/add/product-kit.
Do u have any option to change list attribute into checkbox in multiple sub product.
Thanks
Shyam



