douji6735 2014-07-03 16:13
浏览 44
已采纳

$ _product不包含所有需要的数据(minmal_price)

EDIT: Basically, my problem is that I need to get the minimal_price of an configurable product in category view. Previously, this worked by using

$_product = $this->getProduct();

$_product->getMinimalPrice();

However, it doesn't work anymore. I noticed, that when it still worked dumping $_product would contain 'minimal_price'. Now, this is not the case anymore. Does anyone know what the reason could be?

OLD: I am currently struggling with a really weird error. I updated to magento 1.9 but not everything was working as expected. The category pages became really slow. So I downgraded again to 1.8 which was working fine on our test development server, but now the price of the configurable products, wouldn't display any more on the category sites. Even on a clean magento install 1.7 (with the same database!) it doesn't work.

What I found out is, that first, the price.phtml got changed im Magento 1.9 and two more calls were added, which lead to the increased loading time:

$_convertedFinalPrice = $_store->roundPrice($_store->convertPrice($_product->getFinalPrice()));
$_specialPriceStoreLabel = $this->getProductAttribute('special_price')->getStoreLabel();

The main problem for me is that prices aren't displayed anymore. I noticed the following:

When I dump $_product->debug(); it doesn't contain minimal_price anymore. That is most likely the reason why getMinimalPrice() is not working anymore.

The weird part is, that like I said on a different test development site it is still working and $_product->debug(); still contains minimal_price.

Does someone have an explanation why on one page minimal_price is still included, but on a different site it's not?

Thanks

  • 写回答

2条回答 默认 最新

  • douhe1864 2014-07-19 14:12
    关注

    Remember to enable flat catalog and flat category ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭