Use if else in magento homepage content

眉间皱痕 提交于 2019-12-12 02:18:55

问题


I am trying to display a grid view with sale items shown on the homepage filtered by category.

I tried to put php if/else block in the homepage content in CMS section of admin, but it doesn't work. Any PHP code in the CMS is being commented automatically!

Is there any other way to filter homepage sale/featured products by category? I am using Magento 1.7.x

I have added the following code into the homepage which works:

{{block type="catalog/product_special" template="catalog/product/list1.phtml"}}

I just want to filter result of above code using categories when the user clicks on a category link on the homepage itself (not on the main menu)

Thanks Anyone please?


回答1:


Try this if/else syntax from the cms (using the customer group reference strictly as an example)...

{{if customer.group_id==4}} Print true {{else}} Print false {{/if}}


来源:https://stackoverflow.com/questions/11627963/use-if-else-in-magento-homepage-content

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!