好的,这是一个似乎很容易解决的问题,但这使我难以理解...

我的Magento网站上有一些类别,每个类别中都有一些产品。我希望它们显示为4列数,但始终显示为3列数,如此处所示:

我已经试过了:
app/desing/frontend/default/mytheme/layout/catalog.xml 上,我修改了以下代码:

<!--
Category default layout
-->

<catalog_category_default translate="label">
    <label>Catalog Category (Non-Anchor)</label>
    <reference name="left">
        <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
    </reference>
    <reference name="content">
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
            <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
                    <!-- The following code shows how to set your own pager increments -->
                    <!--
                        <action method="setDefaultListPerPage"><limit>4</limit></action>
                        <action method="setDefaultGridPerPage"><limit>9</limit></action>
                        <action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
                        <action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
                        <action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
                        <action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
                        <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
                    -->
                </block>
                <action method="setColumnCount"><columns>4</columns></action>
                <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
            </block>
        </block>
    </reference>
</catalog_category_default>

因此,我应该将列数设置为4,但它仍会继续显示3个产品...知道吗?

PS:使用Magento 1.7。

最佳答案

尝试使用更新句柄操作来定义当前的布局(有时主题使用默认的列数而不是layoutdepend):
只需在节点的开头添加一行

<catalog_category_default translate="label">
    <update handle="page_two_columns_left" />

关于magento - 如何更改列数Magento,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13951090/

10-11 05:09