我试图弄清楚如何做到这一点,但无法解决,我尝试在这里、谷歌和 Virtuemart 论坛上搜索,但没有成功。
我正在尝试在类别浏览页面的产品详细信息页面上显示添加到购物车按钮。我之前在 Virtuemart 1.1 中使用以下代码执行此操作:
<?php echo $form_addtocart ?>
然而,在尝试在 Virtuemart 2 中使用相同的代码时,我没有得到任何结果,即使他们的指南仍然说明了这一点,据我所知:http: //virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html
我尝试从产品页面复制确切的代码,但这也不起作用,代码是:
<?php
// Add To Cart Button
if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices)) {
echo $this->loadTemplate('addtocart');
} // Add To Cart Button END
?>
我要覆盖的文件位于:
/components/com_virtuemart/views/category/tmpl/default.php (the Category template)
/components/com_virtuemart/views/productdetails/tmpl/default.php (the Product page that the button is from)
=====
如果我忽略了一些简单的事情或者我遗漏了任何必要的信息,我深表歉意。
问候,亚历克斯尼尔。