在magento主页内容中使用if else [英] Use if else in magento homepage content

查看:137
本文介绍了在magento主页内容中使用if else的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试显示网格视图,其中主页上显示的销售项目按类别过滤。

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

我试图将php if / else块放在admin的CMS部分的主页内容中,但它不起作用。 CMS中的任何PHP代码都会自动评论!

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!

有没有其他方法按类别过滤主页销售/特色产品?我正在使用Magento 1.7.x

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?

推荐答案

尝试使用cms中的if / else语法(使用严格按客户群参考为例)...

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}}

这篇关于在magento主页内容中使用if else的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆