添加侧栏"按品牌选购"在Bigcommerce模板主题

时间:2017-04-20 16:38:30

标签: bigcommerce

我试图按品牌添加商店到Bigcommerce主题。我已经浏览过模板文件,似乎无法弄明白我需要做什么。我找到了" shop-by-price.html"模板页面,我想我可以在它上面粘贴一些代码,但似乎无法找到品牌列表代码。

这是shop-by-price.html页面

{{#if shop_by_price}}
  <div class="sidebar-block shop-by-price facet-list" data-facet-filter>
    {{> components/common/facet-toggle title=(lang 'category.shop_by_price')}}
    <ul class="facet-list-items is-open" data-facet-filter-wrapper>
      {{#each shop_by_price}}
        <li class="facet-item">
          <a class="{{#if selected }}is-active{{/if}}" href="{{url}}" alt="{{low.formatted}} - {{high.formatted}}">{{low.formatted}} - {{high.formatted}}</a>
        </li>
      {{/each}}
    </ul>
    {{#any shop_by_price selected=true}}
      <a href="{{category_url}}" class="link facet-remove">
        {{lang 'category.reset'}}
      </a>
    {{/any}}
  </div>
{{/if}}

1 个答案:

答案 0 :(得分:0)

如果我没有错,那么你想在类别边栏页面显示品牌列表,所以请从管理员端打开你的模板主题编辑器然后   templates-&gt; components-&gt; category-&gt; sidebar.html 打开文件sidebar.html并粘贴下面的代码

<nav>
    {{#if category.subcategories}}
    <div class="sidebarBlock">
        <h5 class="sidebarBlock-heading">{{category.name}}</h5>
        <ul class="navList">
            {{#each category.subcategories}}
            <li class="navList-item">
                <a class="navList-action" href="{{url}}" alt="{{name}}" title="{{name}}">{{name}}</a>
            </li>
            {{/each}}
        </ul>
    </div>
    {{/if}}
{{#if shop_by_brand}}
        <div class="sidebarBlock">
            <h5 class="sidebarBlock-heading">{{lang 'brand.label'}}</h5>
            <ul class="navList">
                {{#each shop_by_brand}}
                    <li class="navList-item">
                        <a class="navList-action" href="{{url}}">{{name}}</a>
                    </li>
                {{/each}}
                <li class="navList-item">
                    <a class="navList-action" href="{{urls.brands}}">{{lang 'common.view_all'}}</a>
                </li>
            </ul>
        </div>
        {{/if}}
    {{#if category.faceted_search_enabled}}
        {{> components/faceted-search/index category}}
    {{else}}
        {{> components/category/shop-by-price shop_by_price=category.shop_by_price category_url=category.url}}
    {{/if}}

</nav>

点击“保存并应用”按钮后,它将如下所示 http://deepak-diwan-s-store.mybigcommerce.com/ala-carte-by-the-lb/