[Prestashop help] How to modify “Best Sale” page of Prestashop?

Best Sale” page is a default page in Prestashop’s core which display products have best selling. You can go to this page from Footer of Classic theme.

best-sales-page-2

Or you can directly go to best-sales controller with this URL: http://your-prestashop-store.com/index.php?controller=best-sales

How to display a product on best-sales page?

When an Order have a Status marked as validated (When you completed checkout an Order in website or when you change Status of an Order from Backoffice) , all products of this order will be inserted product_sale table. When a customer view best sales page, Prestashop list products from product_sale table order by sales from highest to lowest.

So How to know an Order is validated?

An Order will be marked as validated if it’s Order Status checked option: Consider the associated order as validated.

  • For Prestashop 1.7, go to Shop Parameters > Order Settings > Statuses, click add/edit a Order Status. An Order have this Status will be marked as validated if it checked option: Consider the associated order as validated.

best-sales-page-3

best-sales-page-4

How to modify products, layout, style of best-sales page?

Products is listing on a new-products page based on the method: ProductSale::getBestSales

Step 1: Go to classes\ProductSale.php, find method function getBestSales

You can view source code for query products that list in best-sale products page at there.

best-sales-page-5

Step 2: Go to it’s template fie (*.tpl)

  • For Prestashop 1.7: go to PRESTASHOP_ROOT\themes\YOUR_THEME\templates\catalog\listing\best-sales.tpl
  • For Prestashop 1.6: Template file is in PRESTASHOP_ROOT\themes\YOUR_THEME\best-sales.tpl

You can use Smarty language to modify *.tpl template file if you need insert, change HTML tags for customize layout.

Related Articles

Leave a reply

You must be logged in to post a comment.