Prestashop – How To Change Home Feature Product Deafult Sorting in PHP

By default Prestashop Home Feature product module is sorted by position. If you would like to change it to sort by date (Latest products show first), you need to change the homefeatured.php under ‘modules’ –> ‘homefeatured’. Before you do the following changes, please make sure you make a backup in case something goes wrong. Let’s[…]

How to find first and last index of foreach loop in smarty

When we do a coding with the Prestashop sometime we need to find whether first/last index of foreach loop. There are 2 ways to find first or last index of foreach loop in the smarty. I will show you some of example for that. {foreach from=$arrList key=myId item=i name=foo} {if $smarty.foreach.foo.first} This is the first[…]

Prevent fancy box popup on product detail page on mobile – Prestashop

This tutorial is base on the Prestashop 1.6.X Every product has the possibility to have several images, those images are listed as a list to the left of the main product image. The problem is when the user clicks on any of the thumbnails, it pops up with a fancy box and swapping over the[…]

Prestashop – Useful Global Smarty Variables

I’d like to share some very useful global variables of the smarty for the Prestashop. {$base_dir_ssl} URL of your store when SSL certificate is active {$base_dir} URL of your store {$cart_qties} Number of products in the cart {$cart} Information about cart. Read entries below for more informations {$cart->checkedTos} Bool value if terms of service is[…]