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 $} 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[…]

Convert address tag to Google Maps embed tag(iframe) with jQuery

1. HTML Part [html] <address class="need_to_convert"> 1 Chaplin Drive, Lane Cove West, New South Wales, Australia </address> [/html] 2. jQuery Part Using jQuery, we will search the whole document for <address> tags with “need_to_convert” class name, create some HTML to embed the map with the current address inserted in it, then write that HTML out[…]

WordPress – Script(PHP) to convert MySQL collation from utf8mb4 to utf8

If your MYSQL database import fails with Unknown collation: ‘utf8mb4_unicode_ci’ after the latest WordPress update 4.2.2, chances are that you are running a MYSQL server version 5.5.2 or below. With the most recent update, WordPress changed their encoding standard from utf8 to utf8mb4, which is only supported starting with MYSQL server version 5.5.3. This can[…]

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[…]

WooCommerce – How to change “Add to cart” button text, Tips & Tricks

I’d like to share how to change “Add to cart” text of the WooCommerce. Change the add to cart text on product archives Add the following to your functions.php file under your activated theme. WooCommerce <2.1 [php] add_filter( ‘add_to_cart_text’, ‘my_archive_custom_cart_button_text’ ); function my_archive_custom_cart_button_text() { return __( ‘My Button Text’, ‘woocommerce’ ); } [/php] WooCommerce 2.1+[…]

Cheap Woocommerce Shipping Plugins for Australian Business

Woocommerce is one of the most popular ecommerce plugin for WordPress. As an online retailer in Australia, the most complicate part of online business is definitely the SHIPPING! ┬áBusiness easily lose money on the shipping if not setting it up properly. The cost of shipping in Australia varies depending on the destination. There are huge[…]