// Context - first commit
This commit is contained in:
@@ -47,9 +47,9 @@ class AddressControllerCore extends FrontController
|
||||
parent::preProcess();
|
||||
|
||||
if ($back = Tools::getValue('back'))
|
||||
self::$smarty->assign('back', Tools::safeOutput($back));
|
||||
$this->smarty->assign('back', Tools::safeOutput($back));
|
||||
if ($mod = Tools::getValue('mod'))
|
||||
self::$smarty->assign('mod', Tools::safeOutput($mod));
|
||||
$this->smarty->assign('mod', Tools::safeOutput($mod));
|
||||
|
||||
if (Tools::isSubmit('ajax') AND Tools::isSubmit('type'))
|
||||
{
|
||||
@@ -78,7 +78,7 @@ class AddressControllerCore extends FrontController
|
||||
Tools::redirect('index.php?controller=addresses');
|
||||
$this->errors[] = Tools::displayError('This address cannot be deleted.');
|
||||
}
|
||||
self::$smarty->assign(array('address' => $this->_address, 'id_address' => (int)$id_address));
|
||||
$this->smarty->assign(array('address' => $this->_address, 'id_address' => (int)$id_address));
|
||||
}
|
||||
elseif (Tools::isSubmit('ajax'))
|
||||
exit;
|
||||
@@ -222,7 +222,7 @@ class AddressControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addJS(_THEME_JS_DIR_.'tools/statesManagement.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'tools/statesManagement.js');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -252,17 +252,17 @@ class AddressControllerCore extends FrontController
|
||||
$countriesList .= '<option value="'.(int)($country['id_country']).'" '.($country['id_country'] == $selectedCountry ? 'selected="selected"' : '').'>'.htmlentities($country['name'], ENT_COMPAT, 'UTF-8').'</option>';
|
||||
|
||||
if ((Configuration::get('VATNUMBER_MANAGEMENT') AND file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php')) && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT')))
|
||||
self::$smarty->assign('vat_display', 2);
|
||||
$this->smarty->assign('vat_display', 2);
|
||||
else if(Configuration::get('VATNUMBER_MANAGEMENT'))
|
||||
self::$smarty->assign('vat_display', 1);
|
||||
$this->smarty->assign('vat_display', 1);
|
||||
else
|
||||
self::$smarty->assign('vat_display', 0);
|
||||
$this->smarty->assign('vat_display', 0);
|
||||
|
||||
self::$smarty->assign('ajaxurl', _MODULE_DIR_);
|
||||
$this->smarty->assign('ajaxurl', _MODULE_DIR_);
|
||||
|
||||
self::$smarty->assign('vatnumber_ajax_call', (int)file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'));
|
||||
$this->smarty->assign('vatnumber_ajax_call', (int)file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'));
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'countries_list' => $countriesList,
|
||||
'countries' => $countries,
|
||||
'errors' => $this->errors,
|
||||
@@ -277,7 +277,7 @@ class AddressControllerCore extends FrontController
|
||||
$id_country = is_null($this->_address)? 0 : (int)$this->_address->id_country;
|
||||
|
||||
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($id_country, $split_all = true);
|
||||
self::$smarty->assign('ordered_adr_fields', $dlv_adr_fields);
|
||||
$this->smarty->assign('ordered_adr_fields', $dlv_adr_fields);
|
||||
}
|
||||
|
||||
public function displayHeader()
|
||||
@@ -291,7 +291,7 @@ class AddressControllerCore extends FrontController
|
||||
parent::displayContent();
|
||||
|
||||
$this->_processAddressFormat();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'address.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'address.tpl');
|
||||
}
|
||||
|
||||
public function displayFooter()
|
||||
|
||||
@@ -40,8 +40,8 @@ class AddressesControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
Tools::addJS(_THEME_JS_DIR_.'tools.js');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
$this->addJS(_THEME_JS_DIR_.'tools.js');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -56,7 +56,7 @@ class AddressesControllerCore extends FrontController
|
||||
die(Tools::displayError('Customer not found'));
|
||||
|
||||
// Retro Compatibility Theme < 1.4.1
|
||||
self::$smarty->assign('addresses', $customer->getAddresses((int)(self::$cookie->id_lang)));
|
||||
$this->smarty->assign('addresses', $customer->getAddresses((int)(self::$cookie->id_lang)));
|
||||
|
||||
$customerAddressesDetailed = $customer->getAddresses((int)(self::$cookie->id_lang));
|
||||
|
||||
@@ -81,7 +81,7 @@ class AddressesControllerCore extends FrontController
|
||||
if (($key = array_search('Country:name', $ordered_fields)))
|
||||
$ordered_fields[$key] = 'country';
|
||||
|
||||
self::$smarty->assign('addresses_style', array(
|
||||
$this->smarty->assign('addresses_style', array(
|
||||
'company' => 'address_company'
|
||||
,'vat_number' => 'address_company'
|
||||
,'firstname' => 'address_name'
|
||||
@@ -95,7 +95,7 @@ class AddressesControllerCore extends FrontController
|
||||
,'alias' => 'address_title'
|
||||
));
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'multipleAddresses' => $multipleAddressesFormated,
|
||||
'ordered_fields' => $ordered_fields));
|
||||
unset($customer);
|
||||
@@ -104,7 +104,7 @@ class AddressesControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'addresses.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'addresses.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class AuthControllerCore extends FrontController
|
||||
if (Tools::getValue('create_account'))
|
||||
{
|
||||
$create_account = 1;
|
||||
self::$smarty->assign('email_create', 1);
|
||||
$this->smarty->assign('email_create', 1);
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('SubmitCreate'))
|
||||
@@ -61,7 +61,7 @@ class AuthControllerCore extends FrontController
|
||||
else
|
||||
{
|
||||
$create_account = 1;
|
||||
self::$smarty->assign('email_create', Tools::safeOutput($email));
|
||||
$this->smarty->assign('email_create', Tools::safeOutput($email));
|
||||
$_POST['email'] = $email;
|
||||
|
||||
}
|
||||
@@ -71,7 +71,7 @@ class AuthControllerCore extends FrontController
|
||||
{
|
||||
$create_account = 1;
|
||||
if (Tools::isSubmit('submitAccount'))
|
||||
self::$smarty->assign('email_create', 1);
|
||||
$this->smarty->assign('email_create', 1);
|
||||
/* New Guest customer */
|
||||
if (!Tools::getValue('is_new_customer', 1) AND !Configuration::get('PS_GUEST_CHECKOUT_ENABLED'))
|
||||
$this->errors[] = Tools::displayError('You cannot create a guest account.');
|
||||
@@ -170,7 +170,7 @@ class AuthControllerCore extends FrontController
|
||||
array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname))
|
||||
$this->errors[] = Tools::displayError('Cannot send email');
|
||||
}
|
||||
self::$smarty->assign('confirmation', 1);
|
||||
$this->smarty->assign('confirmation', 1);
|
||||
self::$cookie->id_customer = (int)($customer->id);
|
||||
self::$cookie->customer_lastname = $customer->lastname;
|
||||
self::$cookie->customer_firstname = $customer->firstname;
|
||||
@@ -310,14 +310,14 @@ class AuthControllerCore extends FrontController
|
||||
$selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
$countries = Country::getCountries((int)(self::$cookie->id_lang), true, NULL, $this->id_current_shop);
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'countries' => $countries,
|
||||
'sl_country' => (isset($selectedCountry) ? $selectedCountry : 0),
|
||||
'vat_management' => Configuration::get('VATNUMBER_MANAGEMENT')
|
||||
));
|
||||
|
||||
/* Call a hook to display more information on form */
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'HOOK_CREATE_ACCOUNT_FORM' => Module::hookExec('createAccountForm'),
|
||||
'HOOK_CREATE_ACCOUNT_TOP' => Module::hookExec('createAccountTop')
|
||||
));
|
||||
@@ -335,7 +335,7 @@ class AuthControllerCore extends FrontController
|
||||
$selectedDays = (int)($_POST['days']);
|
||||
$days = Tools::dateDays();
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'years' => $years,
|
||||
'sl_year' => (isset($selectedYears) ? $selectedYears : 0),
|
||||
'months' => $months,
|
||||
@@ -343,14 +343,14 @@ class AuthControllerCore extends FrontController
|
||||
'days' => $days,
|
||||
'sl_day' => (isset($selectedDays) ? $selectedDays : 0)
|
||||
));
|
||||
self::$smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
$this->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'authentication.css');
|
||||
Tools::addJS(array(_THEME_JS_DIR_.'tools/statesManagement.js', _PS_JS_DIR_.'jquery/jquery-typewatch.pack.js'));
|
||||
$this->addCSS(_THEME_CSS_DIR_.'authentication.css');
|
||||
$this->addJS(array(_THEME_JS_DIR_.'tools/statesManagement.js', _PS_JS_DIR_.'jquery/jquery-typewatch.pack.js'));
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -363,11 +363,11 @@ class AuthControllerCore extends FrontController
|
||||
$back .= (strpos($back, '?') !== false ? '&' : '?').'key='.$key;
|
||||
if (!empty($back))
|
||||
{
|
||||
self::$smarty->assign('back', Tools::safeOutput($back));
|
||||
$this->smarty->assign('back', Tools::safeOutput($back));
|
||||
if (strpos($back, 'order.php') !== false)
|
||||
{
|
||||
$countries = Country::getCountries((int)(self::$cookie->id_lang), true);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'inOrderProcess' => true,
|
||||
'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'),
|
||||
'sl_country' => (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT')),
|
||||
@@ -382,7 +382,7 @@ class AuthControllerCore extends FrontController
|
||||
$this->processAddressFormat();
|
||||
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'authentication.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'authentication.tpl');
|
||||
}
|
||||
|
||||
protected function processAddressFormat()
|
||||
@@ -401,7 +401,7 @@ class AuthControllerCore extends FrontController
|
||||
$addressItems[] = trim($fieldName);
|
||||
|
||||
foreach (array('inv', 'dlv') as $addressType)
|
||||
self::$smarty->assign(array($addressType.'_adr_fields' => $addressFormat, $addressType.'_all_fields' => $addressItems));
|
||||
$this->smarty->assign(array($addressType.'_adr_fields' => $addressFormat, $addressType.'_all_fields' => $addressItems));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class BestSalesControllerCore extends FrontController
|
||||
$nbProducts = (int)(ProductSale::getNbSales((int)$this->id_current_shop));
|
||||
$this->pagination($nbProducts);
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'products' => ProductSale::getBestSales((int)(self::$cookie->id_lang), (int)($this->p) - 1, (int)($this->n), $this->orderBy, $this->orderWay, (int)$this->id_current_shop),
|
||||
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
|
||||
'nbProducts' => $nbProducts,
|
||||
@@ -51,13 +51,13 @@ class BestSalesControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'best-sales.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'best-sales.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class CmsControllerCore extends FrontController
|
||||
self::$link->getCMSCategoryLink($id_cms_category, $infos['link_rewrite'], $infos['id_lang']);
|
||||
$default_rewrite[$infos['id_lang']] = $arr_link;
|
||||
}
|
||||
self::$smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
$this->smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,21 +87,21 @@ class CmsControllerCore extends FrontController
|
||||
parent::setMedia();
|
||||
|
||||
if ($this->assignCase == 1)
|
||||
Tools::addJS(_THEME_JS_DIR_.'cms.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'cms.js');
|
||||
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'cms.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'cms.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
$parent_cat = new CMSCategory(1, (int)(self::$cookie->id_lang));
|
||||
self::$smarty->assign('id_current_lang', self::$cookie->id_lang);
|
||||
self::$smarty->assign('home_title', $parent_cat->name);
|
||||
self::$smarty->assign('cgv_id', Configuration::get('PS_CONDITIONS_CMS_ID'));
|
||||
$this->smarty->assign('id_current_lang', self::$cookie->id_lang);
|
||||
$this->smarty->assign('home_title', $parent_cat->name);
|
||||
$this->smarty->assign('cgv_id', Configuration::get('PS_CONDITIONS_CMS_ID'));
|
||||
if ($this->assignCase == 1)
|
||||
{
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'cms' => $this->cms,
|
||||
'content_only' => (int)(Tools::getValue('content_only')),
|
||||
'path' => ((isset($this->cms->id_cms_category) AND $this->cms->id_cms_category) ? Tools::getFullPath((int)($this->cms->id_cms_category), $this->cms->meta_title, 'CMS') : Tools::getFullPath(1, $this->cms->meta_title, 'CMS'))
|
||||
@@ -109,7 +109,7 @@ class CmsControllerCore extends FrontController
|
||||
}
|
||||
elseif ($this->assignCase == 2)
|
||||
{
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'category' => $this->cms_category,
|
||||
'sub_category' => $this->cms_category->getSubCategories((int)(self::$cookie->id_lang)),
|
||||
'cms_pages' => CMS::getCMSPages((int)(self::$cookie->id_lang), (int)($this->cms_category->id) ),
|
||||
@@ -121,6 +121,6 @@ class CmsControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'cms.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'cms.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,6 +253,6 @@ class CartControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'errors.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'errors.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,14 +32,14 @@ class CategoryControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(array(
|
||||
$this->addCSS(array(
|
||||
_PS_CSS_DIR_.'jquery.cluetip.css' => 'all',
|
||||
_THEME_CSS_DIR_.'scenes.css' => 'all',
|
||||
_THEME_CSS_DIR_.'category.css' => 'all',
|
||||
_THEME_CSS_DIR_.'product_list.css' => 'all'));
|
||||
|
||||
if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0)
|
||||
Tools::addJS(_THEME_JS_DIR_.'products-comparison.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'products-comparison.js');
|
||||
}
|
||||
|
||||
public function displayHeader()
|
||||
@@ -83,7 +83,7 @@ class CategoryControllerCore extends FrontController
|
||||
foreach ($rewrite_infos AS $infos)
|
||||
$default_rewrite[$infos['id_lang']] = self::$link->getCategoryLink((int)$id_category, $infos['link_rewrite'], $infos['id_lang']);
|
||||
|
||||
self::$smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
$this->smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,13 +99,13 @@ class CategoryControllerCore extends FrontController
|
||||
elseif (!$this->category->checkAccess((int)(self::$cookie->id_customer)))
|
||||
$this->errors[] = Tools::displayError('You do not have access to this category.');
|
||||
elseif (!$this->category->active)
|
||||
self::$smarty->assign('category', $this->category);
|
||||
$this->smarty->assign('category', $this->category);
|
||||
else
|
||||
{
|
||||
$rewrited_url = self::$link->getCategoryLink((int)$this->category->id, $this->category->link_rewrite);
|
||||
|
||||
/* Scenes (could be externalised to another controler if you need them */
|
||||
self::$smarty->assign('scenes', Scene::getScenes((int)($this->category->id), (int)(self::$cookie->id_lang), true, false));
|
||||
$this->smarty->assign('scenes', Scene::getScenes((int)($this->category->id), (int)(self::$cookie->id_lang), true, false));
|
||||
|
||||
/* Scenes images formats */
|
||||
if ($sceneImageTypes = ImageType::getImagesTypes('scenes'))
|
||||
@@ -117,18 +117,18 @@ class CategoryControllerCore extends FrontController
|
||||
elseif ($sceneImageType['name'] == 'large_scene')
|
||||
$largeSceneImageType = $sceneImageType;
|
||||
}
|
||||
self::$smarty->assign('thumbSceneImageType', isset($thumbSceneImageType) ? $thumbSceneImageType : NULL);
|
||||
self::$smarty->assign('largeSceneImageType', isset($largeSceneImageType) ? $largeSceneImageType : NULL);
|
||||
$this->smarty->assign('thumbSceneImageType', isset($thumbSceneImageType) ? $thumbSceneImageType : NULL);
|
||||
$this->smarty->assign('largeSceneImageType', isset($largeSceneImageType) ? $largeSceneImageType : NULL);
|
||||
}
|
||||
|
||||
$this->category->description = nl2br2($this->category->description);
|
||||
$subCategories = $this->category->getSubCategories((int)(self::$cookie->id_lang));
|
||||
self::$smarty->assign('category', $this->category);
|
||||
$this->smarty->assign('category', $this->category);
|
||||
|
||||
if (isset($subCategories) AND !empty($subCategories) AND $subCategories)
|
||||
{
|
||||
self::$smarty->assign('subcategories', $subCategories);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign('subcategories', $subCategories);
|
||||
$this->smarty->assign(array(
|
||||
'subcategories_nb_total' => sizeof($subCategories),
|
||||
'subcategories_nb_half' => ceil(sizeof($subCategories) / 2)));
|
||||
}
|
||||
@@ -136,10 +136,10 @@ class CategoryControllerCore extends FrontController
|
||||
{
|
||||
$nbProducts = $this->category->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
|
||||
$this->pagination((int)$nbProducts);
|
||||
self::$smarty->assign('nb_products', (int)$nbProducts);
|
||||
$this->smarty->assign('nb_products', (int)$nbProducts);
|
||||
$cat_products = $this->category->getProducts((int)(self::$cookie->id_lang), (int)($this->p), (int)($this->n), $this->orderBy, $this->orderWay);
|
||||
}
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'products' => (isset($cat_products) AND $cat_products) ? $cat_products : NULL,
|
||||
'id_category' => (int)($this->category->id),
|
||||
'id_category_parent' => (int)($this->category->id_parent),
|
||||
@@ -154,7 +154,7 @@ class CategoryControllerCore extends FrontController
|
||||
}
|
||||
}
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'allow_oosp' => (int)(Configuration::get('PS_ORDER_OUT_OF_STOCK')),
|
||||
'comparator_max_item' => (int)(Configuration::get('PS_COMPARATOR_MAX_ITEM')),
|
||||
'suppliers' => Supplier::getSuppliers()
|
||||
@@ -164,7 +164,7 @@ class CategoryControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'category.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'category.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class CompareControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'/comparator.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'/comparator.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -96,25 +96,24 @@ class CompareControllerCore extends FrontController
|
||||
|
||||
$hasProduct = true;
|
||||
$ordered_features = Feature::getFeaturesForComparison($ids, self::$cookie->id_lang);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'ordered_features' => $ordered_features,
|
||||
'product_features' => $listFeatures,
|
||||
'products' => $listProducts,
|
||||
'link' => new Link(),
|
||||
'width' => $width,
|
||||
'homeSize' => Image::getSize('home')
|
||||
));
|
||||
self::$smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Module::hookExec('extraProductComparison', array('list_ids_product' => $ids)));
|
||||
$this->smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Module::hookExec('extraProductComparison', array('list_ids_product' => $ids)));
|
||||
}
|
||||
}
|
||||
}
|
||||
self::$smarty->assign('hasProduct', $hasProduct);
|
||||
$this->smarty->assign('hasProduct', $hasProduct);
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'products-comparison.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'products-comparison.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class ContactControllerCore extends FrontController
|
||||
|
||||
if (self::$cookie->isLogged())
|
||||
{
|
||||
self::$smarty->assign('isLogged', 1);
|
||||
$this->smarty->assign('isLogged', 1);
|
||||
$customer = new Customer((int)(self::$cookie->id_customer));
|
||||
if (!Validate::isLoadedObject($customer))
|
||||
die(Tools::displayError('Customer not found'));
|
||||
@@ -68,8 +68,8 @@ class ContactControllerCore extends FrontController
|
||||
|
||||
foreach ($products as $key => $val)
|
||||
$orderedProductList .= '<option value="'.$key.'" '.((int)(Tools::getValue('id_product')) == $key ? 'selected' : '').' >'.$val.'</option>';
|
||||
self::$smarty->assign('orderList', $orderList);
|
||||
self::$smarty->assign('orderedProductList', $orderedProductList);
|
||||
$this->smarty->assign('orderList', $orderList);
|
||||
$this->smarty->assign('orderedProductList', $orderedProductList);
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitMessage'))
|
||||
@@ -152,7 +152,7 @@ class ContactControllerCore extends FrontController
|
||||
ORDER BY date_add DESC');
|
||||
if ($old_message == htmlentities($message, ENT_COMPAT, 'UTF-8'))
|
||||
{
|
||||
self::$smarty->assign('alreadySent', 1);
|
||||
$this->smarty->assign('alreadySent', 1);
|
||||
$contact->email = '';
|
||||
$contact->customer_service = 0;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ class ContactControllerCore extends FrontController
|
||||
{
|
||||
if (Mail::Send((int)(self::$cookie->id_lang), 'contact', Mail::l('Message from contact form'), array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, ((int)(self::$cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment)
|
||||
AND Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from))
|
||||
self::$smarty->assign('confirmation', 1);
|
||||
$this->smarty->assign('confirmation', 1);
|
||||
else
|
||||
$this->errors[] = Tools::displayError('An error occurred while sending message.');
|
||||
}
|
||||
@@ -210,7 +210,7 @@ class ContactControllerCore extends FrontController
|
||||
{
|
||||
if (empty($contact->email))
|
||||
Mail::Send((int)(self::$cookie->id_lang), 'contact_form', Mail::l('Your message has been correctly sent'), array('{message}' => stripslashes($message)), $from);
|
||||
self::$smarty->assign('confirmation', 1);
|
||||
$this->smarty->assign('confirmation', 1);
|
||||
}
|
||||
else
|
||||
$this->errors[] = Tools::displayError('An error occurred while sending message.');
|
||||
@@ -227,7 +227,7 @@ class ContactControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'contact-form.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'contact-form.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -235,7 +235,7 @@ class ContactControllerCore extends FrontController
|
||||
parent::process();
|
||||
|
||||
$email = Tools::safeOutput(Tools::getValue('from', ((isset(self::$cookie) AND isset(self::$cookie->email) AND Validate::isEmail(self::$cookie->email)) ? self::$cookie->email : '')));
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'errors' => $this->errors,
|
||||
'email' => $email,
|
||||
'fileupload' => Configuration::get('PS_CUSTOMER_SERVICE_FILE_UPLOAD')
|
||||
@@ -247,9 +247,9 @@ class ContactControllerCore extends FrontController
|
||||
$customerThread = Db::getInstance()->getRow('
|
||||
SELECT cm.* FROM '._DB_PREFIX_.'customer_thread cm
|
||||
WHERE cm.id_customer_thread = '.(int)$id_customer_thread.' AND cm.id_shop='.(int)$this->id_current_shop.' AND token = \''.pSQL($token).'\'');
|
||||
self::$smarty->assign('customerThread', $customerThread);
|
||||
$this->smarty->assign('customerThread', $customerThread);
|
||||
}
|
||||
self::$smarty->assign(array('contacts' => Contact::getContacts((int)self::$cookie->id_lang, (int)$this->id_current_shop),
|
||||
$this->smarty->assign(array('contacts' => Contact::getContacts((int)self::$cookie->id_lang, (int)$this->id_current_shop),
|
||||
'message' => html_entity_decode(Tools::getValue('message'))
|
||||
));
|
||||
}
|
||||
@@ -258,7 +258,7 @@ class ContactControllerCore extends FrontController
|
||||
{
|
||||
$_POST = array_merge($_POST, $_GET);
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'contact-form.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'contact-form.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,13 +47,13 @@ class DiscountControllerCore extends FrontController
|
||||
if ($discount['quantity_for_user'])
|
||||
$nbDiscounts++;
|
||||
|
||||
self::$smarty->assign(array('nbDiscounts' => (int)($nbDiscounts), 'discount' => $discounts));
|
||||
$this->smarty->assign(array('nbDiscounts' => (int)($nbDiscounts), 'discount' => $discounts));
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'discount.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'discount.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressDelivery, $dlv_adr_fields);
|
||||
|
||||
if ($order->total_discounts > 0)
|
||||
self::$smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts));
|
||||
$this->smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts));
|
||||
$products = $order->getProducts();
|
||||
$customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart));
|
||||
Product::addCustomizationPrice($products, $customizedDatas);
|
||||
|
||||
$this->processAddressFormat($addressDelivery, $addressInvoice);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'shop_name' => Configuration::get('PS_SHOP_NAME'),
|
||||
'order' => $order,
|
||||
'return_allowed' => false,
|
||||
@@ -91,8 +91,8 @@ class GuestTrackingControllerCore extends FrontController
|
||||
'invoiceAddressFormatedValues' => $invoiceAddressFormatedValues,
|
||||
'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues));
|
||||
if ($carrier->url AND $order->shipping_number)
|
||||
self::$smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
self::$smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
$this->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
$this->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
|
||||
if (Tools::isSubmit('submitTransformGuestToCustomer'))
|
||||
@@ -105,7 +105,7 @@ class GuestTrackingControllerCore extends FrontController
|
||||
if (!Tools::getValue('password'))
|
||||
$this->errors[] = Tools::displayError('Invalid password');
|
||||
else
|
||||
self::$smarty->assign('transformSuccess', true);
|
||||
$this->smarty->assign('transformSuccess', true);
|
||||
}
|
||||
}
|
||||
if (sizeof($this->errors))
|
||||
@@ -113,7 +113,7 @@ class GuestTrackingControllerCore extends FrontController
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'action' => 'guest-tracking.php',
|
||||
'errors' => $this->errors
|
||||
));
|
||||
@@ -123,15 +123,15 @@ class GuestTrackingControllerCore extends FrontController
|
||||
{
|
||||
parent::setMedia();
|
||||
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
|
||||
self::$smarty->display(_PS_THEME_DIR_.'guest-tracking.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'guest-tracking.tpl');
|
||||
}
|
||||
|
||||
private function processAddressFormat(Address $delivery, Address $invoice)
|
||||
@@ -140,8 +140,8 @@ class GuestTrackingControllerCore extends FrontController
|
||||
$inv_adr_fields = AddressFormat::getOrderedAddressFields($invoice->id_country);
|
||||
$dlv_adr_fields = AddressFormat::getOrderedAddressFields($delivery->id_country);
|
||||
|
||||
self::$smarty->assign('inv_adr_fields', $inv_adr_fields);
|
||||
self::$smarty->assign('dlv_adr_fields', $dlv_adr_fields);
|
||||
$this->smarty->assign('inv_adr_fields', $inv_adr_fields);
|
||||
$this->smarty->assign('dlv_adr_fields', $dlv_adr_fields);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ class HistoryControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
Tools::addJS(array(
|
||||
$this->addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
$this->addJS(array(
|
||||
_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js',
|
||||
_THEME_JS_DIR_.'history.js',
|
||||
_THEME_JS_DIR_.'tools.js'));
|
||||
@@ -59,7 +59,7 @@ class HistoryControllerCore extends FrontController
|
||||
if (Validate::isLoadedObject($myOrder))
|
||||
$order['virtual'] = $myOrder->isVirtual(false);
|
||||
}
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'orders' => $orders,
|
||||
'invoiceAllowed' => (int)(Configuration::get('PS_INVOICE')),
|
||||
'slowValidation' => Tools::isSubmit('slowvalidation')
|
||||
@@ -69,7 +69,7 @@ class HistoryControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'history.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'history.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ class IdentityControllerCore extends FrontController
|
||||
{
|
||||
self::$cookie->customer_lastname = $customer->lastname;
|
||||
self::$cookie->customer_firstname = $customer->firstname;
|
||||
self::$smarty->assign('confirmation', 1);
|
||||
$this->smarty->assign('confirmation', 1);
|
||||
}
|
||||
else
|
||||
$this->errors[] = Tools::displayError('Cannot update information');
|
||||
@@ -100,7 +100,7 @@ class IdentityControllerCore extends FrontController
|
||||
$birthday = array('-', '-', '-');
|
||||
|
||||
/* Generate years, months and days */
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'years' => Tools::dateYears(),
|
||||
'sl_year' => $birthday[0],
|
||||
'months' => Tools::dateMonths(),
|
||||
@@ -110,19 +110,19 @@ class IdentityControllerCore extends FrontController
|
||||
'errors' => $this->errors
|
||||
));
|
||||
|
||||
self::$smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
$this->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'identity.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'identity.css');
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'identity.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'identity.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,12 +37,12 @@ class IndexControllerCore extends FrontController
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
self::$smarty->assign('HOOK_HOME', Module::hookExec('home'));
|
||||
$this->smarty->assign('HOOK_HOME', Module::hookExec('home'));
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'index.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'index.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class ManufacturerControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -44,7 +44,7 @@ class ManufacturerControllerCore extends FrontController
|
||||
{
|
||||
$nbProducts = $this->manufacturer->getProducts($id_manufacturer, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
|
||||
$this->pagination((int)$nbProducts);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'nb_products' => $nbProducts,
|
||||
'products' => $this->manufacturer->getProducts($id_manufacturer, (int)self::$cookie->id_lang, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay),
|
||||
'path' => ($this->manufacturer->active ? Tools::safeOutput($this->manufacturer->name) : ''),
|
||||
@@ -71,7 +71,7 @@ class ManufacturerControllerCore extends FrontController
|
||||
foreach ($data AS &$item)
|
||||
$item['image'] = (!file_exists($imgDir.'/'.$item['id_manufacturer'].'-medium.jpg')) ?
|
||||
Language::getIsoById((int)(self::$cookie->id_lang)).'-default' : $item['id_manufacturer'];
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'pages_nb' => ceil($nbProducts / (int)($this->n)),
|
||||
'nbManufacturers' => $nbProducts,
|
||||
'mediumSize' => Image::getSize('medium'),
|
||||
@@ -80,7 +80,7 @@ class ManufacturerControllerCore extends FrontController
|
||||
));
|
||||
}
|
||||
else
|
||||
self::$smarty->assign('nbManufacturers', 0);
|
||||
$this->smarty->assign('nbManufacturers', 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,9 +94,9 @@ class ManufacturerControllerCore extends FrontController
|
||||
{
|
||||
parent::displayContent();
|
||||
if ($this->manufacturer)
|
||||
self::$smarty->display(_PS_THEME_DIR_.'manufacturer.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'manufacturer.tpl');
|
||||
else
|
||||
self::$smarty->display(_PS_THEME_DIR_.'manufacturer-list.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'manufacturer-list.tpl');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,24 +40,24 @@ class MyAccountControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'my-account.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'my-account.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'voucherAllowed' => (int)(Configuration::get('PS_VOUCHERS')),
|
||||
'returnAllowed' => (int)(Configuration::get('PS_ORDER_RETURN'))
|
||||
));
|
||||
self::$smarty->assign('HOOK_CUSTOMER_ACCOUNT', Module::hookExec('customerAccount'));
|
||||
$this->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Module::hookExec('customerAccount'));
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'my-account.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'my-account.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class NewProductsControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -49,7 +49,7 @@ class NewProductsControllerCore extends FrontController
|
||||
$nbProducts = (int)Product::getNewProducts((int)self::$cookie->id_lang, (isset($this->p) ? (int)($this->p) - 1 : NULL), (isset($this->n) ? (int)($this->n) : NULL), true);
|
||||
$this->pagination($nbProducts);
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'products' => Product::getNewProducts((int)(self::$cookie->id_lang), (int)($this->p) - 1, (int)($this->n), false, $this->orderBy, $this->orderWay),
|
||||
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
|
||||
'nbProducts' => (int)($nbProducts),
|
||||
@@ -60,7 +60,7 @@ class NewProductsControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'new-products.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'new-products.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'is_guest' => self::$cookie->is_guest,
|
||||
'HOOK_ORDER_CONFIRMATION' => Hook::orderConfirmation((int)($this->id_order)),
|
||||
'HOOK_PAYMENT_RETURN' => Hook::paymentReturn((int)($this->id_order), (int)($this->id_module))
|
||||
@@ -76,7 +76,7 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
|
||||
if (self::$cookie->is_guest)
|
||||
{
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'id_order' => $this->id_order,
|
||||
'id_order_formatted' => sprintf('#%06d', $this->id_order)
|
||||
));
|
||||
@@ -88,7 +88,7 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
Tools::redirect('index.php?controller=authentication&back='.urlencode('order.php&step='.$this->step));
|
||||
|
||||
if ($this->nbProducts)
|
||||
self::$smarty->assign('virtual_cart', $isVirtualCart);
|
||||
$this->smarty->assign('virtual_cart', $isVirtualCart);
|
||||
}
|
||||
|
||||
public function displayHeader()
|
||||
@@ -86,7 +86,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
switch ((int)$this->step)
|
||||
{
|
||||
case -1;
|
||||
self::$smarty->assign('empty', 1);
|
||||
$this->smarty->assign('empty', 1);
|
||||
break;
|
||||
case 1:
|
||||
$this->_assignAddress();
|
||||
@@ -134,7 +134,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
$invoiceAddressFields = AddressFormat::getOrderedAddressFields($addressInvoice->id_country);
|
||||
$deliveryAddressFields = AddressFormat::getOrderedAddressFields($addressDelivery->id_country);
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'inv_adr_fields' => $invoiceAddressFields,
|
||||
'dlv_adr_fields' => $deliveryAddressFields));
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
|
||||
parent::displayContent();
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'currencySign' => $currency->sign,
|
||||
'currencyRate' => $currency->conversion_rate,
|
||||
'currencyFormat' => $currency->format,
|
||||
@@ -155,20 +155,20 @@ class OrderControllerCore extends ParentOrderController
|
||||
switch ((int)$this->step)
|
||||
{
|
||||
case -1:
|
||||
self::$smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl');
|
||||
break;
|
||||
case 1:
|
||||
$this->processAddressFormat();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-address.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-address.tpl');
|
||||
break;
|
||||
case 2:
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-carrier.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-carrier.tpl');
|
||||
break;
|
||||
case 3:
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-payment.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-payment.tpl');
|
||||
break;
|
||||
default:
|
||||
self::$smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'shopping-cart.tpl');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
|
||||
if (sizeof($this->errors))
|
||||
{
|
||||
self::$smarty->assign('errors', $this->errors);
|
||||
$this->smarty->assign('errors', $this->errors);
|
||||
$this->_assignCarrier();
|
||||
$this->step = 2;
|
||||
$this->displayContent();
|
||||
@@ -252,7 +252,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
{
|
||||
parent::_assignAddress();
|
||||
|
||||
self::$smarty->assign('cart', self::$cart);
|
||||
$this->smarty->assign('cart', self::$cart);
|
||||
if (self::$cookie->is_guest)
|
||||
Tools::redirect('index.php?controller=order&step=2');
|
||||
}
|
||||
@@ -260,8 +260,6 @@ class OrderControllerCore extends ParentOrderController
|
||||
/* Carrier step */
|
||||
protected function _assignCarrier()
|
||||
{
|
||||
global $defaultCountry;
|
||||
|
||||
if (isset(self::$cookie->id_customer))
|
||||
$customer = new Customer((int)(self::$cookie->id_customer));
|
||||
else
|
||||
@@ -271,7 +269,7 @@ class OrderControllerCore extends ParentOrderController
|
||||
// Assign wrapping and TOS
|
||||
$this->_assignWrappingAndTOS();
|
||||
|
||||
self::$smarty->assign('is_guest' ,(isset(self::$cookie->is_guest) ? self::$cookie->is_guest : 0));
|
||||
$this->smarty->assign('is_guest' ,(isset(self::$cookie->is_guest) ? self::$cookie->is_guest : 0));
|
||||
}
|
||||
|
||||
/* Payment step */
|
||||
@@ -283,8 +281,8 @@ class OrderControllerCore extends ParentOrderController
|
||||
Hook::backBeforePayment('order.php?step=3');
|
||||
|
||||
/* We may need to display an order summary */
|
||||
self::$smarty->assign(self::$cart->getSummaryDetails());
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(self::$cart->getSummaryDetails());
|
||||
$this->smarty->assign(array(
|
||||
'total_price' => (float)($orderTotal),
|
||||
'taxes_enabled' => (int)(Configuration::get('PS_TAX'))
|
||||
));
|
||||
|
||||
@@ -114,7 +114,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
$deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($addressDelivery, $dlv_adr_fields);
|
||||
|
||||
if ($order->total_discounts > 0)
|
||||
self::$smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts));
|
||||
$this->smarty->assign('total_old', (float)($order->total_paid - $order->total_discounts));
|
||||
$products = $order->getProducts();
|
||||
|
||||
$customizedDatas = Product::getAllCustomizedDatas((int)($order->id_cart));
|
||||
@@ -122,7 +122,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
|
||||
$customer = new Customer($order->id_customer);
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'shop_name' => strval(Configuration::get('PS_SHOP_NAME')),
|
||||
'order' => $order,
|
||||
'return_allowed' => (int)($order->isReturnable()),
|
||||
@@ -150,8 +150,8 @@ class OrderDetailControllerCore extends FrontController
|
||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||
'customizedDatas' => $customizedDatas));
|
||||
if ($carrier->url AND $order->shipping_number)
|
||||
self::$smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
self::$smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
$this->smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url));
|
||||
$this->smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order)));
|
||||
Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order));
|
||||
|
||||
unset($carrier);
|
||||
@@ -173,7 +173,7 @@ class OrderDetailControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-detail.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-detail.tpl');
|
||||
}
|
||||
|
||||
public function displayFooter()
|
||||
|
||||
@@ -76,31 +76,31 @@ class OrderFollowControllerCore extends FrontController
|
||||
|
||||
$ordersReturn = OrderReturn::getOrdersReturn((int)(self::$cookie->id_customer));
|
||||
if (Tools::isSubmit('errorQuantity'))
|
||||
self::$smarty->assign('errorQuantity', true);
|
||||
$this->smarty->assign('errorQuantity', true);
|
||||
elseif (Tools::isSubmit('errorMsg'))
|
||||
self::$smarty->assign('errorMsg', true);
|
||||
$this->smarty->assign('errorMsg', true);
|
||||
elseif (Tools::isSubmit('errorDetail1'))
|
||||
self::$smarty->assign('errorDetail1', true);
|
||||
$this->smarty->assign('errorDetail1', true);
|
||||
elseif (Tools::isSubmit('errorDetail2'))
|
||||
self::$smarty->assign('errorDetail2', true);
|
||||
$this->smarty->assign('errorDetail2', true);
|
||||
elseif (Tools::isSubmit('errorNotReturnable'))
|
||||
self::$smarty->assign('errorNotReturnable',true);
|
||||
$this->smarty->assign('errorNotReturnable',true);
|
||||
|
||||
self::$smarty->assign('ordersReturn', $ordersReturn);
|
||||
$this->smarty->assign('ordersReturn', $ordersReturn);
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js', _THEME_JS_DIR_.'history.js'));
|
||||
$this->addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
$this->addJS(array(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js', _THEME_JS_DIR_.'history.js'));
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-follow.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-follow.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
{
|
||||
parent::preProcess();
|
||||
if ($this->nbProducts)
|
||||
self::$smarty->assign('virtual_cart', false);
|
||||
$this->smarty->assign('virtual_cart', false);
|
||||
$this->isLogged = (bool)((int)(self::$cookie->id_customer) AND Customer::customerIdExistsStatic((int)(self::$cookie->id_customer)));
|
||||
|
||||
if (self::$cart->nbProducts())
|
||||
@@ -122,7 +122,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
include_once(_PS_MODULE_DIR_.'blockuserinfo/blockuserinfo.php');
|
||||
$blockUserInfo = new BlockUserInfo();
|
||||
}
|
||||
self::$smarty->assign('isVirtualCart', self::$cart->isVirtualCart());
|
||||
$this->smarty->assign('isVirtualCart', self::$cart->isVirtualCart());
|
||||
$this->_processAddressFormat();
|
||||
$this->_assignAddress();
|
||||
// Wrapping fees
|
||||
@@ -131,7 +131,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$wrapping_fees_tax_inc = $wrapping_fees * (1 + (((float)($wrapping_fees_tax->rate) / 100)));
|
||||
$return = array(
|
||||
'summary' => self::$cart->getSummaryDetails(),
|
||||
'order_opc_adress' => self::$smarty->fetch(_PS_THEME_DIR_.'order-address.tpl'),
|
||||
'order_opc_adress' => $this->smarty->fetch(_PS_THEME_DIR_.'order-address.tpl'),
|
||||
'block_user_info' => (isset($blockUserInfo) ? $blockUserInfo->hookTop(array()) : ''),
|
||||
'carrier_list' => $this->_getCarrierList(),
|
||||
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
|
||||
@@ -218,11 +218,11 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
parent::setMedia();
|
||||
|
||||
// Adding CSS style sheet
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'order-opc.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'order-opc.css');
|
||||
// Adding JS files
|
||||
Tools::addJS(_THEME_JS_DIR_.'order-opc.js');
|
||||
Tools::addJs(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js');
|
||||
Tools::addJS(_THEME_JS_DIR_.'tools/statesManagement.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'order-opc.js');
|
||||
$this->addJS(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'tools/statesManagement.js');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -234,7 +234,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
$selectedCountry = (int)(Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
$countries = Country::getCountries((int)(self::$cookie->id_lang), true);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'isLogged' => $this->isLogged,
|
||||
'isGuest' => isset(self::$cookie->is_guest) ? self::$cookie->is_guest : 0,
|
||||
'countries' => $countries,
|
||||
@@ -247,7 +247,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$years = Tools::dateYears();
|
||||
$months = Tools::dateMonths();
|
||||
$days = Tools::dateDays();
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'years' => $years,
|
||||
'months' => $months,
|
||||
'days' => $days,
|
||||
@@ -255,7 +255,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
/* Load guest informations */
|
||||
if ($this->isLogged AND self::$cookie->is_guest)
|
||||
self::$smarty->assign('guestInformations', $this->_getGuestInformations());
|
||||
$this->smarty->assign('guestInformations', $this->_getGuestInformations());
|
||||
|
||||
if ($this->isLogged)
|
||||
$this->_assignAddress(); // ADDRESS
|
||||
@@ -265,7 +265,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$this->_assignPayment();
|
||||
Tools::safePostVars();
|
||||
|
||||
self::$smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
$this->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
}
|
||||
|
||||
public function displayHeader()
|
||||
@@ -279,7 +279,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
parent::displayContent();
|
||||
|
||||
$this->_processAddressFormat();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-opc.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-opc.tpl');
|
||||
}
|
||||
|
||||
public function displayFooter()
|
||||
@@ -330,7 +330,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
if (!$this->isLogged)
|
||||
{
|
||||
$carriers = Carrier::getCarriersForOrder(Country::getIdZone((int)Configuration::get('PS_COUNTRY_DEFAULT')));
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'checked' => $this->_setDefaultCarrierSelection($carriers),
|
||||
'carriers' => $carriers,
|
||||
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')),
|
||||
@@ -344,7 +344,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
protected function _assignPayment()
|
||||
{
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'HOOK_TOP_PAYMENT' => ($this->isLogged ? Module::hookExec('paymentTop') : ''),
|
||||
'HOOK_PAYMENT' => $this->_getPaymentMethods()
|
||||
));
|
||||
@@ -448,8 +448,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
foreach(explode(' ',$fields_line) as $field_item)
|
||||
${$adr_type.'_all_fields'}[] = trim($field_item);
|
||||
|
||||
self::$smarty->assign($adr_type.'_adr_fields', ${$adr_type.'_adr_fields'});
|
||||
self::$smarty->assign($adr_type.'_all_fields', ${$adr_type.'_all_fields'});
|
||||
$this->smarty->assign($adr_type.'_adr_fields', ${$adr_type.'_adr_fields'});
|
||||
$this->smarty->assign($adr_type.'_all_fields', ${$adr_type.'_all_fields'});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ class OrderReturnControllerCore extends FrontController
|
||||
if (Validate::isLoadedObject($order))
|
||||
{
|
||||
$state = new OrderReturnState((int)($orderRet->state));
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'orderRet' => $orderRet,
|
||||
'order' => $order,
|
||||
'state_name' => $state->name[(int)(self::$cookie->id_lang)],
|
||||
@@ -72,7 +72,7 @@ class OrderReturnControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('Cannot find this order return');
|
||||
}
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'errors' => $this->errors,
|
||||
'nbdaysreturn' => (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS'))
|
||||
));
|
||||
@@ -87,7 +87,7 @@ class OrderReturnControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-return.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-return.tpl');
|
||||
}
|
||||
|
||||
public function displayFooter()
|
||||
|
||||
@@ -40,21 +40,21 @@ class OrderSlipControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js',_THEME_JS_DIR_.'history.js'));
|
||||
$this->addCSS(_THEME_CSS_DIR_.'history.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
$this->addJS(array(_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js',_THEME_JS_DIR_.'history.js'));
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
self::$smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)(self::$cookie->id_customer)));
|
||||
$this->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)(self::$cookie->id_customer)));
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'order-slip.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'order-slip.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class PageNotFoundControllerCore extends FrontController
|
||||
{
|
||||
public function displayContent()
|
||||
{
|
||||
self::$smarty->display(_PS_THEME_DIR_.'404.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'404.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
Tools::redirect('index.php?controller=order-opc');
|
||||
}
|
||||
}
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'errors' => $this->errors,
|
||||
'discount_name' => Tools::safeOutput($discountName)
|
||||
));
|
||||
@@ -124,7 +124,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
$this->_setNoCarrier();
|
||||
}
|
||||
|
||||
self::$smarty->assign('back', Tools::safeOutput(Tools::getValue('back')));
|
||||
$this->smarty->assign('back', Tools::safeOutput(Tools::getValue('back')));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
@@ -132,18 +132,18 @@ class ParentOrderControllerCore extends FrontController
|
||||
parent::setMedia();
|
||||
|
||||
// Adding CSS style sheet
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
|
||||
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
|
||||
|
||||
// Adding JS files
|
||||
Tools::addJS(_THEME_JS_DIR_.'tools.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'tools.js');
|
||||
if ((Configuration::get('PS_ORDER_PROCESS_TYPE') == 0 AND Tools::getValue('step') == 1) OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1)
|
||||
Tools::addJS(_THEME_JS_DIR_.'order-address.js');
|
||||
Tools::addJS(_PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'order-address.js');
|
||||
$this->addJS(_PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js');
|
||||
if ((int)(Configuration::get('PS_BLOCK_CART_AJAX')) OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1)
|
||||
{
|
||||
Tools::addJS(_THEME_JS_DIR_.'cart-summary.js');
|
||||
Tools::addJS(_PS_JS_DIR_.'jquery/jquery-typewatch.pack.js');
|
||||
$this->addJS(_THEME_JS_DIR_.'cart-summary.js');
|
||||
$this->addJS(_PS_JS_DIR_.'jquery/jquery-typewatch.pack.js');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -231,7 +231,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
global $currency;
|
||||
|
||||
if (file_exists(_PS_SHIP_IMG_DIR_.(int)(self::$cart->id_carrier).'.jpg'))
|
||||
self::$smarty->assign('carrierPicture', 1);
|
||||
$this->smarty->assign('carrierPicture', 1);
|
||||
$summary = self::$cart->getSummaryDetails();
|
||||
$customizedDatas = Product::getAllCustomizedDatas((int)(self::$cart->id));
|
||||
|
||||
@@ -257,14 +257,14 @@ class ParentOrderControllerCore extends FrontController
|
||||
$total_free_ship = 0;
|
||||
break;
|
||||
}
|
||||
self::$smarty->assign('free_ship', $total_free_ship);
|
||||
$this->smarty->assign('free_ship', $total_free_ship);
|
||||
}
|
||||
// for compatibility with 1.2 themes
|
||||
foreach($summary['products'] AS $key => $product)
|
||||
$summary['products'][$key]['quantity'] = $product['cart_quantity'];
|
||||
|
||||
self::$smarty->assign($summary);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign($summary);
|
||||
$this->smarty->assign(array(
|
||||
'token_cart' => Tools::getToken(false),
|
||||
'isVirtualCart' => self::$cart->isVirtualCart(),
|
||||
'productNumber' => self::$cart->nbProducts(),
|
||||
@@ -280,7 +280,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
'currencyRate' => $currency->conversion_rate,
|
||||
'currencyFormat' => $currency->format,
|
||||
'currencyBlank' => $currency->blank));
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'HOOK_SHOPPING_CART' => Module::hookExec('shoppingCart', $summary),
|
||||
'HOOK_SHOPPING_CART_EXTRA' => Module::hookExec('shoppingCartExtra', $summary)
|
||||
));
|
||||
@@ -315,7 +315,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
|
||||
unset($tmpAddress);
|
||||
}
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'addresses' => $customerAddresses,
|
||||
'formatedAddressFieldsValuesList' => $formatedAddressFieldsValuesList));
|
||||
|
||||
@@ -339,7 +339,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
{
|
||||
$deliveryAddress = new Address((int)(self::$cart->id_address_delivery));
|
||||
if (Validate::isLoadedObject($deliveryAddress) AND ($deliveryAddress->id_customer == $customer->id))
|
||||
self::$smarty->assign('delivery', $deliveryAddress);
|
||||
$this->smarty->assign('delivery', $deliveryAddress);
|
||||
}
|
||||
|
||||
/* If invoice address is valid in cart, assign it to Smarty */
|
||||
@@ -347,11 +347,11 @@ class ParentOrderControllerCore extends FrontController
|
||||
{
|
||||
$invoiceAddress = new Address((int)(self::$cart->id_address_invoice));
|
||||
if (Validate::isLoadedObject($invoiceAddress) AND ($invoiceAddress->id_customer == $customer->id))
|
||||
self::$smarty->assign('invoice', $invoiceAddress);
|
||||
$this->smarty->assign('invoice', $invoiceAddress);
|
||||
}
|
||||
}
|
||||
if ($oldMessage = Message::getMessageByCartId((int)(self::$cart->id)))
|
||||
self::$smarty->assign('oldMessage', $oldMessage['message']);
|
||||
$this->smarty->assign('oldMessage', $oldMessage['message']);
|
||||
}
|
||||
|
||||
protected function _assignCarrier()
|
||||
@@ -361,7 +361,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
$id_zone = Address::getZoneById((int)($address->id));
|
||||
$carriers = Carrier::getCarriersForOrder($id_zone, $customer->getGroups());
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'checked' => $this->_setDefaultCarrierSelection($carriers),
|
||||
'carriers' => $carriers,
|
||||
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT')),
|
||||
@@ -385,7 +385,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
else
|
||||
$this->link_conditions .= '&content_only=1';
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'checkedTOS' => (int)(self::$cookie->checkedTOS),
|
||||
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
|
||||
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
|
||||
@@ -400,7 +400,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
|
||||
protected function _assignPayment()
|
||||
{
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'HOOK_TOP_PAYMENT' => Module::hookExec('paymentTop'),
|
||||
'HOOK_PAYMENT' => Module::hookExecPayment()
|
||||
));
|
||||
|
||||
@@ -63,7 +63,7 @@ class PasswordControllerCore extends FrontController
|
||||
'{url}' => self::$link->getPageLink('password', true, NULL, 'token='.$customer->secure_key.'&id_customer='.(int)$customer->id)),
|
||||
$customer->email,
|
||||
$customer->firstname.' '.$customer->lastname))
|
||||
self::$smarty->assign(array('confirmation' => 2, 'email' => $customer->email));
|
||||
$this->smarty->assign(array('confirmation' => 2, 'email' => $customer->email));
|
||||
else
|
||||
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class PasswordControllerCore extends FrontController
|
||||
'{passwd}' => $password),
|
||||
$customer->email,
|
||||
$customer->firstname.' '.$customer->lastname))
|
||||
self::$smarty->assign(array('confirmation' => 1, 'email' => $customer->email));
|
||||
$this->smarty->assign(array('confirmation' => 1, 'email' => $customer->email));
|
||||
else
|
||||
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class PasswordControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'password.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'password.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class PricesDropControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -48,7 +48,7 @@ class PricesDropControllerCore extends FrontController
|
||||
$nbProducts = Product::getPricesDrop((int)self::$cookie->id_lang, NULL, NULL, true);
|
||||
$this->pagination($nbProducts);
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'products' => Product::getPricesDrop((int)self::$cookie->id_lang, (int)$this->p - 1, (int)$this->n, false, $this->orderBy, $this->orderWay, false, false, (int)$this->id_current_shop),
|
||||
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
|
||||
'nbProducts' => $nbProducts,
|
||||
@@ -59,7 +59,7 @@ class PricesDropControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'prices-drop.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'prices-drop.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ class ProductControllerCore extends FrontController
|
||||
{
|
||||
parent::setMedia();
|
||||
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product.css');
|
||||
Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
|
||||
Tools::addJS(array(
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product.css');
|
||||
$this->addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen');
|
||||
$this->addJS(array(
|
||||
_PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js',
|
||||
_PS_JS_DIR_.'jquery/jquery.idTabs.modified.js',
|
||||
_PS_JS_DIR_.'jquery/jquery.scrollTo-1.4.2-min.js',
|
||||
@@ -45,13 +45,14 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
if (Configuration::get('PS_DISPLAY_JQZOOM') == 1)
|
||||
{
|
||||
Tools::addCSS(_PS_CSS_DIR_.'jqzoom.css', 'screen');
|
||||
Tools::addJS(_PS_JS_DIR_.'jquery/jquery.jqzoom.js');
|
||||
$this->addCSS(_PS_CSS_DIR_.'jqzoom.css', 'screen');
|
||||
$this->addJS(_PS_JS_DIR_.'jquery/jquery.jqzoom.js');
|
||||
}
|
||||
}
|
||||
|
||||
public function preProcess()
|
||||
{
|
||||
$context = Context::getContext();
|
||||
if ($id_product = (int)Tools::getValue('id_product'))
|
||||
$this->product = new Product($id_product, true, self::$cookie->id_lang, (int)$this->id_current_shop);
|
||||
|
||||
@@ -66,7 +67,7 @@ class ProductControllerCore extends FrontController
|
||||
// $_SERVER['HTTP_HOST'] must be replaced by the real canonical domain
|
||||
if (Validate::isLoadedObject($this->product))
|
||||
{
|
||||
$canonicalURL = self::$link->getProductLink($this->product);
|
||||
$canonicalURL = $context->link->getProductLink($this->product);
|
||||
if (!preg_match('/^'.Tools::pRegexp($canonicalURL, '/').'([&?].*)?$/i', Tools::getProtocol().$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']))
|
||||
{
|
||||
header('HTTP/1.0 301 Moved');
|
||||
@@ -86,16 +87,16 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
$default_rewrite = array();
|
||||
foreach ($rewrite_infos AS $infos)
|
||||
$default_rewrite[$infos['id_lang']] = self::$link->getProductLink((int)$id_product, $infos['link_rewrite'], $infos['category_rewrite'], $infos['ean13'], (int)$infos['id_lang']);
|
||||
$default_rewrite[$infos['id_lang']] = $context->link->getProductLink((int)$id_product, $infos['link_rewrite'], $infos['category_rewrite'], $infos['ean13'], (int)$infos['id_lang']);
|
||||
|
||||
self::$smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
$this->smarty->assign('lang_rewrite_urls', $default_rewrite);
|
||||
}
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
global $cart, $currency;;
|
||||
parent::process();
|
||||
$context = Context::getContext();
|
||||
|
||||
if (!$id_product = (int)(Tools::getValue('id_product')) OR !Validate::isUnsignedId($id_product))
|
||||
$this->errors[] = Tools::displayError('Product not found');
|
||||
@@ -108,36 +109,36 @@ class ProductControllerCore extends FrontController
|
||||
header('HTTP/1.1 404 page not found');
|
||||
$this->errors[] = Tools::displayError('Pproduct is no longer available.');
|
||||
}
|
||||
elseif (!$this->product->checkAccess((int)(self::$cookie->id_customer)))
|
||||
elseif (!$this->product->checkAccess(isset($context->customer) ? $context->customer->id : 0))
|
||||
$this->errors[] = Tools::displayError('You do not have access to this product.');
|
||||
else
|
||||
{
|
||||
self::$smarty->assign('virtual', ProductDownload::getIdFromIdProduct((int)($this->product->id)));
|
||||
$this->smarty->assign('virtual', ProductDownload::getIdFromIdProduct((int)($this->product->id)));
|
||||
|
||||
if (!$this->product->active)
|
||||
self::$smarty->assign('adminActionDisplay', true);
|
||||
$this->smarty->assign('adminActionDisplay', true);
|
||||
|
||||
/* rewrited url set */
|
||||
$rewrited_url = self::$link->getProductLink($this->product->id, $this->product->link_rewrite);
|
||||
$rewrited_url = $context->link->getProductLink($this->product->id, $this->product->link_rewrite);
|
||||
|
||||
/* Product pictures management */
|
||||
require_once('images.inc.php');
|
||||
self::$smarty->assign('customizationFormTarget', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
|
||||
$this->smarty->assign('customizationFormTarget', Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
|
||||
|
||||
if (Tools::isSubmit('submitCustomizedDatas'))
|
||||
{
|
||||
$this->pictureUpload($this->product, $cart);
|
||||
$this->textRecord($this->product, $cart);
|
||||
$this->pictureUpload($this->product, $context->cart);
|
||||
$this->textRecord($this->product, $context->cart);
|
||||
$this->formTargetFormat();
|
||||
}
|
||||
elseif (isset($_GET['deletePicture']) AND !$cart->deletePictureToProduct((int)($this->product->id), (int)(Tools::getValue('deletePicture'))))
|
||||
elseif (isset($_GET['deletePicture']) AND !$context->cart->deletePictureToProduct((int)($this->product->id), (int)(Tools::getValue('deletePicture'))))
|
||||
$this->errors[] = Tools::displayError('An error occurred while deleting the selected picture');
|
||||
|
||||
$files = self::$cookie->getFamily('pictures_'.(int)($this->product->id));
|
||||
$textFields = self::$cookie->getFamily('textFields_'.(int)($this->product->id));
|
||||
foreach ($textFields as $key => $textField)
|
||||
$textFields[$key] = str_replace('<br />', "\n", $textField);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'pictures' => $files,
|
||||
'textFields' => $textFields));
|
||||
|
||||
@@ -172,7 +173,7 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
if (isset($category) AND Validate::isLoadedObject($category))
|
||||
{
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'path' => Tools::getPath((int)$category->id, $this->product->name, true),
|
||||
'category' => $category,
|
||||
'subCategories' => $category->getSubCategories((int)(self::$cookie->id_lang), true),
|
||||
@@ -181,29 +182,29 @@ class ProductControllerCore extends FrontController
|
||||
'return_category_name' => Tools::safeOutput($category->name)));
|
||||
}
|
||||
else
|
||||
self::$smarty->assign('path', Tools::getPath((int)$this->product->id_category_default, $this->product->name));
|
||||
$this->smarty->assign('path', Tools::getPath((int)$this->product->id_category_default, $this->product->name));
|
||||
|
||||
self::$smarty->assign('return_link', (isset($category->id) AND $category->id) ? Tools::safeOutput(self::$link->getCategoryLink($category)) : 'javascript: history.back();');
|
||||
$this->smarty->assign('return_link', (isset($category->id) AND $category->id) ? Tools::safeOutput($context->link->getCategoryLink($category)) : 'javascript: history.back();');
|
||||
|
||||
$lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
if (Pack::isPack((int)($this->product->id), (int)($lang)) AND !Pack::isInStock((int)($this->product->id), (int)($lang)))
|
||||
$this->product->quantity = 0;
|
||||
|
||||
$group_reduction = (100 - Group::getReduction((int)(self::$cookie->id_customer))) / 100;
|
||||
$id_customer = (isset(self::$cookie->id_customer) AND self::$cookie->id_customer) ? (int)(self::$cookie->id_customer) : 0;
|
||||
$id_group = $id_customer ? (int)(Customer::getDefaultGroupId($id_customer)) : _PS_DEFAULT_CUSTOMER_GROUP_;
|
||||
$id_customer = (isset($context->customer) ? (int)($context->customer->id) : 0);
|
||||
$group_reduction = (100 - Group::getReduction($id_customer)) / 100;
|
||||
$id_group = (isset($context->customer) ? $context->customer->id_default_group : _PS_DEFAULT_CUSTOMER_GROUP_);
|
||||
$id_country = (int)($id_customer ? Customer::getCurrentCountry($id_customer) : Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
|
||||
// Tax
|
||||
$tax = (float)(Tax::getProductTaxRate((int)($this->product->id), $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
||||
self::$smarty->assign('tax_rate', $tax);
|
||||
$tax = (float)(Tax::getProductTaxRate((int)($this->product->id), $context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
|
||||
$this->smarty->assign('tax_rate', $tax);
|
||||
|
||||
$ecotax_rate = (float) Tax::getProductEcotaxRate($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
|
||||
$ecotax_rate = (float) Tax::getProductEcotaxRate($context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
|
||||
$ecotaxTaxAmount = Tools::ps_round($this->product->ecotax, 2);
|
||||
if (Product::$_taxCalculationMethod == PS_TAX_INC && (int)Configuration::get('PS_TAX'))
|
||||
$ecotaxTaxAmount = Tools::ps_round($ecotaxTaxAmount * (1 + $ecotax_rate / 100), 2);
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'quantity_discounts' => $this->formatQuantityDiscounts(SpecificPrice::getQuantityDiscounts((int)($this->product->id), (int)(Shop::getCurrentShop()), (int)(self::$cookie->id_currency), $id_country, $id_group), $this->product->getPrice(Product::$_taxCalculationMethod == PS_TAX_INC, false), (float)($tax)),
|
||||
'product' => $this->product,
|
||||
'ecotax_tax_inc' => $ecotaxTaxAmount,
|
||||
@@ -220,7 +221,7 @@ class ProductControllerCore extends FrontController
|
||||
'group_reduction' => $group_reduction,
|
||||
'col_img_dir' => _PS_COL_IMG_DIR_,
|
||||
));
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'HOOK_EXTRA_LEFT' => Module::hookExec('extraLeft'),
|
||||
'HOOK_EXTRA_RIGHT' => Module::hookExec('extraRight'),
|
||||
'HOOK_PRODUCT_OOS' => Hook::productOutOfStock($this->product),
|
||||
@@ -236,7 +237,7 @@ class ProductControllerCore extends FrontController
|
||||
{
|
||||
if ($image['cover'])
|
||||
{
|
||||
self::$smarty->assign('mainImage', $images[0]);
|
||||
$this->smarty->assign('mainImage', $images[0]);
|
||||
$cover = $image;
|
||||
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$image['id_image']) : $image['id_image']);
|
||||
$cover['id_image_only'] = (int)($image['id_image']);
|
||||
@@ -244,16 +245,16 @@ class ProductControllerCore extends FrontController
|
||||
$productImages[(int)($image['id_image'])] = $image;
|
||||
}
|
||||
if (!isset($cover))
|
||||
$cover = array('id_image' => Language::getIsoById(self::$cookie->id_lang).'-default', 'legend' => 'No picture', 'title' => 'No picture');
|
||||
$cover = array('id_image' => $context->language->iso_code.'-default', 'legend' => 'No picture', 'title' => 'No picture');
|
||||
$size = Image::getSize('large');
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'cover' => $cover,
|
||||
'imgWidth' => (int)($size['width']),
|
||||
'mediumSize' => Image::getSize('medium'),
|
||||
'largeSize' => Image::getSize('large'),
|
||||
'accessories' => $this->product->getAccessories((int)(self::$cookie->id_lang))));
|
||||
if (sizeof($productImages))
|
||||
self::$smarty->assign('images', $productImages);
|
||||
$this->smarty->assign('images', $productImages);
|
||||
|
||||
/* Attributes / Groups & colors */
|
||||
$colors = array();
|
||||
@@ -327,7 +328,7 @@ class ProductControllerCore extends FrontController
|
||||
$combinations[$id_product_attribute]['list'] = $attributeList;
|
||||
}
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'groups' => $groups,
|
||||
'combinaisons' => $combinations, /* Kept for compatibility purpose only */
|
||||
'combinations' => $combinations,
|
||||
@@ -335,18 +336,18 @@ class ProductControllerCore extends FrontController
|
||||
'combinationImages' => $combinationImages));
|
||||
}
|
||||
|
||||
self::$smarty->assign(array(
|
||||
'no_tax' => Tax::excludeTaxeOption() OR !Tax::getProductTaxRate((int)$this->product->id, $cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}),
|
||||
$this->smarty->assign(array(
|
||||
'no_tax' => Tax::excludeTaxeOption() OR !Tax::getProductTaxRate((int)$this->product->id, $context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}),
|
||||
'customizationFields' => $this->product->getCustomizationFields((int)(self::$cookie->id_lang))
|
||||
));
|
||||
|
||||
// Pack management
|
||||
self::$smarty->assign('packItems', $this->product->cache_is_pack ? Pack::getItemTable($this->product->id, (int)(self::$cookie->id_lang), true) : array());
|
||||
self::$smarty->assign('packs', Pack::getPacksTable($this->product->id, (int)(self::$cookie->id_lang), true, 1));
|
||||
$this->smarty->assign('packItems', $this->product->cache_is_pack ? Pack::getItemTable($this->product->id, (int)(self::$cookie->id_lang), true) : array());
|
||||
$this->smarty->assign('packs', Pack::getPacksTable($this->product->id, (int)(self::$cookie->id_lang), true, 1));
|
||||
}
|
||||
}
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'ENT_NOQUOTES' => ENT_NOQUOTES,
|
||||
'outOfStockAllowed' => (int)(Configuration::get('PS_ORDER_OUT_OF_STOCK')),
|
||||
'errors' => $this->errors,
|
||||
@@ -356,10 +357,10 @@ class ProductControllerCore extends FrontController
|
||||
'display_qties' => (int)(Configuration::get('PS_DISPLAY_QTIES')),
|
||||
'display_ht' => !Tax::excludeTaxeOption(),
|
||||
'ecotax' => (!sizeof($this->errors) AND $this->product->ecotax > 0 ? Tools::convertPrice((float)($this->product->ecotax)) : 0),
|
||||
'currencySign' => $currency->sign,
|
||||
'currencyRate' => $currency->conversion_rate,
|
||||
'currencyFormat' => $currency->format,
|
||||
'currencyBlank' => $currency->blank,
|
||||
'currencySign' => $context->currency->sign,
|
||||
'currencyRate' => $context->currency->conversion_rate,
|
||||
'currencyFormat' => $context->currency->format,
|
||||
'currencyBlank' => $context->currency->blank,
|
||||
'jqZoomEnabled' => Configuration::get('PS_DISPLAY_JQZOOM')
|
||||
));
|
||||
}
|
||||
@@ -367,7 +368,7 @@ class ProductControllerCore extends FrontController
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'product.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'product.tpl');
|
||||
}
|
||||
|
||||
public function pictureUpload(Product $product, Cart $cart)
|
||||
@@ -431,8 +432,8 @@ class ProductControllerCore extends FrontController
|
||||
if (strncmp($field, 'group_', 6) == 0)
|
||||
$customizationFormTarget = preg_replace('/&group_([[:digit:]]+)=([[:digit:]]+)/', '', $customizationFormTarget);
|
||||
if (isset($_POST['quantityBackup']))
|
||||
self::$smarty->assign('quantityBackup', (int)($_POST['quantityBackup']));
|
||||
self::$smarty->assign('customizationFormTarget', $customizationFormTarget);
|
||||
$this->smarty->assign('quantityBackup', (int)($_POST['quantityBackup']));
|
||||
$this->smarty->assign('customizationFormTarget', $customizationFormTarget);
|
||||
}
|
||||
|
||||
public function formatQuantityDiscounts($specificPrices, $price, $taxRate)
|
||||
|
||||
@@ -43,11 +43,10 @@ class SearchControllerCore extends FrontController
|
||||
public function preProcess()
|
||||
{
|
||||
parent::preProcess();
|
||||
|
||||
|
||||
$query = urldecode(Tools::getValue('q'));
|
||||
if ($this->ajaxSearch)
|
||||
{
|
||||
self::$link = new Link();
|
||||
$searchResults = Search::find((int)(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true, true, (int)$this->id_current_shop);
|
||||
foreach ($searchResults AS &$product)
|
||||
$product['product_link'] = self::$link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']);
|
||||
@@ -63,7 +62,7 @@ class SearchControllerCore extends FrontController
|
||||
Module::hookExec('search', array('expr' => $query, 'total' => $search['total']));
|
||||
$nbProducts = $search['total'];
|
||||
$this->pagination($nbProducts);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
|
||||
'search_products' => $search['result'],
|
||||
'nbProducts' => $search['total'],
|
||||
@@ -80,7 +79,7 @@ class SearchControllerCore extends FrontController
|
||||
Module::hookExec('search', array('expr' => $query, 'total' => $search['total']));
|
||||
$nbProducts = $search['total'];
|
||||
$this->pagination($nbProducts);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'products' => $search['result'], // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
|
||||
'search_products' => $search['result'],
|
||||
'nbProducts' => $search['total'],
|
||||
@@ -93,7 +92,7 @@ class SearchControllerCore extends FrontController
|
||||
$this->pagination($nbProducts);
|
||||
$result = Search::searchTag((int)(self::$cookie->id_lang), $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay, false, true, (int)$this->id_current_shop);
|
||||
Module::hookExec('search', array('expr' => $tag, 'total' => sizeof($result)));
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'search_tag' => $tag,
|
||||
'products' => $result, // DEPRECATED (since to 1.4), not use this: conflict with block_cart module
|
||||
'search_products' => $result,
|
||||
@@ -102,13 +101,13 @@ class SearchControllerCore extends FrontController
|
||||
}
|
||||
else
|
||||
{
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'products' => array(),
|
||||
'search_products' => array(),
|
||||
'pages_nb' => 1,
|
||||
'nbProducts' => 0));
|
||||
}
|
||||
self::$smarty->assign('add_prod_display', Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'));
|
||||
$this->smarty->assign('add_prod_display', Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'));
|
||||
}
|
||||
|
||||
public function displayHeader()
|
||||
@@ -116,13 +115,13 @@ class SearchControllerCore extends FrontController
|
||||
if (!$this->instantSearch AND !$this->ajaxSearch)
|
||||
parent::displayHeader();
|
||||
else
|
||||
self::$smarty->assign('static_token', Tools::getToken(false));
|
||||
$this->smarty->assign('static_token', Tools::getToken(false));
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'search.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'search.tpl');
|
||||
}
|
||||
|
||||
public function displayFooter()
|
||||
@@ -136,7 +135,7 @@ class SearchControllerCore extends FrontController
|
||||
parent::setMedia();
|
||||
|
||||
if (!$this->instantSearch AND !$this->ajaxSearch)
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,27 +37,27 @@ class SitemapControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'sitemap.css');
|
||||
Tools::addJS(_THEME_JS_DIR_.'tools/treeManagement.js');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'sitemap.css');
|
||||
$this->addJS(_THEME_JS_DIR_.'tools/treeManagement.js');
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
parent::process();
|
||||
self::$smarty->assign('categoriesTree', Category::getRootCategory(NULL, (int)$this->id_current_shop)->recurseLiteCategTree(0));
|
||||
self::$smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory(_USER_ID_LANG_, 1, 1, 1, (int)$this->id_current_shop));
|
||||
self::$smarty->assign('voucherAllowed', (int)(Configuration::get('PS_VOUCHERS')));
|
||||
$this->smarty->assign('categoriesTree', Category::getRootCategory(NULL, (int)$this->id_current_shop)->recurseLiteCategTree(0));
|
||||
$this->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory(_USER_ID_LANG_, 1, 1, 1, (int)$this->id_current_shop));
|
||||
$this->smarty->assign('voucherAllowed', (int)(Configuration::get('PS_VOUCHERS')));
|
||||
$blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
|
||||
$blocksupplier = Module::getInstanceByName('blocksupplier');
|
||||
self::$smarty->assign('display_manufacturer_link', (((int)$blockmanufacturer->id) ? true : false));
|
||||
self::$smarty->assign('display_supplier_link', (((int)$blocksupplier->id) ? true : false));
|
||||
self::$smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS'));
|
||||
self::$smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));
|
||||
$this->smarty->assign('display_manufacturer_link', (((int)$blockmanufacturer->id) ? true : false));
|
||||
$this->smarty->assign('display_supplier_link', (((int)$blocksupplier->id) ? true : false));
|
||||
$this->smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS'));
|
||||
$this->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'sitemap.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'sitemap.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class StoresControllerCore extends FrontController
|
||||
$smarty->assign('days_datas', $days_datas);
|
||||
$smarty->assign('id_country', $store['id_country']);
|
||||
|
||||
$other .= self::$smarty->fetch(_PS_THEME_DIR_.'store_infos.tpl');
|
||||
$other .= $this->smarty->fetch(_PS_THEME_DIR_.'store_infos.tpl');
|
||||
}
|
||||
|
||||
$newnode->setAttribute('addressNoHtml', strip_tags(str_replace('<br />', ' ', $address)));
|
||||
@@ -192,7 +192,7 @@ class StoresControllerCore extends FrontController
|
||||
global $link;
|
||||
parent::process();
|
||||
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'defaultLat' => (float)Configuration::get('PS_STORES_CENTER_LAT'),
|
||||
'defaultLong' => (float)Configuration::get('PS_STORES_CENTER_LONG'),
|
||||
'searchUrl' => $link->getPageLink('stores')
|
||||
@@ -202,15 +202,15 @@ class StoresControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'stores.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'stores.css');
|
||||
if (!Configuration::get('PS_STORES_SIMPLIFIED'))
|
||||
Tools::addJS(_THEME_JS_DIR_.'stores.js');
|
||||
Tools::addJS('http://maps.google.com/maps/api/js?sensor=true');
|
||||
$this->addJS(_THEME_JS_DIR_.'stores.js');
|
||||
$this->addJS('http://maps.google.com/maps/api/js?sensor=true');
|
||||
}
|
||||
|
||||
public function displayContent()
|
||||
{
|
||||
parent::displayContent();
|
||||
self::$smarty->display(_PS_THEME_DIR_.'stores.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'stores.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class SupplierControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Tools::addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'product_list.css');
|
||||
}
|
||||
|
||||
public function process()
|
||||
@@ -44,7 +44,7 @@ class SupplierControllerCore extends FrontController
|
||||
{
|
||||
$nbProducts = $this->supplier->getProducts($id_supplier, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
|
||||
$this->pagination((int)$nbProducts);
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'nb_products' => $nbProducts,
|
||||
'products' => $this->supplier->getProducts($id_supplier, (int)self::$cookie->id_lang, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay),
|
||||
'path' => ($this->supplier->active ? Tools::safeOutput($this->supplier->name) : ''),
|
||||
@@ -70,7 +70,7 @@ class SupplierControllerCore extends FrontController
|
||||
foreach ($data AS &$item)
|
||||
$item['image'] = (!file_exists($imgDir.'/'.$item['id_supplier'].'-medium.jpg')) ?
|
||||
Language::getIsoById((int)(self::$cookie->id_lang)).'-default' : $item['id_supplier'];
|
||||
self::$smarty->assign(array(
|
||||
$this->smarty->assign(array(
|
||||
'pages_nb' => ceil($nbProducts / (int)($this->n)),
|
||||
'nbSuppliers' => $nbProducts,
|
||||
'mediumSize' => Image::getSize('medium'),
|
||||
@@ -79,7 +79,7 @@ class SupplierControllerCore extends FrontController
|
||||
));
|
||||
}
|
||||
else
|
||||
self::$smarty->assign('nbSuppliers', 0);
|
||||
$this->smarty->assign('nbSuppliers', 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,9 +93,9 @@ class SupplierControllerCore extends FrontController
|
||||
{
|
||||
parent::displayContent();
|
||||
if ($this->supplier)
|
||||
self::$smarty->display(_PS_THEME_DIR_.'supplier.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'supplier.tpl');
|
||||
else
|
||||
self::$smarty->display(_PS_THEME_DIR_.'supplier-list.tpl');
|
||||
$this->smarty->display(_PS_THEME_DIR_.'supplier-list.tpl');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user