2014-03-25 107 views
-1

我似乎已經丟失了包含產品的頁面上的塊。我確實安裝了垂直導航,但我不確定這與它有什麼關係。我正在添加產品,檢查他們是否顯示爲庫存等,但他們沒有出現。如果我甚至鍵入類別的描述,這也不會出現。如果我也轉到產品頁面的特定URL,他們仍然不顯示。我已經打開路徑提示,它看起來像塊只是失蹤?幫幫我!Magento塊丟失

回答

0

首先確保您正在使用編譯器並在每次更改後緩存並刷新Magetno緩存和緩存存儲。

你需要研究的兩個文件是你的主題的local.xml文件和主題的list.phtml和view.phtml文件的產品和類別。

棒這個代碼在/app/design/frontend/yourtheme/default/layout/local.xml的端部,看看它是否有差別:

​​
<catalog_category_layered translate="label"> 
    <label>Catalog Category (Anchor)</label> 
    <reference name="left"> 
     <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.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"> 
       <!-- <action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/su.phtml</template></action> --> 
       <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>3</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> 
         <action method="addPagerLimit"><mode>grid</mode><limit>3</limit></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>6</limit></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>9</limit></action> 
         <action method="addPagerLimit" translate="label"><mode>grid</mode><limit>all</limit><label>All</label></action> 
        --> 
       </block> 
       <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_layered> 

[此代碼從類別視圖頁面的MAgento默認XML中解除,因此通過將其放置在local.xml的末尾,這是嘗試將所有塊重新添加回]

然後查看app/design/frontend/yourtheme /默認/ template/catalog/catagory/view.phtml和e nsure它有什麼地方行

<?php echo $this->getProductListHtml() ?>

如果產品塊還是沒有顯示,搜索name="product_list"category.products在所有的XML文件,看看是否有些模塊更改或刪除塊。

如果它仍然不存在,請切換到Magento默認主題,以檢查是否存在默認主題。如果不是,請檢查您的類別設置並開始禁用第三方模塊,直到它恢復。

**編輯

這是應用程序/設計/前端/默認/現代/佈局/的catalog.xml,原代碼檢查是否有這樣的代碼在該文件中:

<catalog_category_default translate="label"> 
    <label>Catalog Category (Non-Anchor)</label> 
    <reference name="root"> 
     <action method="setTemplate"><template>page/2columns-left.phtml</template></action> 
    </reference> 
    <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>10</limit></action> 
         <action method="setDefaultGridPerPage"><limit>8</limit></action> 
         <action method="addPagerLimit"><mode>list</mode><limit>10</limit></action> 
         <action method="addPagerLimit"><mode>list</mode><limit>20</limit></action> 
         <action method="addPagerLimit"><mode>list</mode><limit>30</limit></action> 
         <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>8</limit></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>16</limit></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>24</limit></action> 
         <action method="addPagerLimit" translate="label"><mode>grid</mode><limit>all</limit><label>All</label></action> 
        --> 
       </block> 
       <!--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="setColumnCount"><count>4</count></action> 
       <action method="setToolbarBlockName"><name>product_list_toolbar</name></action> 
      </block> 
     </block> 
    </reference> 
</catalog_category_default> 
<catalog_category_layered translate="label"> 
    <label>Catalog Category (Anchor)</label> 
    <reference name="root"> 
     <action method="setTemplate"><template>page/2columns-left.phtml</template></action> 
    </reference> 
    <reference name="left"> 
     <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.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"> 
       <!-- <action method="addReviewSummaryTemplate"><type>default</type><template>review/helper/su.phtml</template></action> --> 
       <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>10</limit></action> 
         <action method="setDefaultGridPerPage"><limit>8</limit></action> 
         <action method="addPagerLimit"><mode>list</mode><limit>10</limit></action> 
         <action method="addPagerLimit"><mode>list</mode><limit>20</limit></action> 
         <action method="addPagerLimit"><mode>list</mode><limit>30</limit></action> 
         <action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>8</limit></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>16</limit></action> 
         <action method="addPagerLimit"><mode>grid</mode><limit>24</limit></action> 
         <action method="addPagerLimit" translate="label"><mode>grid</mode><limit>all</limit><label>All</label></action> 
        --> 
       </block> 
       <!--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="setColumnCount"><count>4</count></action> 
       <action method="setToolbarBlockName"><name>product_list_toolbar</name></action> 
      </block> 
     </block> 
    </reference> 
</catalog_category_layered> 
+0

非常感謝您的幫助!我有我在'catalog.xml'文件(不是local.xml)中顯示的代碼,只有我認爲我已經刪除了一些重要的東西。我複製並粘貼了你的代碼,並替換了我的工作!謝謝! – user3217495

+0

我說得太快了!我有它的工作,然後打'刷新',它消失了,我不能再回來。我真的不認爲我在刷新之間改變了任何東西,並且我嘗試沖洗我的magento緩存和存儲。 Aghh :(((( – user3217495

+0

更新:它工作,如果我更改'佈局'爲'默認',但如果我有'現代'(我的主題)佈局它不顯示。因此,我失去了我的現代模板。任何想法,我正在尋找解決這個問題。你提到'檢查你的類別設置' - 這是什麼意思? – user3217495