1

I've created a custom product type but it appeared that it lost "Prices" tab.

On the screenshot, on the left are the tabs for default product, on the right - my new product's tabs. How do I restore the prices tab?

tabs - default product vs custom

In my config.xml I have

<catalog>
    <product>
        <type>
            <email_marketing translate="label" module="ContactologyProduct_LogProductUpdate">
                <label>Email Marketing</label>
                <model>ContactologyProduct_logproductupdate/product_type</model>
            </email_marketing>
        </type>
    </product>
</catalog>
6

Most probably the attributes that should appear in the Prices tab are not applied to your custom product type.
Edit for example the attribute with code price (or tax_class_id) and you will see a field called Apply to with multiselect with all the product types. Only some of them will be selected (your new type is not included).

You have to edit each attribute and add your product type in the list.

I suggest doing that from an upgrade script so it is portable to your staging or live server.

Here is how you can do that:

$fieldList = array(
    'price','special_price','special_from_date','special_to_date',
    'minimal_price','cost','tier_price','weight'
); //list here all the attribute codes from the price tab
foreach ($fieldList as $field) {
    $applyTo = explode(',', $installer->getAttribute(Mage_Catalog_Model_Product::ENTITY, $field, 'apply_to'));
    if (!in_array('email_marketing', $applyTo)) {
        $applyTo[] = 'email_marketing';
        $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $field, 'apply_to', implode(',', $applyTo));
    }
}
| improve this answer | |
  • "Edit for example the attribute with code price" - where? I don't add my product via install script, can't I just edit config.xml? – van_folmert Jul 7 '14 at 11:45
  • @van_folmert. I was talking about Catalog->Attributes->Manage Attribtues. The attribute Price is set to be used only for a few product types. So it is not applied for yours. The same goes for all the attributes in the Prices tab. And if a tab does not contain attributes it is not shown. – Marius Jul 7 '14 at 11:52

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.