My store has 2 different types of Attribute Sets for my Simple Products:


For all my products that have the attribute set name of Custom I need to remove the following sections from the page layout:

<reference name="root">
    <remove name="header" />
    <remove name="breadcrumbs" />
    <remove name="footer" />

Is there a way i can easily assign all products in this attribute set to always remove these 3 sections.

I know I can place the above in the Custom Design Layout section but I currently have over 100,000 products with the attribute set of Custom so going through one by one is not an option.

  • you want to change attribute set or what?
    – Magento 2
    Oct 8, 2015 at 12:09
  • No, the attribute set stays as it is but all products with the attribute set of Custom i want to remove the header footer and breadcrumbs
    – odd_duck
    Oct 8, 2015 at 12:13

1 Answer 1


For this case, we can add new layout handler on basic of Attribute Sets at event controller_action_layout_load_before.

Event: controller_action_layout_load_before

Condition: product attribute set

So , i am start an observer on basic of this condition which is add new
handler on current layout .

Handler Format: PRODUCT_ATTRIBUTE_SET_{ProdductAttributSetName}

Observer code:

class [ModuleNameSpace]_[ModuleName]_Model_Observe{ 
     * Before load layout event handler
     * @param Varien_Event_Observer $observer
    public function beforeLoadLayout($observer)
        $product = Mage::registry('current_product');
        $layout = $observer->getEvent()->getLayout();
        $attributeSet = Mage::getModel('eav/entity_attribute_set')->load($product->getAttributeSetId());
        $handle = str_replace('-', '_', $product->formatUrlKey($attributeSet->getAttributeSetName()));

        // check all Handler 
    return ;


Config.xml code;


Now on this of this handler,you can add a new block to layout and a new phtml.

Suppose, you want to change the layout at Custom attribute set page then you can try this.

<reference name="root">
    <remove name="header" />
    <remove name="breadcrumbs" />
    <remove name="footer" />

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.