Adding only the base product to the complete product basket in Magento

I am trying to add the base product of a related item (without configuration or additional products added to the kit). None of the custom items are required, and the price of the related item is set to a fixed price.

I tried to try the solution given here: http://www.magentocommerce.com/boards/viewthread/17289/

 if (empty($optionIds)) {

            // return Mage::helper('bundle')->__('Please select options for product.');
            $selectionCollection = $product->getTypeInstance(true)->getSelectionsCollection($product->getTypeInstance(true)->getOptionsIds($product), $product);
            $bypass_sel_arry = $selectionCollection->getData();
            $options = array($bypass_sel_arry[0]['option_id']=>$bypass_sel_arry[0]['selection_id']);

  } 

But I noticed that when an item is added to the cart, it automatically selects the first option in custom items.

Any help would be appreciated.

+3
source share
1 answer

This will require the participation of jQuery. You should follow the following approach, it is a little complicated, but it can solve your problem.

  • .
  • show type.
  • , .
  • " ". .
  • . ( )

    //Code to get ID, pass this in any of the button attribute  
    $product_id    =    $this->getProduct()->getId();
    
    //Code to get the button clicked id
    $("#btnDel").click(function(){alert(this.id);});
    
  • , URL- http://magentoserver.com/checkout/cart/add?product=[productID]&qty;=1

  • .
0

All Articles