2012-08-01 83 views
4

我有一个magento网站。如何在商品添加为价格的“Price for price”产品

我有多少产品要添加。

But some have price as "Contact for Pricing" or "Call for Pricing" so cant to add . 

Because there have validation for price. 

那么我该如何添加这样的产品?

如果有这种产品的任何模块?

我需要显示此产品的价格为“定价联系”或“定价电话”。

如果有任何“免费价格”的免费下载扩展名?

+0

如果没有扩展名,我认为这并不难。 – 2012-08-01 09:50:59

+0

这种类型的问题并不属于Stack Overflow,因为它不是编程问题。你应该看看http://area51.stackexchange.com/proposals/25439/magento,看看获得一个合适的地方来提出这些问题 – Sturm 2012-08-02 18:00:45

回答

3

为呼叫价格创建是/否属性。在创建产品时,只需在价格字段中添加一些内容即可过去验证。

现在修改您的模板文件,以便在Call For Price设置为'Yes'时不显示价格。

3

乔希的回答略有改善。感谢乔希的使用属性的想法!

为此示例创建属性代码“call_4_price”。像乔什建议的那样,将它设为是/否属性。默认值“否”。将它添加到您需要隐藏价格的属性集。

找到所有一个.phtml文件,其中 “价格&添加到购物车按钮” 是(模板>产品目录>产品> view.phtml,price.phtml,list.phtml等)

这个代码粘贴之前报价码。

 <!-- Call For Price - begin --> 
     <?php $attribute = $_product->getResource()->getAttribute('call_4_price'); ?> 
      <?php $attribute_value = $attribute ->getFrontend()->getValue($_product); ?> 
      <?php if ($attribute_value == 'Yes'): ?> 
       //Please Call for pricing 
      <?php else: ?> 

而这后添加到购物车按钮。

  <?php endif; ?> 
     <!-- Call For Price - end -->