【问题标题】:magento special price product page loads products with wrong datesmagento 特价产品页面加载日期错误的产品
【发布时间】:2013-03-17 11:55:32
【问题描述】:

我发现这个 tut 是为了创建一个带有特价的 magento 产品的页面。 http://workingmagento.blogspot.nl/2011/02/magento-how-to-create-special-price.html

只有选择正确的产品才能正常工作。

因此,该脚本只需要加载具有今天日期所在日期范围的产品。问题是它加载具有任何日期的产品。

在这个脚本中找不到错误。

有人知道解决方案吗? 提前致谢。

【问题讨论】:

    标签: magento product


    【解决方案1】:
     ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate))
             ->addAttributeToFilter('special_to_date', array('or'=> array(0 => array('date' => true, 'from' => $dateTomorrow), 1 => array('is' => new Zend_Db_Expr('null')))), 'left')
    

    确保有这两行代码。 还要检查 $todatDate 和 $dateTomorrow 的值。

    仅供参考:您所说的链接上的代码不是标准的 magento 代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多