handlebars.js - get the `top 4 products from each toptier category sorted by date-added (to bigcommerce)` -
bigcommerce stencil
i totally winged below snippet. need hint on doing correct way. need top 4 products each toptier category sorted date-added (to bigcommerce)
{{#each categories}} {{#each products sort:date-added limit:4}} {{name}} {{/each}} {{/each}}
to add, syntax use following. however, don't have evidence such way exists yet.
home.html
{{> components/product/all-products grid=products.all default_image=theme_settings.default_image}}'
all-products.html being custom file.
all-products.html
{{#if grid}} <section class="products-new {{theme_settings.background-for-new-products}}"> <div class="layout-container"> <h1 class="section-title">{{lang 'product.product_blocks.new_products.heading'}}</h1> <div class="product-grid"> {{#each grid}} {{> components/product/product-item show_quickshop=true show_rating=true default_image=../default_image}} {{/each}} </div> </div> </section> {{/if}}
Comments
Post a Comment