Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Enable Quantity in Bundled Product with Checkbox
 
chadjmorgan
Sr. Member
 
Avatar
Total Posts:  252
Joined:  2010-06-04
Michigan
 

thanks for the extension!  does anyone know if it is possible to somehow (programmatically or through javascript or something) make the checkboxes inherit the same quantity as is entered for the other product?

for example,

I have shirts that have checkboxes for embroidery and lettering.  Say the customer orders three shirts with embroidery.  I think they will not realize they need to enter 3 for the quantity of the embroidery also.  Can anyone think of an idea to make this work?  I was thinking if somehow the text boxes would be linked and automatically update to equal each other.  Or better yet, it be done behind the scenes so quantity boxes are not needed.  Thanks for any ideas / help!

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

@chadjmorgan:

I’m confused by your example. It sounds like you are talking about a “simple” product (shirt) with some “custom options” for selecting what kind of extras that customer wants. Shirt customization are probably not best represented using bundled products. Bundles are used to sell multiple simple/virtual products as one item. That is probably not what you are trying to explain. If you had a working example somewhere that would really help.

At any rate, the Qty’s for “bundle” products work as such. There is always at Qty box displayed for the entire bundle product (the base/parent product). For example, if the bundle product is a box of chocolates, that Qty box represents how many boxes the customer wants. The bundle option(s) for this product might be used to specify what type of chocolate the customer wants in their box. Using the checkbox option with User Defined Qty, it allows the customer to specify exactly how much of each chocolate they want in EACH box. Each of the chocolate choices are actually individual products in Magento.

Example Illustrated:

My Box of Chocolates
‘’Selections:’’
1 x Milk Bar
2 x Dark Bar
4 x White Bar

Now if I set the Qty to 2 x My Box of Chocolates, the order will be placed with:
2 x Milk Bar
4 x Dark Bar
8 x White Bar

There should be no Qty “syncing” needed. However, there is currently not way to set up dependency chains/rules based on option selections. For example, I cannot tell Magento if the customer picks 2 x Milk Bar they must also choose 2 x White Bar.

I hope this helps!

 
Magento Community Magento Community
Magento Community
Magento Community
 
chadjmorgan
Sr. Member
 
Avatar
Total Posts:  252
Joined:  2010-06-04
Michigan
 

thanks for your reply kable!  I will send you a link to my example.  It is a bit confusing!  I forgot to tell you I am bundling a configurable product (the tshirt) and two simple products with custom options (embroidery and lettering).  Your example is exactly what I need to do, however it does not work that way for some reason.  Im sending you a PM with my link

kabel - 10 September 2010 08:07 AM

@chadjmorgan:

I’m confused by your example. It sounds like you are talking about a “simple” product (shirt) with some “custom options” for selecting what kind of extras that customer wants. Shirt customization are probably not best represented using bundled products. Bundles are used to sell multiple simple/virtual products as one item. That is probably not what you are trying to explain. If you had a working example somewhere that would really help.

At any rate, the Qty’s for “bundle” products work as such. There is always at Qty box displayed for the entire bundle product (the base/parent product). For example, if the bundle product is a box of chocolates, that Qty box represents how many boxes the customer wants. The bundle option(s) for this product might be used to specify what type of chocolate the customer wants in their box. Using the checkbox option with User Defined Qty, it allows the customer to specify exactly how much of each chocolate they want in EACH box. Each of the chocolate choices are actually individual products in Magento.

Example Illustrated:

My Box of Chocolates
‘’Selections:’’
1 x Milk Bar
2 x Dark Bar
4 x White Bar

Now if I set the Qty to 2 x My Box of Chocolates, the order will be placed with:
2 x Milk Bar
4 x Dark Bar
8 x White Bar

There should be no Qty “syncing” needed. However, there is currently not way to set up dependency chains/rules based on option selections. For example, I cannot tell Magento if the customer picks 2 x Milk Bar they must also choose 2 x White Bar.

I hope this helps!

 
Magento Community Magento Community
Magento Community
Magento Community
 
haveluggage
Jr. Member
 
Total Posts:  1
Joined:  2010-09-12
 

Im getting an error too!!!

with an Undefined index:  bundle_option in Sales/Quote.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

@haveluggage:

Sorry to hear that your install is generating the notice you mentioned.

Without more information about what is causing this problem, I cannot really provide you a possible solution. I will mention that Sales/Quote.php is NOT rewritten by this module, so any errors generated by that file are probably due to some other module you have installed OR an issue with the Magento Cache.

As recommended by Magento, I would clear the entire cache storage (var/cache/*) to ensure your install is pulling the most up to date configuration and code base. If you are still having this issue, try removing all of the files from my extension and confirming that everything still works. If not, you should be able to do some other debugging to figure out what files are causing the issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
frankjos
Jr. Member
 
Total Posts:  7
Joined:  2010-05-20
 

Does anyone know how to change the default value for “User Defined Quantity” from “Yes” to “No”?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

@vkjosh:

The “Yes” value is selected by default because browsers will selection the first option of a dropdown if no option is explicitly selected. You can try to edit this default behavior with JS. The file I’d recommend editing to accomplish that is selection.phtml (from the adminhtml theme). Look for the addRow JS function. It may be able to help you choose “No” by default if data.selection_can_change_qty is undefined.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Philster53142
Member
 
Total Posts:  67
Joined:  2009-10-03
 

Now if only we can get rid of the check-box altogether and just have the quantity field by itself. That would be cool.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

@Philster53142: And just assume that if the Qty field is blank (or invalid), don’t add it to the cart? I bet that could be accomplished (using my code as a launching point).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Philster53142
Member
 
Total Posts:  67
Joined:  2009-10-03
 

Does anyone know how to get rid of the QTY field at the bottom for bundle products only?

For example,

Bath Towels (Beige) qty 2
Hand Towels (White) qty 4
Wash Cloths (Burgundy) qty 6

Wouldn’t it seem silly then to ask how many of those quantities they want? like this…

QTY ___ [Add to Cart]

That just seems odd that you can’t deactivate the main quantity field. I know that Group Products don’t have a final or total quantity… but I need to use Bundle Products for custom options.

So how to deactivate or hide the final or total quantity for Bundles?

Any help is greatly appreciated.

oh… and here is all that exists in “addtocart.phtml” however I’m no programmer and don’t know how to make it look for a “bundle” and if bundle don’t show quantity field.

<?php $_product = $this->getProduct() ?>

<?php if($_product->isSaleable()): ?>
<fieldset class="add-to-cart">
<legend><?php echo $this->__('Add Items to Cart') ?></legend>
<?php if(!$_product->isGrouped()): ?>
<label for="qty"><?php echo $this->__('QTY') ?>:</label>
<input type="text" class="input-text qty” name="qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>” />
<?php endif; ?>
<button class="button" onclick="productAddToCartForm.submit()"><span><?php echo $this->__('Add to Shopping Bag') ?></span></button>
</fieldset>
<?php endif; ?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

@Philster53142: If you don’t want it there for any bundle items, just take it out of the addtocart template (/app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml) by putting in some kind of IF ($product->getType == ‘bundle’) ...

However, the overall QTY ___ [Add to Cart] is intended to multiply all of the selections by the final Qty. This is especially handy if your base item (the actual bundle item) has a base price or in some other cases.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nihifire
Jr. Member
 
Total Posts:  9
Joined:  2008-12-17
 

Hi!

In reference of Post: #26 the single price in checkout is calculated wrong and I`d like to know how to correct this, because paypal use this single price to calculate the total price and the transmission is faulty.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

@nihifire: The person that reported that error was unable to provide more details on how to replicate the error. The error may have something to do with the Magento version install or (as I’m more inclined to believe) there is an issue with the translation that is being used. It is unfortunate that I am only fluent in U.S. English, so the screen shot provided was of little use to describe what was really happening.

I recommend you turn on Magento logging in the admin panel to see if anything is not performing correctly. The setting is under System > Configuration : Advanced > Developer > Log Settings.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nihifire
Jr. Member
 
Total Posts:  9
Joined:  2008-12-17
 

Okay, I`ll try to describe it more clearly. I`am using version 1.4.0.1 of magento with a German translation.

The calculation under product name is correct (for example: 2 x HDD 20$) as well as the Subtotal but the unit price is not summed up when you choose more then one of a product (it shows 10$ in this example, but must be also 20$).

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

Holy cow!! (pardon the common American phrase) How did I miss that. This is most certainly a Core Magento bug. I’d report it, but I will likely go completely ignored. So I’m working on a patch now.

This obvious error in display is not limited to my user-defined qty’s for checkbox items. The same result happens for ANY bundle option that allows for a user-defined qty (radio buttons, drop-down, and checkbox).

An updated release of the Kabel_BundlePlus module can be expected in the next few hours.

[EDIT]:

The patch is finished and has been tested with multiple bundle items. Now available for download at https://docs.google.com/leaf?id=0B3vwOF6cNaa6YTlhZGI1NDYtODg1ZC00Zjc3LWEwYzYtNDczZDYxYTdiNzI1&hl;=en&authkey;=CJihvukO

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top