开发者

magento product popup

I'd like to create a popup window for products instead of directing to another page. I'm looking for advice on the best way开发者_如何学C to basically make a copy of the product view template to modify for my needs without having to create separate models and blocks. I'm using version 1.3.2.2. Let me know if anything needs clarification.

I realize there are modules that do this, but I'd like to do it myself. Partly for learning.


As a general approach, you could use Javascript to change the product page links to open in a popup (not clear if you mean an AJAX layer or a "real" popup, which many users' browsers will block). Then, modify the layout XML files to add or remove any blocks that you need.

If you want to have both the normal page and a hovered 'layer', then create a new controller and have it inherit from the catalog view layout (IIRC, $this->loadLayout('catalog_product_view') should do it). Then, once again, change layouts for your layout tag to add and remove as necessary.


Joseph's answer wasn't quite clear to me, but this is what I did. I created a new module for the popup with a new controller that extended the ProductController. I made a copy of the viewAction and renamed it to popupAction in my new controller.

Then I made a copy of the catalog.xml and renamed it according to my module. Then deleted everyting not pertaining to the product view page. I made a copy of the view template and set that as the template in my xml layout. Then I made the necessary changes within either the xml layout or the new view template.

I couldn't get $this->loadLayout('catalog_product_view') to work for me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜