【问题标题】:Magento swatches not loading in home page latest and featured products sectionMagento 样本未加载到主页最新和特色产品部分
【发布时间】:2015-11-12 04:49:24
【问题描述】:

在我的 magento 主页中,最新产品和特色产品部分的产品色板不起作用。我尝试在主页自定义布局更新 XML 中使用以下代码,但它不起作用:

<reference name="content">
   <block type="catalog/product_new" name="product_new" template="catalog/product/new.phtml">
    <block type="core/text_list" name="product_list.name.after" as="name.after" />
    <block type="core/text_list" name="product_list.after" as="after" />
<block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
   </block>

</reference>

 <PRODUCT_TYPE_configurable translate="label" module="catalog">
        <label>Catalog Product View (Configurable)</label>
        <reference name="product.info">
            <block type="catalog/product_view_type_configurable" name="product.info.configurable" as="product_type_data" template="catalog/product/view/type/default.phtml">
                <block type="core/text_list" name="product.info.configurable.extra" as="product_type_data_extra" translate="label">
                    <label>Product Extra Info</label>
                </block>
            </block>
            <block type="catalog/product_view_type_configurable" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
        </reference>
        <reference name="product.info.options.wrapper">
            <block type="catalog/product_view_type_configurable" name="product.info.options.configurable" as="options_configurable" before="-" template="catalog/product/view/type/options/configurable.phtml">
                <block type="core/text_list" name="product.info.options.configurable.renderers" as="attr_renderers" />
                <block type="core/text_list" name="product.info.options.configurable.after" as="after" />
            </block>
        </reference>
    </PRODUCT_TYPE_configurable>

请帮我解决这个问题。

【问题讨论】:

    标签: magento configurable-product


    【解决方案1】:

    对可配置产品试试这个:

    <reference name="content">
    <block type="catalog/product_list" name="product_list" template="catalog/product/list-no-toolbar.phtml">
                        <block type="core/text_list" name="product_list.name.after" as="name.after" />
                        <block type="core/text_list" name="product_list.after" as="after" />
    <action method="setCategoryId"><category_id>3</category_id></action>
    <action method="setColumnCount"><count>4</count></action>
    <action method="setDefaultDirection"><dir>desc</dir></action>
    </block>
    </reference>
            <reference name="head">
                <action method="addItem"><type>skin_js</type><name>js/configurableswatches/product-media.js</name></action>
                <action method="addItem"><type>skin_js</type><name>js/configurableswatches/swatches-list.js</name></action>
            </reference> 
           <reference name="product_list.name.after">
                <block type="core/template" name="product_list.swatches" template="configurableswatches/catalog/product/list/swatches.phtml" />
            </reference>
            <reference name="product_list.after">
                <block type="configurableswatches/catalog_media_js_list" name="configurableswatches.media.js.list" />
            </reference>
    

    【讨论】:

    • list-no-toolbar.phtml 是对没有工具栏的 list.phtml 的修改。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多