【问题标题】:Magento - No price in product pageMagento - 产品页面没有价格
【发布时间】:2012-01-30 21:17:10
【问题描述】:

我安装了 SCP(简单可配置产品),并且对于每个没有自定义选项的简单产品,价格都不会显示在产品页面中。只要我添加一个选项,价格就会显示出来。

未选择任何选项时,产品页面上不会调用价格块或模板。

我看到扩展正在扩展 Mage_Catalog_Block_Product_Price 块,但我找不到应该调用这个块的位置。

【问题讨论】:

    标签: magento


    【解决方案1】:

    还没有找到任何解决方案,所以我做了这个可行的 jquery 解决方法

    把这个放在template/catalog/product/view.phtml的最后

    jQuery(document).ready(function($) {
         if($('.price-box').length==0){
             var price = '<div class="price-box"><span class="regular-price"><span class="price">$<?php echo number_format($_product->getPrice(),2); ?></span></span></div>';
             $('.product-options-bottom').before(price);
         }
     });
    

    当然,你需要有jquery。

    【讨论】:

    • 谢谢 - 你是如何添加 jQuery 的?
    猜你喜欢
    • 1970-01-01
    • 2012-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多