【问题标题】:Magento:How to display drop down attribute on the product listing pageMagento:如何在产品列表页面上显示下拉属性
【发布时间】:2010-11-18 09:52:43
【问题描述】:

我创建了一个带有可配置产品的下拉属性

我想在网格/列表产品页面中添加选择我的选择属性的组合,以便能够直接从该页面将产品放入我的购物车,目前这是不可能的:我有进入第二页选择属性。

我已经阅读了很多线程,但我没有找到实现它的方法。

感谢您的帮助。

【问题讨论】:

    标签: list attributes magento


    【解决方案1】:

    因此,您希望将带有“自定义属性”的产品“添加到购物车按钮”添加到产品列表页面。对此有一个扩展,请参见下文:

    http://www.mageworx.com/ajax-cart-magento-extension.html

    我只设法在我的类别列表页面上添加了一个“将所有商品添加到购物车”按钮和“添加到购物车”按钮。

    【讨论】:

      【解决方案2】:

      对于具有前端类型“选择”的属性,我们需要定义在产品页面上转换为下拉列表的选项。例如属性颜色可能有红色、绿色、蓝色等选项,这些选项在管理区域中定义。

      我们可以轻松收集任何属性的所有已定义选项。

      // use your own attribute code here
      $attribute_code = "color";
      $attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code);
      $options = $attribute_details->getSource()->getAllOptions(false);
      Foreach($options as $option){
      // print_r($option) and find all the elements
      echo $option["value"];
      echo $option["label"];
      }
      

      有关 magento 购物车产品的更多信息,请访问我们的 Web\Agency-shop

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-09-15
        • 1970-01-01
        • 1970-01-01
        • 2016-05-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多