简体   繁体   中英

adding a magento page to the catalog

I want to add another page in the magento module like the following...

<catalog_wizard_default translate="label">
  <reference name="content">
   <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml"/>
  </reference>
 </catalog_wizard_default>

so when customer types in the url, they can do it like so

domain.com/catalog/wizard. I have no idea how to do this. I tried adding another action in the catalog controller like the following

  public function wizardAction(){
  $this->renderLayout();
 }

But this doesnt seem to work.

This should work. I think you need to call $this->loadLayout() before you render the layout...

Generally, a layout handle of catalog_wizard_default will translate into the following Module-Controller-Action path: Mage_Catalog - WizardController - defaultAction() .

I would suggest that you need to follow these instructions to copy CategoryController to app/code/local/Mage/Catalog/controllers and add an action called wizardAction(). Your layout will then be called <catalog_category_wizard> .

Unfortunately overriding/extended core controllers is quite complicated in Magento, so make sure you follow the wiki instructions carefully.

Hope this helps. JD

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM