roll up banner Print Design Graphic Design
Global Smarty Variables used in Prestashop
Today i want to share a useful list of smarty global variables. All of this variables you can use in template files (both modules and theme). Enjoy!
{$base_dir_ssl} | URL of your store when SSL certificate is active |
{$base_dir} | URL of your store |
{$cart} | Information about cart. Read entries below for more informations |
{$cart->id} | ID of customer cart |
{$cart->id_shop_group} | ID of shop group (multistore feature) |
{$cart->id_shop} | ID of shop (multistore feature) |
{$cart->id_address_delivery} | ID of customer address delivery (only if order was made) |
{$cart->id_address_invoice} | ID of customer address invoice (only if order was made) |
{$cart->id_currency} | ID of cart currency |
{$cart->id_customer} | ID of customer for which cart belongs (only if customer is logged) |
{$cart->id_guest} | ID of shop guest |
{$cart->id_lang} | ID of cart language |
{$cart->recycable} | Bool value if recycable checked for this cart |
{$cart->gift} | Bool value if gift checed for this cart |
{$cart->gift_message} | Gift message |
{$cart->mobile_theme} | Bool value if cart was created on mobile device |
{$cart->date_add} | Date of cart creation |
{$cart->date_upd} | Date of cart update |
{$cart->id_carrier} | Id of cart carrier (if selected) |
{$cart->checkedTos} | Bool value if terms of service is checked |
{$img_cat_dir} | URL for the directory with categories images |
{$img_ps_dir} | URL for the directory with PrestaShop image |
{$img_lang_dir} | URL for the directory with languages images |
{$img_sup_dir} | URL for the directory with suppliers images |
{$img_ship_dir} | URL for the directory with carriers images |
{$img_prod_dir} | URL for the directory with products images |
{$img_manu_dir} | URL for the directory with manufacturers images |
{$img_dir} | URL for the directory with theme’s images |
{$css_dir} | URL for the directory with theme’s CSS |
{$modules_dir} | URL for the directory with modules |
{$mail_dir} | URL for the directory with mail templates |
{$js_dir} | URL for the directory with theme’s JavaScript |
{$tpl_dir} | URL for the directory with current theme’s |
{$pic_dir} | URL for the directory with uploaded pictures |
{$lang_iso} | ISO code for the current language |
{$cart_qties} | Number of products in the cart |
{$come_from} | URL for the visitor’s origin |
{$shop_name} | Shop name |
{$currency} | Currency object (currently used currency). |
{$currencies} | The various available currencies |
{$id_currency_cookie} | ID of the current currency |
{$cookie} | User cookie |
{$languages} | The various available languages |
{$priceDisplay} | Price display method (with or without taxes…) |
{$roundMode} | Rounding method in use |
{$logged} | Indicates whether the visitor is logged to a customer account |
{$page_name} | Page name |
{$customerName} | Client name (if logged in) |
{$use_taxes} | Indicates whether taxes are enabled or not |
How to know the current page is home or not in prestashop
Coding on your template file like below
1 2 3 |
{if $page_name != 'index'} ... your code ... {/if} |
How to change the logo link url on wordpress login form
1 2 3 4 |
function loginpage_custom_link() { return get_bloginfo("wpurl"); } add_filter('login_headerurl','loginpage_custom_link'); |
How to create a widget area in wordpress theme
How to enable widget area in wordpress theme
Custom widget area is enabled from function.php that is available in the themes folder.
Add the following code in function.php to enable/register widget area in the wordpress theme:
1 2 3 4 5 6 7 8 9 10 11 |
if (function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Sidebar Widgets', 'id' => 'sidebar-widgets', 'description' => 'Widget Area', 'before_widget' => '<div id="one" class="two">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>' )); } |
How to add widget area in wordpress theme
Once you have enabled the function in function.php you can make any area as a widget area within a wordpress theme. Add the following code to the area ( sidebar, footer, header ) where you want the widget to to make a slot and add widget to it later from widgets setting panel:
1 2 3 4 |
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Widgets') ) { } ?> |
NOTE: If you want more then one area to be widgetized at the same time, then you have to register sidebar in function.php more then once with different names and id’s
Now that you have enabled the widget area as well as created a slot for the widgets to be placed in, you can go to Appearance -> Widgets in admin panel and add the widgets to the slot you have just created.
Show Siblings or Children of a WordPress Page
It’s useful for making pages’ sub menu in wordpress.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<div id="subpages"> <h3>Related Pages</h3> <?php // If CHILD_OF is not NULL, then this page has a parent // Therefore, list siblings i.e. subpages of this page's parent if($post->post_parent){ wp_list_pages('title_li=&include='.$post->post_parent); wp_list_pages('title_li=&child_of='.$post->post_parent); } // If CHILD_OF is zero, this is a top level page, so list subpages only. else{ wp_list_pages('title_li=&include='.$post->ID); wp_list_pages('title_li=&child_of='.$post->ID); } ?> </div> |
Web site design_homepage design
Website design
homepage design
organic cosmetic company
Web Design Homepage Design
Web Design
Homepage Design