代码之家  ›  专栏  ›  技术社区  ›  Elamurugan

magento中的价格过滤问题

  •  3
  • Elamurugan  · 技术社区  · 14 年前

       1. $0.00 - $10,000.00  (1027)
       2. $10,000.00 - $20,000.00 (3)
       3. $20,000.00 - $30,000.00 (1)
    

    我需要这样的东西

     #  $40.00 - $60.00  (155)
    # $60.00 - $80.00 (150)
    # $80.00 - $100.00 (153)
    # $100.00 - $200.00 (248)
    # $200.00 - $300.00 (100)
    # $300.00 - $400.00 (43)
    # $400.00 - $500.00 (20)
    # $500.00 - $600.00 (6)
    # $600.00 - $700.00 (6)
    # $700.00 - $800.00 (2)
    
    1 回复  |  直到 14 年前
        1
  •  5
  •   Jonathan Day    14 年前

    如果你往里面看 filter.phtml Mage_Catalog_Block_Layer_Filter_xxx xxx号 是属性类型。这反过来又会引导您找到模型: Mage_Catalog_Model_Layer_Filter_Price .

    内部 app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php ,您将看到方法 getPriceRange()

    可以通过将模型复制到 app/code/local/Mage/Catalog/Model/Layer/Filter 并调整该方法,以便根据您的需求计算范围。

    祝你好运。 JD公司