0

I am looking at a section of code that uses this:

if ($_item->getProduct()->getTypeId() === Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE)

to determine whether a product is configurable. I am now wanting to alter that to detect whether the product is a bundle - but it turns out, there is no Mage_Catalog_Model_Product_Type_Bundle. Nor is there a Mage_Checkout_Block_Cart_Item_Renderer_Bundle. In fact, I can't see to find any dedicated bundle classes, anywhere - it's like they don't exist!

What is the reason for this? How are developers supposed to deal with bundled products, without methods like getChildrenIds or TYPE_CODE? Are just supposed to be hardcoding things?

1

The bundled products were introduced after the release of Magento 1, and for reasons unknown, their implementation was separated out into a new module. Magento's modular system and shared config.xml space allows for this sort of separation.

A quick glance at Mage_Bundle reveals a type class

app/code/core/Model/Product/Type.php

and a renderer

app/code/core/Block/Checkout/Cart/Item/Renderer.php
1

The bundle products were added later in Magento (after 1.0).
It's a totally separate module. Check Mage_Bundle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.