1
votes

I am using Magento 1.7 for a webshop and I want to display some specific static blocks above the catalog. So when customers go to the menu and click on for example category A and after that clicking on manufacturer B, there should be a text-block above the catalog product listing with manufacturer specific information. Also when they click on manufacturer C, there should be other text then manufacturer B.

I think the easiest way to do this is making static blocks for all manufacturers, and making a PHP script. Is that possible? Or can I do this on another way?

Thank you in advance!

Kind regards,

Jean-Paul

2
amasty.com/improved-navigation.html - this allows you to add specific blocks when a filter is applied (eg: manufacturer) - FlorinelChis

2 Answers

0
votes

here is the list of free extensions. just download them and you can change/upgrade edit it to your needs.

  1. Shop By Brand / Manufacturer
  2. Brand Manufacturer Management
  3. Manufacturer Brand Logo

i hope you get the idea, i think it`s easy to understand when you have something to start.

0
votes

If you want to do it by yourself, you can implement an observer, check which filters are applied in the layered navigation and add your block to the content block.

Your block then implements whatever logic you want to show the different informations for the manufacturer.

I would try controller_action_layout_generate_blocks_after, controller_action_layout_render_before or controller_action_layout_render_before_'.$this->getFullActionName() whatever the FullActionName for the layered category is :-)

About Observers you can find things at inchoos: http://inchoo.net/category/ecommerce/magento/events-observers/

To get the information wether a manufactuerer is choosen, I think there are two ways:

  1. get the information from the get Mage::app()->getRequest()->getParam() should work
  2. get the layout, then $layout->getBlock('catalog.leftnav') and pull the information somehow out of the block

afterwards you can add your block.

After reading this: Magento: Add content block at the end of the structual block "content"

I would suggest to introduce your own update handle (because I don't know, how to prepend blocks to the beginning of content). with your own handle, you can use before="-"

And as described here: http://www.classyllama.com/magento/add-custom-layout-handles-e-g-parent-categories

you can add your handle via $layout->getUpdate()->addHandle('manufacturer_informations');

I would try something like this in the observer:

if($category = Mage::registry('current_category')) {
    if($category->getName() == 'MyBrand') { // ot maybe $category->getId() == ...
        //instantiate some $block
    }

    $layout->getBlock('content')->insert($block, 'brand-information');
}