显示自定义添加到购物车模板上的某些产品的客人在Magento


Show Custom Add To Cart Template on Certain Products for Guest in Magento

我想强制用户在订单页面注册,以便在购物车中添加某些产品。我有一个自定义的Add to Cart php。为了激活特定产品的特殊add to cart,我在产品中使用以下代码,如下所示

<reference name="product.info.addtocart">
  <action method="setTemplate">   
    <template>catalog/product/view/customtemplate.phtml</template>
  </action>
</reference>

谁能给我指示如何强制用户登录订购那些特定的产品使用这个模板,即只有登录的用户可以使用我的自定义模板?

在模板文件catalog/product/view/customtemplate.phtml中可以查看客户是否登录

if(Mage::getSingleton('customer/session')->isLoggedIn())
{
    // display the contents of the template file
}