Magento Expert Forum - Improve your Magento experience

Results 1 to 2 of 2

programmatically add bundle to quote

  1. #1
    New member
    Join Date
    Jul 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default programmatically add bundle to quote

    Hi,

    I'm currently working on a website where we want to insert orders into magento.
    Simple products are no problem to insert, only the bundle products are casting problems.

    With the follow code i'm trying to add the product
    PHP Code:

    //$products[$i]['pakket']->entity_id = id of bundle product
    $product Mage::getModel('catalog/product')->load((int)$products[$i]['pakket']->entity_id);
                            
    $params = array(
        
    'bundle_option'         => array(),
        
    'bundle_option_qty'     => array(),
        
    'qty'                    => 1
    );

    //get options / bundle item products                
    $selectionCollection $product->getTypeInstance(true)->getSelectionsCollection(
        
    $product->getTypeInstance(true)->getOptionsIds($product), $product
    );
                            
    foreach(
    $selectionCollection as $option)
    {
        
    $params['bundle_option'][(int)$option->option_id][] = (int)$option->selection_id;
        
    $params['bundle_option_qty'][(int)$option->option_id][(int)$option->selection_id] = 1;
    }
                    
    $result $quote->addProduct($product, new Varien_Object($params)); 
    Can someone help me out.

    With best regards,
    René

    View more threads in the same category:


  2. #2
    Junior Member ToBai's Avatar
    Join Date
    Sep 2014
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    There is a good article right on this topic - http://inchoo.net/magento/programati...art-n-magento/.

    If nothing helps you can contact us at our support page - http://www.to-bai.com/support/.

    We would be glad to help you with an advice or we can provide you our paid custom work - http://www.to-bai.com/services/custom-work.html

    ------------------------------------------
    ToBai Magento Extensions. - only best coding practice developing our applications. Our extensions:

    ToBai Extended Navigation, ToBai Extended Brand.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •