使用分组和捆绑产品magento的组合创建产品

时间:2017-08-20 08:42:50

标签: magento product

我想创建一个新产品,其中包含捆绑产品和分组产品的组合,例如此链接https://www.urbanladder.com/products/apollo-infinity-sofa?sku=FNSF51APMB30000SAAAA

显示选择一个受欢迎的套装(捆绑产品)

显示或创建自己的套装(分组产品)

两者都被视为一种产品

是否有任何插件可以实现此目的,或者我可以从管理面板执行此操作。请帮助。

config.xml中

<?xml version="1.0"?>

<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>Custom Product by Ajzele</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_type_grouped_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>

Type.php

class Ajzele_CustomProduct_Model_Product_Type extends Mage_Catalog_Model_Product_Type_Abstract
{
    const TYPE_CP_PRODUCT = 'customproduct';
}

这给了我简单的自定义产品类型。我应该添加什么才能获得捆绑产品和分组产品的组合。

0 个答案:

没有答案