0

When I create custom product type from simple product type through module-xml, do I have to manually assign every attribute(eg. "category", "price", "msrp") of simple product type to the custom one ?

Doesn't it by default include the basic attributes like "category", "price" etc. ?

How can I get all attributes of simple product type and assign all those at once to my custom type ?

Below is config.xml of my customproduct module.

<config>
    <modules>
        <Ajzele_CustomProduct>
            <version>0.1.0</version>
        </Ajzele_CustomProduct>
    </modules>

    <global>
        <models>
            <customproduct>
                <class>Ajzele_CustomProduct_Model</class>
            </customproduct>
        </models>

        <resources>
            <customproduct_setup>
                <setup>
                    <module>Ajzele_CustomProduct</module>
                    <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </customproduct_setup>
        </resources>

        <catalog>
            <product>
                <type>
                    <customproduct translate="label" module="catalog">
                        <label>Recipe Product</label>
                        <model>customproduct/product_type_cp</model>
                        <is_qty>1</is_qty>
                        <index_data_retreiver>customproduct/catalogIndex_data_cp</index_data_retreiver>
                        <price_model>customproduct/product_price</price_model>
                        <composite>0</composite>
                    </customproduct>
                </type>
            </product>
        </catalog>
    </global>

    <adminhtml>
        <events>
            <catalog_product_new_action>
                <observers>
                    <customproduct_observer_catalog_product_new_action>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductNewAction</method>
                    </customproduct_observer_catalog_product_new_action>
                </observers>
            </catalog_product_new_action>
            <catalog_product_edit_action>
                <observers>
                    <customproduct_observer_catalog_product_edit_action>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductEditAction</method>
                    </customproduct_observer_catalog_product_edit_action>
                </observers>
            </catalog_product_edit_action>
            <catalog_product_prepare_save>
                <observers>
                    <customproduct_observer_catalog_product_prepare_save>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductPrepareSave</method>
                    </customproduct_observer_catalog_product_prepare_save>
                </observers>
            </catalog_product_prepare_save>
            <catalog_product_delete_before>
                <observers>
                    <customproduct_observer_catalog_product_delete_before>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductDeleteBefore</method>
                    </customproduct_observer_catalog_product_delete_before>
                </observers>
            </catalog_product_delete_before>
            <catalog_product_save_after>
                <observers>
                    <customproduct_observer_catalog_product_save_after>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductSaveAfter</method>
                    </customproduct_observer_catalog_product_save_after>
                </observers>
            </catalog_product_save_after>
            <catalog_product_status_update>
                <observers>
                    <customproduct_observer_catalog_product_status_update>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductStatusUpdate</method>
                    </customproduct_observer_catalog_product_status_update>
                </observers>
            </catalog_product_status_update>




            <sales_order_item_save_after>
                <observers>
                    <customproduct_observer_sales_order_item_save_after>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoSalesOrderItemSaveAfter</method>
                    </customproduct_observer_sales_order_item_save_after>
                </observers>
            </sales_order_item_save_after>
            <sales_order_save_before>
                <observers>
                    <customproduct_observer_sales_order_save_before>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoSalesOrderSaveBefore</method>
                    </customproduct_observer_sales_order_save_before>
                </observers>
            </sales_order_save_before>
            <sales_order_save_after>
                <observers>
                    <customproduct_observer_sales_order_save_after>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoSalesOrderSaveAfter</method>
                    </customproduct_observer_sales_order_save_after>
                </observers>
            </sales_order_save_after>
            <catalogrule_before_apply>
                <observers>
                    <customproduct_observer_catalogrule_before_apply>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogruleBeforeApply</method>
                    </customproduct_observer_catalogrule_before_apply>
                </observers>
            </catalogrule_before_apply>
            <catalogrule_after_apply>
                <observers>
                    <customproduct_observer_catalogrule_after_apply>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogruleAfterApply</method>
                    </customproduct_observer_catalogrule_after_apply>
                </observers>
            </catalogrule_after_apply>
            <catalog_entity_attribute_save_after>
                <observers>
                    <customproduct_observer_catalog_entity_attribute_save_after>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogEntityAttributeSaveAfter</method>
                    </customproduct_observer_catalog_entity_attribute_save_after>
                </observers>
            </catalog_entity_attribute_save_after>
            <catalog_product_delete_after_done>
                <observers>
                    <customproduct_observer_catalog_product_delete_after_done>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductDeleteAfterDone</method>
                    </customproduct_observer_catalog_product_delete_after_done>
                </observers>
            </catalog_product_delete_after_done>

            <customer_login>
                <observers>
                    <customproduct_observer_customer_login>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCustomerLogin</method>
                    </customproduct_observer_customer_login>
                </observers>
            </customer_login>
            <customer_logout>
                <observers>
                    <customproduct_observer_customer_logout>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCustomerLogout</method>
                    </customproduct_observer_customer_logout>
                </observers>
            </customer_logout>
            <sales_quote_save_after>
                <observers>
                    <customproduct_observer_sales_quote_save_after>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoSalesQuoteSaveAfter</method>
                    </customproduct_observer_sales_quote_save_after>
                </observers>
            </sales_quote_save_after>
            <catalog_product_collection_load_after>
                <observers>
                    <customproduct_observer_catalog_product_collection_load_after>
                        <type>singleton</type>
                        <class>customproduct/observer</class>
                        <method>hookIntoCatalogProductCollectionLoadAfter</method>
                    </customproduct_observer_catalog_product_collection_load_after>
                </observers>
            </catalog_product_collection_load_after>
        </events>
    </adminhtml>

</config>
  • can you show your xml file? – MeenakshiSundaram R Sep 23 '15 at 6:09
  • sure updating my question with config.xml in a min – H.D. Sep 23 '15 at 6:10
  • updated my question, pls check – H.D. Sep 23 '15 at 6:13
  • @Meenakshi, I have posted my config.xml, can you take a look ? – H.D. Sep 24 '15 at 7:22

Your Answer

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

Browse other questions tagged or ask your own question.