Vote to Improve PrestaShop

PrestaShop Forum: Build a free online shop. Count on the Community!

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum: Build a free online shop. Count on the Community!

Jump to content



  • Please log in to reply
No replies to this topic
gonebdg -

    PrestaShop Fanatic

  • Moderators
  • 1297 posts

Posted 14 April 2010 - 04:05 PM

Berikut ini adalah aturan penulisan script kode menurut SMARTY GLOBAL dan DIRECTORY CONFIGURATION yang digunakan dalam Prestashop.
Gunakan kode-kode ini saat menuliskan URL atau melakukan editing script file Prestashop Anda, sehingga Anda tidak akan dipusingkan dengan perubahan lokasi file (localhost ke live server, atau dari web server ke web server lainnya)

contoh-01 : penulisan alamat website Prestashop anda yang berdomain
==> {$base_dir}
sama artinya dengan

contoh-02 : lokasi gambar logo website Prestashop Anda yang berdomain
==> {$img_ps_dir}logo.jpg
sama artinya dengan

Ini list-nya ... :)


$base_dir { root folder of your shop }
$base_dir_ssl { root folder of your shop using HTTPS protocol }
$this_path { current directory folder of your file }
$this_path_ssl { current directory folder of your file using HTTPS protocol }
$content_dir { root folder of your shop depending on the SSL settings }
$img_ps_dir { root folder containing images "/img/" }
$img_dir { images folder in your current theme directory }
$css_dir { css folder inside the current theme folder }
$js_dir { JavaScript inside the theme folder }
$tpl_dir { theme root folder }
$modules_dir { modules root folder }
$mail_dir { mail templates root folder }
$lang_iso { current language ISO code }
$come_from { previous page address [absolute] }
$shop_name { your specified shop name }
$cart_qties { total number of products in the cart }
$cart { shopping cart contents }
$currencies { pulls available currencies }
$id_currency_cookie { selected currency id [cookie dependent] }
$currency { active currency }
$cookie { active cookie }
$languages { grabs available languages }
$logged { checks whether users is logged in }
$page_name { current page's name }
$customerName { customer name [session dependent] }
$priceDisplay { current price display settings [currency dependent] }


/* Base and themes */
define('_THEMES_DIR_', __PS_BASE_URI__.'themes/');
define('_THEME_IMG_DIR_', _THEMES_DIR_._THEME_NAME_.'/img/');
define('_THEME_CSS_DIR_', _THEMES_DIR_._THEME_NAME_.'/css/');
define('_THEME_JS_DIR_', _THEMES_DIR_._THEME_NAME_.'/js/');
define('_THEME_CAT_DIR_', __PS_BASE_URI__.'img/c/');
define('_THEME_PROD_DIR_', __PS_BASE_URI__.'img/p/');
define('_THEME_PROD_PIC_DIR_', __PS_BASE_URI__.'upload/');
define('_THEME_MANU_DIR_', __PS_BASE_URI__.'img/m/');
define('_THEME_SCENE_DIR_', __PS_BASE_URI__.'img/scenes/');
define('_THEME_SCENE_THUMB_DIR_', __PS_BASE_URI__.'img/scenes/thumbs');
define('_THEME_SUP_DIR_', __PS_BASE_URI__.'img/su/');
define('_THEME_SHIP_DIR_', __PS_BASE_URI__.'img/s/');
define('_THEME_LANG_DIR_', __PS_BASE_URI__.'img/l/');
define('_THEME_COL_DIR_', __PS_BASE_URI__.'img/co/');
define('_SUPP_DIR_', __PS_BASE_URI__.'img/su/');
define('_THEME_DIR_', _THEMES_DIR_._THEME_NAME_.'/');
define('_MAIL_DIR_', __PS_BASE_URI__.'mails/');
define('_MODULE_DIR_', __PS_BASE_URI__.'modules/');
define('_PS_IMG_', __PS_BASE_URI__.'img/');
define('_PS_ADMIN_IMG_', _PS_IMG_.'admin/');

/* Directories */
define('_PS_ROOT_DIR_', realpath($currentDir.'/..'));
define('_PS_CLASS_DIR_', _PS_ROOT_DIR_.'/classes/');
define('_PS_TRANSLATIONS_DIR_', _PS_ROOT_DIR_.'/translations/');
define('_PS_DOWNLOAD_DIR_', _PS_ROOT_DIR_.'/download/');
define('_PS_MAIL_DIR_', _PS_ROOT_DIR_.'/mails/');
define('_PS_MODULE_DIR_', _PS_ROOT_DIR_.'/modules/');
define('_PS_ALL_THEMES_DIR_', _PS_ROOT_DIR_.'/themes/');
define('_PS_THEME_DIR_', _PS_ROOT_DIR_.'/themes/'._THEME_NAME_.'/');
define('_PS_IMG_DIR_', _PS_ROOT_DIR_.'/img/');
define('_PS_CAT_IMG_DIR_', _PS_IMG_DIR_.'c/');
define('_PS_PROD_IMG_DIR_', _PS_IMG_DIR_.'p/');
define('_PS_SCENE_IMG_DIR_', _PS_IMG_DIR_.'scenes/');
define('_PS_SCENE_THUMB_IMG_DIR_', _PS_IMG_DIR_.'scenes/thumbs/');
define('_PS_MANU_IMG_DIR_', _PS_IMG_DIR_.'m/');
define('_PS_SHIP_IMG_DIR_', _PS_IMG_DIR_.'s/');
define('_PS_SUPP_IMG_DIR_', _PS_IMG_DIR_.'su/');
define('_PS_COL_IMG_DIR_', _PS_IMG_DIR_.'co/');
define('_PS_TMP_IMG_DIR_', _PS_IMG_DIR_.'tmp/');
define('_PS_PROD_PIC_DIR_', _PS_ROOT_DIR_.'/upload/');
define('_PS_TOOL_DIR_', _PS_ROOT_DIR_.'/tools/');
define('_PS_SMARTY_DIR_', _PS_TOOL_DIR_.'smarty/');
define('_PS_STEST_DIR_', _PS_TOOL_DIR_.'simpletest/');
define('_PS_SWIFT_DIR_', _PS_TOOL_DIR_.'swift/');
define('_PS_FPDF_PATH_', _PS_TOOL_DIR_.'fpdf/');
define('_PS_PEAR_XML_PARSER_PATH_', _PS_TOOL_DIR_.'pear_xml_parser/');
define('_PS_CSS_DIR_', __PS_BASE_URI__.'css/');
define('_PS_JS_DIR_', __PS_BASE_URI__.'js/');

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users