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

Page 11 of 11
Enable Quantity in Bundled Product with Checkbox
 
kcsf
Jr. Member
 
Total Posts:  6
Joined:  2012-07-20
 

Hi Kabel,

First I’d like to say THANK YOU for an excellent extension.  Great job, huge help to us.

The issue we are having may or may not be related to your extension.  Everything is working great - up until checkout.  For some reason, the amount getting submitted to the merchant gateway is “0” on all bundled items.  In all other areas, the amount is correct (category/product view, cart review, invoices, emails, etc.).  Also, single items work fine. 

Example product page: http://dev.superiorfencedirect.com/shop/vinyl/privacy/dogwood/vinylfence-kit-white-6x8-dogwood.html

Could you point us the right direction?  Which files might be responsible for this strange behavior?

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
srb86
Jr. Member
 
Total Posts:  1
Joined:  2013-05-08
 

I downloaded Kabel’s Bundle Plus extension and it looks like it’s working.  However, when I go to the front end and try to change the qty in the boxes all I get is a circle with a line through it (in place of my mouse) and I can’t change the qty’s.  Any one else have this issue?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
MKI_italy
Jr. Member
 
Total Posts:  3
Joined:  2013-09-09
 

Great extension, works perfectly on 1.7.0.2
BTW I’m still searching a way to put a minimum quantity to the sum of all the products within the bundle product.
Example:
I sell a package of 20 t-shirts, default quantity for each size is:

5 S size
5 M size
5 L size
5 XL size

I want to leave the customer chooses the sizes, but the total amount must be >= 20 t-shirts.
Does anyone has got a solution for that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
fantomas82
Jr. Member
 
Total Posts:  3
Joined:  2011-01-20
test
 

Hi Kabel, this script should remove the need to modify the orginal prepareProduct function:

public function _prepareProduct(Varien_Object $buyRequest$product$processMode)
    
{
        $result 
parent::_prepareProduct($buyRequest$product$processMode);
        if (
is_string($result)) {
            
return $result;
        
}
        
        $product 
$this->getProduct($product);
        
$qtys $buyRequest->getBundleOptionQty();
        
$productOptions $product->getCustomOptions();
        
$options $buyRequest->getBundleOption();
        
        
$selectedQty = array();
        foreach( 
$options as $optionId => $bundleOption{
            
if(is_array($bundleOption)) {
                
foreach($bundleOption as $selectionId{
                    
if (isset($qtys[$optionId][$selectionId])) {
                        $qty 
$qtys[$optionId][$selectionId];
                        if(!
$qty{
                            $qty 
1;
                        
}
                        $selectedQty[$optionId][$selectionId] 
$qty;
                    
}
                }
            }
        }
        
        
if($this->_isStrictProcessMode($processMode)) {
            
foreach($selectedQty as $bundleOption{
                
foreach($bundleOption as $selectionId => $qty{
                    $selection 
Mage::getModel('bundle/selection')->load($selectionId);
                    foreach(
$productOptions as $code => $option{
                        
if (isset($selectedQty[$selection->getOptionId()][$selection->getSelectionId()])) {                    
                            
if($code === $this->_getCustomOptionSelectionCode($selection->getSelectionId())) {                        
                                $option
->setValue($qty);
                            
}
                            
if($code === $this->_getCustomOptionProductCode($selection)) {
                                $option
->setValue($qty);
                            
}
                        }
                    }
                    
foreach ($result as $resultProduct{
                        $resultOptions 
$resultProduct->getCustomOptions();
                        if(isset(
$resultOptions['selection_id'])) {
                            
if($resultOptions['selection_id']->getValue() == $selectionId{
                                $attributes 
unserialize($resultOptions['bundle_selection_attributes']->getValue());
                                
$attributes['qty'$qty;
                                
$resultOptions['bundle_selection_attributes']->setValue(serialize($attributes));
                                
$resultProduct->setCartQty($qty);
                            
}
                        } 
else {                
                            
foreach($resultOptions as $code => $option{
                                
if (isset($selectedQty[$selection->getOptionId()][$selection->getSelectionId()])) {
                                    
if($code === $this->_getCustomOptionSelectionCode($selection->getSelectionId())) {
                                        $option
->setValue($qty);
                                    
}
                                    
if($code === $this->_getCustomOptionProductCode($selection)) {
                                        $option
->setValue($qty);
                                    
}
                                }
                            }
                        }
                    }
                }
            }
        } 
        
        
if (is_string($result)) {
            
return $result;
        
}
        
        
return $result;
    
}
    
    
protected function _getCustomOptionSelectionCode($selectionId)
    
{
        
return 'selection_qty_'.$selectionId;
    
}

    
protected function _getCustomOptionProductCode($selection)
    
{
        
return 'product_qty_'.$selection->getProductId();
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 11 of 11