Sale Products Page
A page that generates a list of all products currently on sale.
Before you start this tweak, it's a good idea to run through our preparation checklist below:
- Read through the Getting Started to get a better sense of how the Control Panel, Database and Front End store interact.
- Learn our recommended Simple Workflow. This makes the implementation process as easy as possible.
- Create a new Staging Theme for this tweak. This allows you to preview any changes before they are visible to live customers.
Step 1: Duplicate the category template
Duplicate the existing
category.template.html file within
/httpdocs/assets/themes/[THEME-NAME]/templates/cms and rename it to
Step 2: Edit the page type
At the head of your template, update
[%SET [@page_type@]='category'/%] to
Step 3: Add the code into the template
Paste the following code into the template replacing the
[%thumb_list type:'products' filter_category:'0' filter_inpromo:'1' limit:'24' %] [%param template%][%VIEWBY type:'products' default:'[@templatethumb@]'%][%/VIEWBY%][%/param%] [%param *header%] <div class="[%VIEWBY type:'products' if:'eq' value:'list' if_true:'thumb_list' if_false:'thumb'%][%/VIEWBY%]"> <section class="row products-row" aria-label="Products in category"> [%/param%] [%param *footer%] </section> </div> [%/param%] [%/thumb_list%]
This code will show all products on sale regardless of category, as such the filters on the sidebar will not be populated.
To tidy up the page you can remove the sidebar by deleting this line:
[%load_template file:'cms/includes/sidebar.template.html'/%] from the top of the template.
Or if you would prefer to have the filters shown you would need to assign each product that is on sale to a new category and replace
filter_category:'*category*' where category is the name of your new category.
This will remove the automation that the above function provides, you will need to manually remove and add products to the sale category to update the On Sale Page.
Step 4: Create a Sale page
Create an information page named Sale Products, and set the "Body Template" to
Customising this section
More information on how to customise this section can be found within the Thumb List Documentation.