// Normalize + use $this->smarty instead of $this->context->smarty in modules

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11944 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-12-30 14:59:57 +00:00
parent 9033c9c294
commit 58433f1881
27 changed files with 87 additions and 86 deletions
+4 -4
View File
@@ -170,7 +170,7 @@ class BankWire extends PaymentModule
return ;
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'this_path' => $this->_path,
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/'
));
@@ -185,7 +185,7 @@ class BankWire extends PaymentModule
$state = $params['objOrder']->getCurrentState();
if ($state == Configuration::get('PS_OS_BANKWIRE') OR $state == Configuration::get('PS_OS_OUTOFSTOCK'))
{
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false),
'bankwireDetails' => Tools::nl2br($this->details),
'bankwireAddress' => Tools::nl2br($this->address),
@@ -194,10 +194,10 @@ class BankWire extends PaymentModule
'id_order' => $params['objOrder']->id
));
if (isset($params['objOrder']->reference) && !empty($params['objOrder']->reference))
$this->context->smarty->assign('reference', $params['objOrder']->reference);
$this->smarty->assign('reference', $params['objOrder']->reference);
}
else
$this->context->smarty->assign('status', 'failed');
$this->smarty->assign('status', 'failed');
return $this->display(__FILE__, 'payment_return.tpl');
}
@@ -226,9 +226,11 @@ class BlockAdvertising extends Module
*/
public function hookRightColumn($params)
{
$this->context->smarty->assign('image', $this->context->link->protocol_content.$this->adv_img);
$this->context->smarty->assign('adv_link', $this->adv_link);
$this->context->smarty->assign('adv_title', $this->adv_title);
$this->smarty->assign(array(
'image' => $this->context->link->protocol_content.$this->adv_img,
'adv_link' => $this->adv_link,
'adv_title' => $this->adv_title,
));
return $this->display(__FILE__, 'blockadvertising.tpl');
}
@@ -113,7 +113,7 @@ class BlockBestSellers extends Module
$best_sellers[] = $bestseller;
}
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'best_sellers' => $best_sellers,
'mediumSize' => Image::getSize('medium'),
'smallSize' => Image::getSize('small')
@@ -138,20 +138,20 @@ class BlockBestSellers extends Module
if (Configuration::get('PS_CATALOG_MODE'))
return ;
$currency = new Currency((int)($params['cookie']->id_currency));
$bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 4);
if (!$bestsellers AND !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))
$currency = new Currency($params['cookie']->id_currency);
$bestsellers = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 4);
if (!$bestsellers && !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))
return;
$best_sellers = array();
if($bestsellers)
if ($bestsellers)
foreach ($bestsellers AS $bestseller)
{
$bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency);
$best_sellers[] = $bestseller;
}
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'best_sellers' => $best_sellers,
'homeSize' => Image::getSize('home')));
return $this->display(__FILE__, 'blockbestsellers-home.tpl');
+16 -16
View File
@@ -203,15 +203,15 @@ class BlockCategories extends Module
$resultParents[$row['id_parent']][] = &$row;
$resultIds[$row['id_category']] = &$row;
}
//p($resultParents);
$blockCategTree = $this->getTree($resultParents, $resultIds, Configuration::get('BLOCK_CATEG_MAX_DEPTH'));
unset($resultParents, $resultIds);
//d($blockCategTree);
$isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false);
if (Tools::isSubmit('id_category'))
{
$this->context->cookie->last_visited_category = $id_category;
$this->context->smarty->assign('currentCategoryId', $this->context->cookie->last_visited_category);
$this->smarty->assign('currentCategoryId', $this->context->cookie->last_visited_category);
}
if (Tools::isSubmit('id_product'))
{
@@ -221,15 +221,15 @@ class BlockCategories extends Module
if (isset($product) AND Validate::isLoadedObject($product))
$this->context->cookie->last_visited_category = (int)($product->id_category_default);
}
$this->context->smarty->assign('currentCategoryId', (int)($this->context->cookie->last_visited_category));
$this->smarty->assign('currentCategoryId', (int)($this->context->cookie->last_visited_category));
}
$this->context->smarty->assign('blockCategTree', $blockCategTree);
$this->smarty->assign('blockCategTree', $blockCategTree);
if (file_exists(_PS_THEME_DIR_.'modules/blockcategories/blockcategories.tpl'))
$this->context->smarty->assign('branche_tpl_path', _PS_THEME_DIR_.'modules/blockcategories/category-tree-branch.tpl');
$this->smarty->assign('branche_tpl_path', _PS_THEME_DIR_.'modules/blockcategories/category-tree-branch.tpl');
else
$this->context->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl');
$this->context->smarty->assign('isDhtml', $isDhtml);
$this->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl');
$this->smarty->assign('isDhtml', $isDhtml);
//}
$this->context->smarty->cache_lifetime = 31536000; // 1 Year
$display = $this->display(__FILE__, 'blockcategories.tpl', $smartyCacheId);
@@ -279,8 +279,8 @@ class BlockCategories extends Module
$nbrColumns=3;
$numberColumn = abs(sizeof($result)/$nbrColumns);
$widthColumn= floor(100/$nbrColumns);
$this->context->smarty->assign('numberColumn', $numberColumn);
$this->context->smarty->assign('widthColumn', $widthColumn);
$this->smarty->assign('numberColumn', $numberColumn);
$this->smarty->assign('widthColumn', $widthColumn);
$blockCategTree = $this->getTree($resultParents, $resultIds, Configuration::get('BLOCK_CATEG_MAX_DEPTH'));
unset($resultParents, $resultIds);
@@ -290,7 +290,7 @@ class BlockCategories extends Module
if (Tools::isSubmit('id_category'))
{
$this->context->cookie->last_visited_category = $id_category;
$this->context->smarty->assign('currentCategoryId', $this->context->cookie->last_visited_category);
$this->smarty->assign('currentCategoryId', $this->context->cookie->last_visited_category);
}
if (Tools::isSubmit('id_product'))
{
@@ -300,15 +300,15 @@ class BlockCategories extends Module
if (isset($product) AND Validate::isLoadedObject($product))
$this->context->cookie->last_visited_category = (int)($product->id_category_default);
}
$this->context->smarty->assign('currentCategoryId', (int)($this->context->cookie->last_visited_category));
$this->smarty->assign('currentCategoryId', (int)($this->context->cookie->last_visited_category));
}
$this->context->smarty->assign('blockCategTree', $blockCategTree);
$this->smarty->assign('blockCategTree', $blockCategTree);
if (file_exists(_PS_THEME_DIR_.'modules/blockcategories/blockcategories_footer.tpl'))
$this->context->smarty->assign('branche_tpl_path', _PS_THEME_DIR_.'modules/blockcategories/category-tree-branch.tpl');
$this->smarty->assign('branche_tpl_path', _PS_THEME_DIR_.'modules/blockcategories/category-tree-branch.tpl');
else
$this->context->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl');
$this->context->smarty->assign('isDhtml', $isDhtml);
$this->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl');
$this->smarty->assign('isDhtml', $isDhtml);
}
$this->context->smarty->cache_lifetime = 31536000; // 1 Year
$display = $this->display(__FILE__, 'blockcategories_footer.tpl', $smartyCacheId);
+1 -2
View File
@@ -62,8 +62,7 @@ class BlockCurrencies extends Module
if (!count(Currency::getCurrencies()))
return '';
// @todo remove this and use smartyTemplate
$this->context->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
$this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign);
return $this->display(__FILE__, 'blockcurrencies.tpl');
}
@@ -151,7 +151,7 @@ class blockcustomerprivacy extends Module
if (!$this->active)
return ;
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'privacy_message' => Configuration::get('CUSTPRIV_MESSAGE', $this->context->language->id),
'error_message' => $this->l('Please agree with the customer data privacy by ticking the checkbox below.')
));
+1 -1
View File
@@ -93,7 +93,7 @@ class BlockLink extends Module
{
$links = $this->getLinks();
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'blocklink_links' => $links,
'title' => Configuration::get('PS_BLOCKLINK_TITLE', $this->context->language->id),
'url' => Configuration::get('PS_BLOCKLINK_URL'),
@@ -117,7 +117,7 @@ class BlockPaymentLogo extends Module
$cms = new CMS(Configuration::get('PS_PAYMENT_LOGO_CMS_ID'), $this->context->language->id);
if (!Validate::isLoadedObject($cms))
return;
$this->context->smarty->assign('cms_payement_logo', $cms);
$this->smarty->assign('cms_payement_logo', $cms);
return $this->display(__FILE__, 'blockpaymentlogo.tpl');
}
+1 -1
View File
@@ -171,7 +171,7 @@ class Blockrss extends Module
}
// Display smarty
$this->context->smarty->assign(array('title' => ($title ? $title : $this->l('RSS feed')), 'rss_links' => $rss_links));
$this->smarty->assign(array('title' => ($title ? $title : $this->l('RSS feed')), 'rss_links' => $rss_links));
return $this->display(__FILE__, 'blockrss.tpl');
}
+6 -4
View File
@@ -84,10 +84,12 @@ class BlockSearch extends Module
*/
private function calculHookCommon($params)
{
$this->context->smarty->assign('ENT_QUOTES', ENT_QUOTES);
$this->context->smarty->assign('search_ssl', Tools::usingSecureMode());
$this->context->smarty->assign('ajaxsearch', Configuration::get('PS_SEARCH_AJAX'));
$this->context->smarty->assign('instantsearch', Configuration::get('PS_INSTANT_SEARCH'));
$this->smarty->assign(array(
'ENT_QUOTES' => ENT_QUOTES,
'search_ssl' => Tools::usingSecureMode(),
'ajaxsearch' => Configuration::get('PS_SEARCH_AJAX'),
'instantsearch' => Configuration::get('PS_INSTANT_SEARCH'),
));
return true;
}
+2 -4
View File
@@ -63,9 +63,7 @@ class BlockStore extends Module
function hookRightColumn($params)
{
$this->context->smarty->assign('store_img', Configuration::get('BLOCKSTORE_IMG'));
$this->smarty->assign('store_img', Configuration::get('BLOCKSTORE_IMG'));
return $this->display(__FILE__, 'blockstore.tpl');
}
@@ -78,7 +76,7 @@ class BlockStore extends Module
{
if (Tools::isSubmit('submitStoreConf'))
{
if (isset($_FILES['store_img']) AND isset($_FILES['store_img']['tmp_name']) AND !empty($_FILES['store_img']['tmp_name']))
if (isset($_FILES['store_img']) && isset($_FILES['store_img']['tmp_name']) && !empty($_FILES['store_img']['tmp_name']))
{
if ($error = checkImage($_FILES['store_img'], 4000000))
return $this->displayError($this->l('invalid image'));
+1 -1
View File
@@ -60,7 +60,7 @@ class BlockSupplier extends Module
function hookDisplayLeftColumn($params)
{
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'suppliers' => Supplier::getSuppliers(false),
'link' => $this->context->link,
'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'),
+1 -1
View File
@@ -106,7 +106,7 @@ class BlockTags extends Module
return false;
foreach ($tags AS &$tag)
$tag['class'] = 'tag_level'.($tag['times'] > BLOCKTAGS_MAX_LEVEL ? BLOCKTAGS_MAX_LEVEL : $tag['times']);
$this->context->smarty->assign('tags', $tags);
$this->smarty->assign('tags', $tags);
return $this->display(__FILE__, 'blocktags.tpl');
}
+3 -3
View File
@@ -194,7 +194,7 @@ class BlockWishList extends Module
}
else
$id_wishlist = $this->context->cookie->id_wishlist;
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'id_wishlist' => $id_wishlist,
'isLogged' => true,
'wishlist_products' => ($id_wishlist == false ? false : WishList::getProductByIdCustomer($id_wishlist, $this->context->customer->id, $this->context->language->id, null, true)),
@@ -202,7 +202,7 @@ class BlockWishList extends Module
'ptoken' => Tools::getToken(false)));
}
else
$this->context->smarty->assign(array('wishlist_products' => false, 'wishlists' => false));
$this->smarty->assign(array('wishlist_products' => false, 'wishlists' => false));
return ($this->display(__FILE__, 'blockwishlist.tpl'));
}
@@ -213,7 +213,7 @@ class BlockWishList extends Module
public function hookProductActions($params)
{
$this->context->smarty->assign('id_product', (int)(Tools::getValue('id_product')));
$this->smarty->assign('id_product', (int)(Tools::getValue('id_product')));
return ($this->display(__FILE__, 'blockwishlist-extra.tpl'));
}
+4 -4
View File
@@ -154,7 +154,7 @@ class Cheque extends PaymentModule
if (!$this->checkCurrency($params['cart']))
return ;
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'this_path' => $this->_path,
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/'
));
@@ -169,7 +169,7 @@ class Cheque extends PaymentModule
$state = $params['objOrder']->getCurrentState();
if ($state == Configuration::get('PS_OS_CHEQUE') OR $state == Configuration::get('PS_OS_OUTOFSTOCK'))
{
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false),
'chequeName' => $this->chequeName,
'chequeAddress' => Tools::nl2br($this->address),
@@ -177,10 +177,10 @@ class Cheque extends PaymentModule
'id_order' => $params['objOrder']->id
));
if (isset($params['objOrder']->reference) && !empty($params['objOrder']->reference))
$this->context->smarty->assign('reference', $params['objOrder']->reference);
$this->smarty->assign('reference', $params['objOrder']->reference);
}
else
$this->context->smarty->assign('status', 'failed');
$this->smarty->assign('status', 'failed');
return $this->display(__FILE__, 'payment_return.tpl');
}
+2 -2
View File
@@ -161,7 +161,7 @@ class CrossSelling extends Module
$orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], false, NULL);
}
$this->context->smarty->assign(array('order' => (count($pIds) > 1 ? true : false), 'orderProducts' => $orderProducts, 'middlePosition_crossselling' => round(sizeof($orderProducts) / 2, 0),
$this->smarty->assign(array('order' => (count($pIds) > 1 ? true : false), 'orderProducts' => $orderProducts, 'middlePosition_crossselling' => round(sizeof($orderProducts) / 2, 0),
'crossDisplayPrice' => Configuration::get('CROSSSELLING_DISPLAY_PRICE')));
}
return $this->display(__FILE__, 'crossselling.tpl');
@@ -209,7 +209,7 @@ class CrossSelling extends Module
$orderProduct['displayed_price'] = Product::getPriceStatic((int)$orderProduct['product_id'], false, NULL);
}
$this->context->smarty->assign(array('order' => false, 'orderProducts' => $orderProducts, 'middlePosition_crossselling' => round(sizeof($orderProducts) / 2, 0),
$this->smarty->assign(array('order' => false, 'orderProducts' => $orderProducts, 'middlePosition_crossselling' => round(sizeof($orderProducts) / 2, 0),
'crossDisplayPrice' => Configuration::get('CROSSSELLING_DISPLAY_PRICE')));
}
return $this->display(__FILE__, 'crossselling.tpl');
+2 -2
View File
@@ -114,7 +114,7 @@ class DateOfDelivery extends Module
foreach ($params['carriers'] as $carrier)
$datesDelivery[(int)($carrier['id_carrier'])] = $this->_getDatesOfDelivery((int)($carrier['id_carrier']), $oos);
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'datesDelivery' => $datesDelivery,
'id_carrier' => ($params['cart']->id_carrier ? (int)($params['cart']->id_carrier) : (int)(Configuration::get('PS_CARRIER_DEFAULT')))
));
@@ -136,7 +136,7 @@ class DateOfDelivery extends Module
if (!is_array($datesDelivery) OR !sizeof($datesDelivery))
return ;
$this->context->smarty->assign('datesDelivery', $datesDelivery);
$this->smarty->assign('datesDelivery', $datesDelivery);
return $this->display(__FILE__, 'orderDetail.tpl');
}
+1 -1
View File
@@ -300,7 +300,7 @@ class Editorial extends Module
{
$editorial = new EditorialClass(1, $this->context->language->id);
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'editorial' => $editorial,
'default_lang' => (int)$this->context->language->id,
'image_width' => Configuration::get('EDITORIAL_IMAGE_WIDTH'),
@@ -81,7 +81,7 @@ class FavoriteProducts extends Module
$favoriteProducts = FavoriteProduct::getFavoriteProducts($this->context->customer->id, $this->context->language->id);
$this->context->smarty->assign(array('favorite_products' => $favoriteProducts));
$this->smarty->assign(array('favorite_products' => $favoriteProducts));
return $this->display(__FILE__, 'my-account.tpl');
}
@@ -95,7 +95,7 @@ class FavoriteProducts extends Module
{
include_once(dirname(__FILE__).'/FavoriteProduct.php');
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'isCustomerFavoriteProduct' => (FavoriteProduct::isCustomerFavoriteProduct($this->context->customer->id, Tools::getValue('id_product')) ? 1 : 0),
'isLogged' => (int)$this->context->customer->logged));
return $this->display(__FILE__, 'favoriteproducts-extra.tpl');
+7 -7
View File
@@ -61,23 +61,23 @@ class Feeder extends Module
$id_category = (int)(Tools::getValue('id_category'));
if (!$id_category)
{
if (isset($_SERVER['HTTP_REFERER']) AND preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) AND !strstr($_SERVER['HTTP_REFERER'], '.html'))
if (isset($_SERVER['HTTP_REFERER']) && preg_match('!^(.*)\/([0-9]+)\-(.*[^\.])|(.*)id_category=([0-9]+)(.*)$!', $_SERVER['HTTP_REFERER'], $regs) && !strstr($_SERVER['HTTP_REFERER'], '.html'))
{
if (isset($regs[2]) AND is_numeric($regs[2]))
if (isset($regs[2]) && is_numeric($regs[2]))
$id_category = (int)($regs[2]);
elseif (isset($regs[5]) AND is_numeric($regs[5]))
$id_category = (int)($regs[5]);
elseif (isset($regs[5]) && is_numeric($regs[5]))
$id_category = (int)$regs[5];
}
elseif ($id_product = (int)(Tools::getValue('id_product')))
elseif ($id_product = (int)Tools::getValue('id_product'))
{
$product = new Product($id_product);
$id_category = $product->id_category_default;
}
}
$category = new Category($id_category);
$orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby'));
$orderWay = Tools::getProductsOrder('way', Tools::getValue('orderway'));
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'feedUrl' => Tools::getShopDomain(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/rss.php?id_category='.$id_category.'&orderby='.$orderBy.'&orderway='.$orderWay,
));
return $this->display(__FILE__, 'feederHeader.tpl');
+2 -2
View File
@@ -616,8 +616,8 @@ class HomeSlider extends Module
if (!$slides)
return;
$this->context->smarty->assign('homeslider_slides', $slides);
$this->context->smarty->assign('homeslider', $slider);
$this->smarty->assign('homeslider_slides', $slides);
$this->smarty->assign('homeslider', $slider);
return $this->display(__FILE__, 'homeslider.tpl');
}
+5 -5
View File
@@ -454,14 +454,14 @@ class Loyalty extends Module
if (!(int)(Configuration::get('PS_LOYALTY_NONE_AWARD')) AND Product::isDiscounted((int)$product->id))
{
$points = 0;
$this->context->smarty->assign('no_pts_discounted', 1);
$this->smarty->assign('no_pts_discounted', 1);
}
else
$points = (int)(LoyaltyModule::getNbPointsByPrice($product->getPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? false : true, (int)($product->getIdProductAttributeMostExpensive()))));
$pointsAfter = $points;
$pointsBefore = 0;
}
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'points' => (int)($points),
'total_points' => (int)($pointsAfter),
'point_rate' => Configuration::get('PS_LOYALTY_POINT_RATE'),
@@ -520,14 +520,14 @@ class Loyalty extends Module
if (Validate::isLoadedObject($params['cart']))
{
$points = LoyaltyModule::getCartNbPoints($params['cart']);
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'points' => (int)$points,
'voucher' => LoyaltyModule::getVoucherValue((int)$points),
'guest_checkout' => (int)Configuration::get('PS_GUEST_CHECKOUT_ENABLED')
));
} else {
$smarty->assign(array('points' => 0));
}
else
$this->smarty->assign(array('points' => 0));
return $this->display(__FILE__, 'shopping-cart.tpl');
}
+2 -2
View File
@@ -259,7 +259,7 @@ class MailAlerts extends Module
$id_product_attribute = 0;
if (!$this->context->customer->isLogged())
$this->context->smarty->assign('email', 1);
$this->smarty->assign('email', 1);
else
{
$id_customer = (int)($params['cookie']->id_customer);
@@ -267,7 +267,7 @@ class MailAlerts extends Module
return ;
}
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'id_product' => $id_product,
'id_product_attribute' => $id_product_attribute));
@@ -164,7 +164,7 @@ class productsCategory extends Module
}
// Display tpl
$this->context->smarty->assign(array(
$this->smarty->assign(array(
'categoryProducts' => $categoryProducts,
'middlePosition' => (int)$middlePosition,
'ProdDisplayPrice' => Configuration::get('PRODUCTSCATEGORY_DISPLAY_PRICE')));
+3 -3
View File
@@ -153,7 +153,7 @@ class ProductToolTip extends Module
WHERE p.id_page_type = 1 AND p.id_object = '.(int)($id_product).' AND cp.time_start > \''.pSQL($date).'\'');
if (isset($nbPeople['nb']) AND $nbPeople['nb'] > 0)
$this->context->smarty->assign('nb_people', (int)($nbPeople['nb']));
$this->smarty->assign('nb_people', (int)($nbPeople['nb']));
}
/* Then, we try to display last sale */
@@ -170,7 +170,7 @@ class ProductToolTip extends Module
ORDER BY o.date_add DESC');
if (isset($order['date_add']) && Validate::isDateFormat($order['date_add']) && $order['date_add'] != '0000-00-00 00:00:00')
$this->context->smarty->assign('date_last_order', $order['date_add']);
$this->smarty->assign('date_last_order', $order['date_add']);
else
{
/* No sale? display last cart add instead */
@@ -182,7 +182,7 @@ class ProductToolTip extends Module
WHERE cp.id_product = '.(int)($id_product));
if (isset($cart['date_add']) && Validate::isDateFormat($cart['date_add']) && $cart['date_add'] != '0000-00-00 00:00:00')
$this->context->smarty->assign('date_last_cart', $cart['date_add']);
$this->smarty->assign('date_last_cart', $cart['date_add']);
}
}
}
+2 -2
View File
@@ -372,7 +372,7 @@ class ReferralProgram extends Module
if ($cartRule->checkValidity($this->context) === false)
{
$this->context->smarty->assign(array('discount_display' => ReferralProgram::displayDiscount($cartRule->reduction_percent ? $cartRule->reduction_percent : $cartRule->reduction_amount, $cartRule->reduction_percent ? 1 : 2, new Currency($params['cookie']->id_currency)), 'discount' => $cartRule));
$this->smarty->assign(array('discount_display' => ReferralProgram::displayDiscount($cartRule->reduction_percent ? $cartRule->reduction_percent : $cartRule->reduction_amount, $cartRule->reduction_percent ? 1 : 2, new Currency($params['cookie']->id_currency)), 'discount' => $cartRule));
return $this->display(__FILE__, 'shopping-cart.tpl');
}
return false;
@@ -580,7 +580,7 @@ class ReferralProgram extends Module
$cartRule = new CartRule((int)$referralprogram->id_cart_rule_sponsor);
if (!Validate::isLoadedObject($cartRule))
return false;
$this->context->smarty->assign(array('discount' => ReferralProgram::displayDiscount($cartRule->reduction_percent ? $cartRule->reduction_percent : $cartRule->reduction_amount, $cartRule->reduction_percent ? 1 : 2, new Currency((int)$params['objOrder']->id_currency)), 'sponsor_firstname' => $sponsor->firstname, 'sponsor_lastname' => $sponsor->lastname));
$this->smarty->assign(array('discount' => ReferralProgram::displayDiscount($cartRule->reduction_percent ? $cartRule->reduction_percent : $cartRule->reduction_amount, $cartRule->reduction_percent ? 1 : 2, new Currency((int)$params['objOrder']->id_currency)), 'sponsor_firstname' => $sponsor->firstname, 'sponsor_lastname' => $sponsor->lastname));
return $this->display(__FILE__, 'order-confirmation.tpl');
}
return false;
+5 -5
View File
@@ -93,7 +93,7 @@ class TrackingFront extends Module
Tools::redirect('modules/trackingfront/stats.php');
}
}
$this->context->smarty->assign('errors', $errors);
$this->smarty->assign('errors', $errors);
}
if (Tools::isSubmit('submitDatePicker'))
@@ -164,9 +164,9 @@ class TrackingFront extends Module
Referrer::refreshCache(array(array('id_referrer' => (int)($this->context->cookie->tracking_id))), $fakeEmployee);
$referrer = new Referrer((int)($this->context->cookie->tracking_id));
$this->context->smarty->assign('referrer', $referrer);
$this->context->smarty->assign('datepickerFrom', $fakeEmployee->stats_date_from);
$this->context->smarty->assign('datepickerTo', $fakeEmployee->stats_date_to);
$this->smarty->assign('referrer', $referrer);
$this->smarty->assign('datepickerFrom', $fakeEmployee->stats_date_from);
$this->smarty->assign('datepickerTo', $fakeEmployee->stats_date_to);
$displayTab = array(
'uniqs' => $this->l('Unique visitors'),
@@ -182,7 +182,7 @@ class TrackingFront extends Module
'cart' => $this->l('Average cart'),
'reg_rate' => $this->l('Registration rate'),
'order_rate' => $this->l('Order rate'));
$this->context->smarty->assign('displayTab', $displayTab);
$this->smarty->assign('displayTab', $displayTab);
$products = Product::getSimpleProducts($this->context->language->id);
$productsArray = array();