1
左側邊欄類
我使用的Magento 2,仍然奮鬥這一類上市網址執行: https://github.com/Sebwite/magento2-category-sidebarMagento的2:從Sebwite
什麼是下面做這行的正確方法?我應該編輯哪個文件?
您應該在主題中實現塊Sebwite \ Sidebar \ Block \ Sidebar以使此擴展功能正常工作。
由於我是新手,因此我無法找到任何有關這方面的知識,因爲我知道我應該錯過了這裏的一些東西。
我嘗試了幾次嘗試,但似乎仍然沒有顯示左側類別。
我試圖編輯/vendor/magento/theme-frontend-luma/Magento_Catalog/layout/default.xml
但仍然沒有運氣。
下面是我default.xml中
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header-wrapper">
<container name="compare-link-wrapper" label="Compare Link Wrapper" as="compare-link-wrapper" after="top.search" htmlTag="ul" htmlClass="compare wrapper">
<block class="Magento\Framework\View\Element\Template" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="compareProducts" xsi:type="array">
<item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
</item>
</item>
</argument>
</arguments>
</block>
</container>
</referenceContainer>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<block class="Sebwite\Sidebar\Block\Sidebar" name="category-sidebar" template="Sebwite_Sidebar::sidebar.phtml" />
</body>
</page>
任何建議非常讚賞。
謝謝
我使用這個擴展,並發現它也沒有顯示在側邊欄的「默認分類」中,相同的擴展在使用相同配置的本地服務器上正常工作。任何想法可能是這個問題的原因? – p4pravin