【发布时间】:2017-01-17 10:23:19
【问题描述】:
我正在使用 magento 1.9.1 并尝试直接在 cms 页面上创建产品链接。我创建了一个 custombutton.phtml 文件并在此处添加按钮代码。
<?php $formKey = Mage::getSingleton('core/session')->getFormKey(); ?>
<a class="animated infinite swing btn btn-yellow btn-lg m-r-2" role="button" href="abc.com/checkout/cart/add?product=401&qty=1&form_key=<?php echo $formKey ?>">Add to cart</a>
现在我将此 phtml 文件称为 cms 页面上的块。
{{block type="core/template" name="custombutton" template="custombutton.phtml"}}
但有时它显示按钮,有时不显示。没有得到问题。
【问题讨论】:
-
我认为缓存块时会出现问题。
-
缓存在网站上被禁用。
标签: magento