// Merge -> revision 8363
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8365 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+8
-1
@@ -250,6 +250,8 @@ class CartCore extends ObjectModel
|
||||
/**
|
||||
* Return cart discounts
|
||||
*
|
||||
* @param bool true will return discounts with basic informations
|
||||
* @param bool true will erase the cache
|
||||
* @result array Discounts
|
||||
*/
|
||||
public function getDiscounts($lite = false, $refresh = false)
|
||||
@@ -260,10 +262,15 @@ class CartCore extends ObjectModel
|
||||
|
||||
if (!$this->id)
|
||||
return array();
|
||||
if (!$lite AND !$refresh AND isset(self::$_discounts[$this->id]))
|
||||
|
||||
if (!$refresh)
|
||||
{
|
||||
if (!$lite AND isset(self::$_discounts[$this->id]))
|
||||
return self::$_discounts[$this->id];
|
||||
|
||||
if ($lite AND isset(self::$_discountsLite[$this->id]))
|
||||
return self::$_discountsLite[$this->id];
|
||||
}
|
||||
|
||||
$result = Db::getInstance()->ExecuteS('
|
||||
SELECT d.*, `id_cart`
|
||||
|
||||
@@ -234,7 +234,7 @@ class FrontControllerCore
|
||||
// @todo check here
|
||||
$page_name = Dispatcher::getInstance()->getController();
|
||||
$page_name = (preg_match('/^[0-9]/', $page_name)) ? 'page_'.$page_name : $page_name;
|
||||
|
||||
|
||||
// Arf we in a module ?
|
||||
if (preg_match('#^'.preg_quote($this->context->shop->getPhysicalURI(), '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m))
|
||||
$page_name = 'module-'.$m[1].'-'.str_replace(array('.php', '/'), array('', '-'), $m[2]);
|
||||
|
||||
+7
-2
@@ -427,6 +427,7 @@ class PDFCore extends PDF_PageGroupCore
|
||||
*/
|
||||
public static function generateHeaderAddresses(&$pdf, $order, $addressType, $patternRules, $width)
|
||||
{
|
||||
|
||||
$maxY = 0;
|
||||
$pdf->setY($pdf->GetY() + 5);
|
||||
foreach(array_keys($addressType) as $type)
|
||||
@@ -451,8 +452,12 @@ class PDFCore extends PDF_PageGroupCore
|
||||
if ($pattern == 'State:name' &&
|
||||
Context::getContext()->country->iso_code == 'US')
|
||||
{
|
||||
$state = &$addressType[$type]['addressFormatedValues'][$pattern];
|
||||
$state = strtoupper(substr($state, 0, 2));
|
||||
$state_name = &$addressType[$type]['addressFormatedValues'][$pattern];
|
||||
$state = new State((int)State::getIdByName($state_name));
|
||||
if (Validate::isLoadedObject($state))
|
||||
$state_name = $state->iso_code;
|
||||
else
|
||||
$state_name = strtoupper(substr($state_name, 0, 2));
|
||||
}
|
||||
$tmp .= ((isset($addressType[$type]['addressFormatedValues'][$pattern]) &&
|
||||
!empty($addressType[$type]['addressFormatedValues'][$pattern])) ?
|
||||
|
||||
Reference in New Issue
Block a user