Question

I am trying to add a new attribute to tier pricing and when i try to override the tierprice class i get "Invalid backend model specified: catalog/product_attribute_backend_tierprice" error when i try to save an item and in frontend I cant view any item.

please help me.

In my config.xml i have defined the classes as


<modules>
   <Mypackage_Catalog>
     <version>0.1.0</version>
   </Mypackage_Catalog>
</modules>


<global>
    <models>
        <catalog>
            <rewrite>
                <product_type_price>Mypackage_Catalog_Model_Product_Type_Price</product_type_price>
                <product_attribute_backend_tierprice>Mypackage_Catalog_Model_Product_Attribute_Backend_Tierprice</product_attribute_backend_tierprice>
            </rewrite>
        </catalog>                          
        <catalog_resource_eav_mysql4>
            <rewrite>
                <product_attribute_backend_tierprice>Mypackage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Backend_Tierprice</product_attribute_backend_tierprice>
            </rewrite>                          
        </catalog_resource_eav_mysql4>
    </models>
</global>


and my folder structure looks like

app\code\local\Mypackage\Catalog\Model\Resource\Eav\Mysql4\Product\Attribute\Backend\Tierprice.php
Was it helpful?

Solution

For me it seems you overwrite 3 classes in your config xml, but there is only one exists in your folder structure. I tried the module as you describe it here (but no modifications to core files, just copied them and changed class definitions) and get the same error. In the system.log this error looks like:

Failed opening 'Mypackage\Catalog\Model\Product\Attribute\Backend\Tierprice.php' for inclusion 

In your folder structure you will need the following files (in addition to existing one):

app\code\local\Mypackage\Catalog\Model\Product\Attribute\Backend\Tierprice.php
app\code\local\Mypackage\Catalog\Model\Product\Type\Price.php

folder strcture with class definitions

OTHER TIPS

From what I see, your file tierprice.php should be capitalized, and if that doesn't do it, post your Tierprice.php file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top