Shopify - Display Specific Collection Product on a Page - WebSecuritySpecialist

Tuesday, 22 December 2015

Shopify - Display Specific Collection Product on a Page

Shopify - Display Specific Collection Product on a Page.

If you have a wish to show product for a specific collection on a page then follow theses steps -
  1. Create a page template in your theme.
    Theme -> Edit/HTML-CSS -> templates Create yourpagename.page.liquid file.
  2. Once you created a page enter below code in it.
    <div class="sb-titles"><a href="javascript:void(0)">Your Collection Name Title</a></div> <div id="sandBox-wrapper" class="group-product-item"> <ul id="sandBox" class="list-unstyled row"> {% for prod in collections.YOUR COLLECTION NAME.products %} <li class="element{% cycle ' first', '', '', '' %}" data-alpha="{{prod.title}}" data-price="{{prod.price}}"> {% include 'product-item' %} </li> {% endfor %} </ul> </div>
  3. Save the page and then go to pages and create a new page and assign the page template which you created in STEP - 2.
That's It. You successfully created a page which will list product for specific collection.

Now you can add the page to menu from navigation panel.

No comments:

Post a Comment