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
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 

axaios: Magento v1.5 introduced the ability to “Edit” products in your cart. You do this by (1) making sure you have at least Magento 1.5 installed and that the “theme” you are using has been properly updated to support the new cart display, and (2) on the cart page, click the “Edit” link that should appear as one of the columns in the cart table.

The “Edit” link in the cart table should take you back to the bundle’s page with all the proper qty’s loaded, you just need to make the proper adjustments and save.

 
Magento Community Magento Community
Magento Community
Magento Community
 
axaios
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2009-06-15
Thessaloniki, Greece
 

Really usefull infromation there Kabel! Turns out you are 100% correct and it is indeed a theme problem. Default template seems to work fine.

Any idea of the code I need to add/edit to enable the edit button on 3rd party theme?

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

Take a look at the following files for reference:

http://svn.magentocommerce.com/source/branches/1.5/app/design/frontend/base/default/template/checkout/cart/item/default.phtml
http://svn.magentocommerce.com/source/branches/1.5/app/design/frontend/base/default/template/checkout/cart.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
BigFish1
Jr. Member
 
Total Posts:  10
Joined:  2012-03-19
 

I looked through this thread to see if anyone has run into this issue and I don’t think so…

First of all, thank you!  This extension is so helpful.

Everything on the bundled product page works nicely, but in the cart, the user defined quantity doesn’t appear (although the total price is correct).  No matter what quantity is input it appears as “1 X ...” Any ideas? (ver. 1.6.2.0)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scorgit
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2010-04-30
 

Hi Kabel,

You have done some amazing work here, thanks! I have made some adaptations to it, which I hope to post back, especially regarding the layout files.

In the meantime, I do face a problem though. I want to override the _applyOptionsPrice function, which can be found in Mage_Catalog_Model_Product_Type_Price. I do not succeed however, not even when I override it by copying the original class file into app/code/local/Mage/Catalog/Model/Product/Type/Price.php (note: in the local folder).

A little background info:
I have defined some custom options inside the bundled product. Also, I have defined an attribute for the bundle product, into which the admin can enter the ID of the custom option to perform a price based calculation.

Client side calculation goes well (I had to adapt the bundle.js file for my specific needs of course), server side calculation goes well too, but ONLY if I edit the original price.php code in the core folder.

Another approach is to use the config.xml and specify my own class, like so:

<models>
    ....
     <
catalog>
                <
rewrite>
                    <
product_type_price>KAbel_BundlePlus_Model_Catalog_Product_Type_Price</product_type_price>
              </
rewrite>
    </
catalog>
  </
models>

When showing the bundled product inside the shop, in fact I am able to call the _applyCustomOptions function in the ‘KAbel class’, but the custom options are not recognized. That’s not a problem at that time, because calculations are done client side via javascript.

However when I add (or update) the bundled product to the cart, including checked checkboxes, the _applyCustomOptions function in the original Mage_Catalog_Model_Product_Type_Price class is called. It looks like the config.xml class rewrite is totally ignored.

I found this line in KAbel_BundlePlus_Model_Product_Type (Type.php):
$result = Mage_Catalog_Model_Product_Type_Abstract::_prepareProduct($buyRequest, $product, $processMode);

where an abstract function is called: _prepareProduct. Could it be that that is causing some problems?

If you do find some time to have a look at it, I’d appreciate it.

Anyway: keep up the good work!

Kind regards,
Tom

 
Magento Community Magento Community
Magento Community
Magento Community
 
BigFish1
Jr. Member
 
Total Posts:  10
Joined:  2012-03-19
 
BigFish1 - 19 March 2012 07:03 AM

I looked through this thread to see if anyone has run into this issue and I don’t think so…

First of all, thank you!  This extension is so helpful.

Everything on the bundled product page works nicely, but in the cart, the user defined quantity doesn’t appear (although the total price is correct).  No matter what quantity is input it appears as “1 X ...” Any ideas? (ver. 1.6.2.0)

Anybody?  Anybody?

I am ready to put my head through a wall trying to figure out the above issue.  If anyone at all can save my head and my wall, I would be most appreciative!

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

Thanks Scorgit.

Scorgit - 20 March 2012 01:28 AM

I want to override the _applyOptionsPrice function, which can be found in Mage_Catalog_Model_Product_Type_Price. I do not succeed however, not even when I override it by copying the original class file into app/code/local/Mage/Catalog/Model/Product/Type/Price.php (note: in the local folder).

That’s very odd; if you put something in the local code pool, it should take precedence over the core pool. However, I haven’t spent much time testing that to confirm the theory. I imagine that is the real problem here. If you are using the experimental Magento Compilation, there may be some issues with doing that sort of trickery.

Scorgit - 20 March 2012 01:28 AM

Another approach is to use the config.xml and specify my own class

In this case, it won’t work. The bundle product has its own price model (Mage_Bundle_Model_Product_Price) that directly inherits from the base price model (Mage_Catalog_Model_Product_Type_Price). So using the config.xml to rewrite Mage_Catalog_Model_Product_Type_Price will actually do nothing for bundle products (the rewrite engine can do nothing to the inheritance chain).

I assume you are only wanting to adjust the Bundle products’ prices. If that is the case, you should override the bundle price model with your custom _applyOptionsPrice() method. To do that, use the following config.xml snippet:

<config>
...
    <
models>
        <
bundle>
            <
rewrite>
                <
product_price>Your_Module_Model_Bundle_Product_Price</product_price>
            </
rewrite>
        </
bundle>
    </
models>
</
config>

That will ensure the inheritance works the way you want.

Scorgit - 20 March 2012 01:28 AM

I found this line in KAbel_BundlePlus_Model_Product_Type (Type.php):
$result = Mage_Catalog_Model_Product_Type_Abstract::_prepareProduct($buyRequest, $product, $processMode);

where an abstract function is called: _prepareProduct. Could it be that that is causing some problems?

I don’t think that’s what’s causing the problem. As I mentioned above, bundle products have a different price model and that directly inherits from the base price model. The code you referenced is just a workaround to skip the parent class’s definition of _prepareProduct and use the parent’s parent--because parent::parent::_prepareProduct(...) is not valid PHP.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kabel
Member
 
Avatar
Total Posts:  68
Joined:  2008-04-07
UNL, Lincoln, NE
 
BigFish1 - 19 March 2012 07:03 AM

Everything on the bundled product page works nicely, but in the cart, the user defined quantity doesn’t appear (although the total price is correct).  No matter what quantity is input it appears as “1 X ...” Any ideas? (ver. 1.6.2.0)

I haven’t heard of this issue before, so I can only imagine it is a problem with your setup. The options that are rendered in the cart are controlled by the class Mage_Bundle_Helper_Catalog_Product_Configuration which is a part of the core, not this module. Check to make sure nothing else is overriding the class.

 
Magento Community Magento Community
Magento Community
Magento Community
 
BigFish1
Jr. Member
 
Total Posts:  10
Joined:  2012-03-19
 

Thanks for the reply Kabel,

I am still trying to figure it out...ho hum…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Scorgit
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2010-04-30
 

Hi Kabel,

Thank you very much!

For some more elaborate info and Magento adventures, please see below…

Although I *did* have the rewrite rule you mention specified, I failed to copy the _applyOptionsPrice function to my own class. Why? Because I thought: “hey, inside the overwritten class (Mage_Bundle_Model_Product_Price), there is no such function (_applyOptionsPrice), it is only available in the Mage_Catalog_Model_Product_Type_Price class (which is the class Mage_Bundle_Model_Product_Price extends from), so I have to rewrite that one too.” And so I did, by specifying another rewrite rule in the config.xml, like:

<catalog>
                <
rewrite>
                    <
product_type_price>KAbel_BundlePlus_Model_Catalog_Product_Type_Price</product_type_price>
                </
rewrite>
  </
catalog>

By supplying the _applyOptionsPrice function in that class (and extensive logging by using Mage::log(); ) I found out that that function got called everywhere, also for the bundled items themselves, which was not necessary.

But… turns out that I should have copy pasted the _applyOptionsPrice function from Mage_Catalog_Model_Product_Type_Price to KAbel_BundlePlus_Model_Bundle_Product_Price, ending up like so:

class KAbel_BundlePlus_Model_Bundle_Product_Price
extends Mage_Bundle_Model_Product_Price
{
  
protected function _applyOptionsPrice($product$qty$finalPrice{
    
//....my own code
  
}
}

Result: the _applyOptionsPrice function is only called for the bundled product itself, which was my goal.

Now why did I not think of that earlier...? confused

Anyway, thank you very much again for pointing me in the right direction.

Tom

 
Magento Community Magento Community
Magento Community
Magento Community
 
fernandolaudino
Jr. Member
 
Total Posts:  1
Joined:  2012-01-18
 

Hi Kabel,

I was in great need of this module.

Thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
lkelly
Jr. Member
 
Total Posts:  6
Joined:  2010-11-30
 

I read over the post and didn’t notice anything regarding my issue, I apologize if I overlooked it. I installed the most recent build and am running Magento 1.5.1.0. When the quantities are increased, the price on the product page does not. It will, however, update when you add the item(s) to the shopping cart. You can reproduce it by visiting this link.

Please let me know smile.

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

lkelly: You need to install the proper bundle.js file into your theme skin. That is,

KAbel_BundlePlus/skin/default/blank/js/bundle.js
needs to be moved to Path/To/Your/Skin/js/bundle.js.
 
Magento Community Magento Community
Magento Community
Magento Community
 
lkelly
Jr. Member
 
Total Posts:  6
Joined:  2010-11-30
 

Of course that was it. It always is that simple.

Thanks again. Excellent extension!

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidtavcar
Jr. Member
 
Total Posts:  2
Joined:  2011-05-28
 

It seems that bundle.js is not TAX price aware. Is there any quick way to fix that? My “Price as configured” shows prices without tax. Using Magento 1.6.2.0

Thanks for any information.

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