How to create a new product type
-
13-12-2019 - |
Question
So I'm still learning the programming side of Magento
, but I thought if I copied everything that has anything to do with the Bundle product
type, rename it to a new product type name (Assembly), that would get me close where I could then modify my new product type for the behavior I want. It almost worked, but obviously I'm doing something wrong.
I created a new namespace
under local
. (MyNewNamespace)
I copied every file that had anything to do with bundle into respective new files with everything changed to assembly and MyNewNamespace/Assembly
for the classes.
Everything almost works, except I get Fatal error: Class 'Mage_Assembly_Helper_Data'
not found.
I traced this to app/code/core/Mage/Core/Model/Config.php
line 1213 in
public function getGroupedClassName($groupType, $classId, $groupRootNode=null).
On line 1253 it hardcodes mage_ to come up with the class name.
What am I missing? Can I not do what I did in my own namespace?
Solution
Looks like you need to add a Helper/Data.php file to your extension.
Check other modules to see how this is done by adding the folder/file and adding the <helper>
configuration to your extension's config.xml
It does not need to have any methods, but must exist and extend the appropriate core class.
Once added and configured, Magento will stop looking for a Mage_ version.
OTHER TIPS
For making new product type Please go through the below link
http://inchoo.net/magento/how-to-create-a-new-product-type-in-magento/
and dowload http://inchoo.net/wp-content/uploads/2010/01/Ajzele_CustomProduct.zip