I'm working on replicating the Bundle Product type as "Package".

I've copied the Bundle folders in Core_Mage, the Theme Layout, Adminhtml (on the frontent design), as well as the xml file in theme layout, core/mage/bunde/etc/config.xml, and adminhtml/default/layout/bundle.xml.

All files and folders have been renamed, with the words Bundle and bundle changed to Package and package respectively. The product type is still not showing as a product type on the backend.

Is there another file that I need to edit to make this happen? I'm trying to be able to reconfigure this "Package" type from the original "Bundle", but I need to keep the Bundle product type.

  • hi, are you intended to use the bundle product as well? or just this new 'Package' : if the later, then you can simply just rename the product label from bundle to 'package' and be done. – ProxiBlue Jan 7 '16 at 1:11
  • Did you create the corresponding file in app/etc/modules to load your new 'package' module? – ProxiBlue Jan 7 '16 at 1:14

There is really no need to copy/duplicate all the files from the bundle product, just to create a new product based off it.

What you need to do is define the new product type, in your custom extension config.xml, and then only extend those classes, and the methods, to where you want functionality changes. As an example, if you'd like the price model to do something different for this product type.

So, lets assume you have already created your base extension file structure, and you have a config.xml

Place the following directives in the global tag: (I am using code used in my gifts extension, so just replace the tags with your appropriate naming of the new bundle)


                    <gift-bundle translate="label" module="giftpromo">
                        <label>Bundle Gift Product</label>
                        <select translate="label" module="bundle">
                        <radio translate="label" module="bundle">
                            <label>Radio Buttons</label>
                        <checkbox translate="label" module="bundle">
                        <multi translate="label" module="bundle">
                            <label>Multiple Select</label>

In the above example, the two important bits are:


This is where you define your product types base model class. You simply need to extend the core bundle class, and define the product type constant:


 * defines the gift product type constant for bundles
 * @category   ProxiBlue
 * @package    ProxiBlue_GiftPromo
 * @author     Lucas van Staden (support@proxiblue.com.au)
class ProxiBlue_GiftPromo_Model_Product_Type_Gift_Bundle extends Mage_Bundle_Model_Product_Type
    const TYPE_CODE = 'gift-bundle';

You can also see in the example that I replaced the price model with a custom class, so I can replace the price calculations aspect of the new type. The class still extends the core bundle type


as you can see, I simply extend the core bundle class, and rewrite any methods I needed, and then the rest is using core bundle functionality.


 * Gift product price renderer.
 * @category   ProxiBlue
 * @package    ProxiBlue_GiftPromo
 * @author     Lucas van Staden (support@proxiblue.com.au)
class ProxiBlue_GiftPromo_Model_Product_Type_Gift_Bundle_Price extends Mage_Bundle_Model_Product_Price

That should bring up a basic copy of the bundle product Since I did not need indexing and such, I did not include those in my bundle product type definition, but if you look at the core bundle xml product definition, you can easily see the parts you also need to do to extend this. Again, you should simply start off with your own classes, extending the core bundles, and then systematically bring in any methods that require adjustment.


An example for code you may have to adjust, is in the indexer class form the bundles: Mage_Bundle_Model_CatalogIndex_Data_Bundle

There you will find this:

     * Retreive product type code
     * @return string
    public function getTypeCode()
        return Mage_Catalog_Model_Product_Type::TYPE_BUNDLE;

which will obviously not work, as it will get the wrong product type. You need to check for this in all derived class methods, and adjust them accordingly.

In this example you have two choices:

  • rewrite the class Mage_Catalog_Model_Product_Type and add in your product type as well
  • or without adding additional rewrites into the system, simply extend that method in your own class, and change the fetching of the product type form your derived bundle class:


It is not difficult to create new product types. It is just time consuming as there are a lot of little gotchas. Fetching the correct product type code is the biggest of those.

Hope this helps.

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.