11 votes

Magento Bundle 'As Low As' Price - I need to add tax

It seems Magento left out a swath of code that should be calculating the VAT at that point. I think it was left out because the logic wasn't really straightforward. The problem is in the structure of ...
Peter Jaap Blaakmeer's user avatar
10 votes
Accepted

Create a bundle product programmatically - Magento 2

You code should like: /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // instance of object manager /** @var \...
KAndy's user avatar
  • 20.8k
7 votes
Accepted

Magento2 Change bundle item price in cart

So finally I was able to achieve this, first we need a events.xml For my requirement I needed this event observer for both frontend and adminhtml so the events.xml was create at app/code/Foo/...
Atish Goswami's user avatar
7 votes

How to get the price range of bundle products in Magento 2?

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->get('Magento\Catalog\Model\Product')->load(YOUR_ID); $bundleObj=$product->getPriceInfo()->...
Keyur Shah's user avatar
7 votes

which observer to call while removing item from cart and empty cart?

Besides the controller pre|post dispatch events that don't do you much good, though you can still use them controller_action_predispatch_checkout_cart_delete and ...
Marius's user avatar
  • 198k
6 votes
Accepted

How to override a block without name?

You can use setChild() to replace a block by its alias. First create the new block with a name, then call setChild() via <action>: <referenceBlock name="order_items"> <block class="...
Fabian Schmengler's user avatar
5 votes

Disallow sell of a simple product but allow that product to be sell in bundled product

Just simple solution for that Just Set that simple Product visibility to Not Visible Individually Hope this will help you and let me know if its not working
Murtuza Zabuawala's user avatar
5 votes

Magento 2.1: <preference> doesn't work with block

To replace a single method, use the around plugin and don't call the original method with $proceed()
Fabian Schmengler's user avatar
5 votes
Accepted

Magento 2.1: <preference> doesn't work with block

Thanks fschmengler , I managed to solve this by using Plugin. Override/replace single method in block class: app/code/MySpace/MyModule/etc/di.xml <config xmlns:xsi="http://www.w3.org/2001/...
pekkaliu's user avatar
  • 181
4 votes
Accepted

Magento cart - get the bundle parent and children product

answering self for future seekers: $item->getParentItemId() source: http://davehiren.blogspot.co.il/2014/02/magento-get-cart-items-how-to-get.html
Ronen Ness's user avatar
4 votes
Accepted

Bundled product remove "Price as configured"

If you will activate the "Template path hints" you will see that the template responsible for rendering this price is template/bundle/catalog/product/view/price.phtml. Now, if you go into bundle.xml ...
Alex Constantinescu's user avatar
4 votes
Accepted

Display old price in dynamic bundle product price

Sorry for the late response but I just faced this myself and solved it as follows... In bundle/catalog/product/price.phtml (Not bundle/catalog/product/view/price.phtml) find the block of code that ...
Steve Gardner's user avatar
4 votes

How to get the price range of bundle products in Magento 2?

Just to add to this answer for getting the min/max price, if you want it to display with currency formatted you need the raw number value. The accepted answer returns an object rather than a flat ...
pixiemedia's user avatar
4 votes
Accepted

Magento 2 - Losing data with extension attributes in bundle options collection

The documentation for extension attributes is not quite clear on what's the right way to use them and it seems like each entity type does it in a slightly different way. That being said, from my ...
Fabian Schmengler's user avatar
4 votes
Accepted

How to get object value?

If $amount is this object, use: $amount->getValue(); How to find out by yourself: Look at the source code of Magento\Framework\Pricing\Amount\Base and search for $this->amount. If you find a ...
Fabian Schmengler's user avatar
4 votes
Accepted

Magento 1.9 Get only default items from options of a bundle product

You can do this: $product = Mage::getModel('catalog/product')->load(bundle_pruduct_id); $selectionCollection = $product->getTypeInstance(true)->getSelectionsCollection( $product->...
olkuznw's user avatar
  • 146
3 votes

Programmatically create an order of grouped and bundle product in Magento

Don't use Mage_Sales_Model_Quote::addProduct(), especially for complex products. Use Mage_Checkout_Model_Cart::addProduct() which is also used by the add to cart controller action and takes care for ...
Fabian Schmengler's user avatar
3 votes

Remove code for saving the attributes of a bundle item to the parent bundle product while reindexing

The code is in Mage_Catalog_Model_Resource_Product_Indexer_Eav_Abstract::_prepareRelationIndex() (See also: Inconsistent product attribute index: Duplicate entries in catalog_product_index_eav) But I ...
Fabian Schmengler's user avatar
3 votes

Change bundle product's price after add to cart

You can set custom prices with an observer on catalog_product_get_final_price with code like this: $observer->getProduct()->setFinalPrice(...); But for bundles it is not that easy, at least ...
Fabian Schmengler's user avatar
3 votes

Create a bundle product programmatically - Magento 2

Magento2 programmatically adding a custom option I propose to look at this post - which provides much easier answer and first of all working one. Look at /dev/tests/integration/testsuite/Magento/...
Bartosz Kubicki's user avatar
3 votes
Accepted

Limit cart quantity of bundled product

The core feature "Maximum qty" is tied to stock items, so it does not work with bundles (they don't have their own stock). You have to develop it on your own. For simple products, the check happens ...
Fabian Schmengler's user avatar
3 votes

Magento products packs (assortiment) with size and stock control - like 3-pack or 6-pack

You could create the "6 pack" product as a bundle with one required dropdown option, call it "size". Add the S, M and L simple products as selections for this option with a default qty of 6 and "...
Fabian Schmengler's user avatar
3 votes
Accepted

Magento 2 Add Bundled Product to Cart Programmatically

I reckon the right way of doing it would be the following: First you need to inject the following classes to your class constructor: protected $_cart; protected $_productRepository; public ...
Raphael at Digital Pianism's user avatar
3 votes

Magento 2 Add Bundled Product to Cart Programmatically

Below you can find my code to how i resolve it, you have to use field selection_id and not sub product id (in this case i use only one multiselect option): // get selection option in a bundle ...
elachino's user avatar
3 votes
Accepted

Bundled product pricing/configuration confusion

As per my above scenario, I haven't got the main product listed as a bundled item/associated product within the bundled product, it is in fact the actual product that I converted to a bundled product.....
Fabian Schmengler's user avatar
3 votes
Accepted

How to get selected bundle items price

You will find selected bundle items data at the time of add to cart, like below : $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct()); :)
Krupali's user avatar
  • 1,140
3 votes
Accepted

Magento 2 - How to remove the price of each bundle product option in the shopping cart, order confirmation, review your cart page, etc

In alignment with what @tjons pointed out, in my di.xml for the module I created I needed to add a new entry to list the preference to pick up my Configuration.php file over the core one. After that I ...
Noemi Quezada's user avatar
3 votes

How to load bundle child product by parent product ID?

You can get the type instance in your bundle product, then get the children IDs, as below. $typeInstance = $product->getTypeInstance(); $requiredChildrenIds = $typeInstance->getChildrenIds($...
Ajeet Singh's user avatar
3 votes

How to get bundle product items options html in magento 2.3 programmatically?

Please check with below code : $store_id = $_storeManager->getStore()->getId();            $options = $_objectManager->get('Magento\Bundle\Model\Option')         ->...
Anas Mansuri's user avatar
  • 2,627
3 votes
Accepted

How to add a label to simple & Bundle product price?

For Simple /vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml override on below path /app/design/frontend/theme/Magento_Catalog/templates/product/price/final_price....
Gohil Rajesh's user avatar
  • 2,984

Only top scored, non community-wiki answers of a minimum length are eligible