【问题标题】:Magento. Values from Advanced search to be displayed in footer as listMagento。高级搜索中的值以列表形式显示在页脚中
【发布时间】:2013-09-08 13:28:59
【问题描述】:

在 Magento 中,我有属性 - 品牌。它是多选的,并出现在高级搜索中。我需要的是高级搜索中的这些值作为列表显示在页脚中,例如:品牌 1、品牌 2 ......我不需要搜索结果(不是产品),而是品牌名称,以便用户可以点击品牌名称,它会将他带到包含所有具有此品牌属性的产品的页面。

【问题讨论】:

    标签: magento footer advanced-search


    【解决方案1】:

    我找到了解决方案。显然这不是正确和最好的方法,但对于我的需要来说它很好。我安装了免费扩展“按品牌浏览”(在 Magento-connect 中有几个)。此扩展程序在左侧创建您的品牌列表。我复制了创建列表(品牌链接)的代码块并将其粘贴到页脚中。这不是最好的解决方案,因为我需要在扩展和属性中分别创建品牌。正如我所说,这不是最好的方法,但它仍然可能对某些人有用。

    【讨论】:

      【解决方案2】:

      您好,下面的代码您将获得品牌名称,而不是产品链接可能会对您有所帮助

      $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'computer_manufacturers'); //here, "computer_manufacturers" is the attribute_code
      $allOptions = $attribute->getSource()->getAllOptions(true, true);
      foreach ($allOptions as $instance) {
      echo $instance['label'];
      }
      

      【讨论】:

      • 不是我需要的,但谢谢!:)
      猜你喜欢
      • 2011-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多