Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -219,7 +219,6 @@ class CartRuleCore extends ObjectModel
|
||||
cr.`id_customer` = '.(int)$id_customer.'
|
||||
'.($includeGeneric ? 'OR cr.`id_customer` = 0' : '').'
|
||||
)
|
||||
AND highlight = 1
|
||||
'.($active ? 'AND cr.`active` = 1' : '').'
|
||||
'.($inStock ? 'AND cr.`quantity` > 0' : ''));
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ class CustomerCore extends ObjectModel
|
||||
|
||||
if ($this->newsletter && !Validate::isDate($this->newsletter_date_add))
|
||||
$this->newsletter_date_add = date('Y-m-d H:i:s');
|
||||
if (Context::getContext()->controller->controller_type == 'admin')
|
||||
if (isset(Context::getContext()->controller) && Context::getContext()->controller->controller_type == 'admin')
|
||||
$this->updateGroup($this->groupBox);
|
||||
|
||||
if ($this->deleted)
|
||||
|
||||
+2
-2
@@ -142,8 +142,8 @@ class PackCore extends Product
|
||||
AND a.`id_product_pack` = '.(int)$id_product;
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
|
||||
foreach ($result as &$row)
|
||||
$row = Product::getTaxesInformations($row);
|
||||
foreach ($result as &$line)
|
||||
$line = Product::getTaxesInformations($line);
|
||||
|
||||
if (!$full)
|
||||
return $result;
|
||||
|
||||
+8
-3
@@ -110,7 +110,7 @@ class ToolsCore
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect url wich allready PS_BASE_URI
|
||||
* Redirect URLs already containing PS_BASE_URI
|
||||
*
|
||||
* @param string $url Desired URL
|
||||
*/
|
||||
@@ -968,15 +968,20 @@ class ToolsCore
|
||||
*/
|
||||
public static function str2url($str)
|
||||
{
|
||||
static $allow_accented_chars = null;
|
||||
|
||||
if ($allow_accented_chars === null)
|
||||
$allow_accented_chars = Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
|
||||
|
||||
if (function_exists('mb_strtolower'))
|
||||
$str = mb_strtolower($str, 'utf-8');
|
||||
|
||||
$str = trim($str);
|
||||
if (!function_exists('mb_strtolower') || !Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'))
|
||||
if (!function_exists('mb_strtolower') || !$allow_accented_chars)
|
||||
$str = Tools::replaceAccentedChars($str);
|
||||
|
||||
// Remove all non-whitelist chars.
|
||||
if (Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'))
|
||||
if ($allow_accented_chars)
|
||||
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str);
|
||||
else
|
||||
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-]/','', $str);
|
||||
|
||||
@@ -113,8 +113,18 @@ class AdminCartsControllerCore extends AdminController
|
||||
/* Display order information */
|
||||
$id_order = (int)Order::getOrderByCartId($cart->id);
|
||||
$order = new Order($id_order);
|
||||
|
||||
if ($order->getTaxCalculationMethod() == PS_TAX_EXC)
|
||||
if (Validate::isLoadedObject($order))
|
||||
{
|
||||
$tax_calculation_method = $order->getTaxCalculationMethod();
|
||||
$id_shop = (int)$order->id_shop;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id_shop = (int)$cart->id_shop;
|
||||
$tax_calculation_method = Group::getPriceDisplayMethod(Group::getCurrent()->id);
|
||||
}
|
||||
|
||||
if ($tax_calculation_method == PS_TAX_EXC)
|
||||
{
|
||||
$total_products = $summary['total_products'];
|
||||
$total_discounts = $summary['total_discounts_tax_exc'];
|
||||
@@ -132,7 +142,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
}
|
||||
foreach ($products as $k => &$product)
|
||||
{
|
||||
if ($order->getTaxCalculationMethod() == PS_TAX_EXC)
|
||||
if ($tax_calculation_method == PS_TAX_EXC)
|
||||
{
|
||||
$product['product_price'] = $product['price'];
|
||||
$product['product_total'] = $product['total'];
|
||||
@@ -153,7 +163,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
WHERE id_product = '.(int)$product['id_product'].' AND cover = 1');
|
||||
|
||||
$product_obj = new Product($product['id_product']);
|
||||
$product['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct($product['id_product'], isset($product['id_product_attribute']) ? $product['id_product_attribute'] : null, (int)$order->id_shop);
|
||||
$product['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct($product['id_product'], isset($product['id_product_attribute']) ? $product['id_product_attribute'] : null, (int)$id_shop);
|
||||
|
||||
$image_product = new Image($image['id_image']);
|
||||
$product['image'] = (isset($image['id_image']) ? ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$image_product->getExistingImgPath().'.jpg', 'product_mini_'.(int)$product['id_product'].(isset($product['id_product_attribute']) ? '_'.(int)$product['id_product_attribute'] : '').'.jpg', 45, 'jpg') : '--');
|
||||
|
||||
@@ -329,7 +329,7 @@ class ParentOrderControllerCore extends FrontController
|
||||
$cart_cart_rules = $this->context->cart->getCartRules();
|
||||
foreach ($available_cart_rules as $key => $available_cart_rule)
|
||||
{
|
||||
if (strpos($available_cart_rule['code'], 'BO_ORDER_') === 0)
|
||||
if (!$available_cart_rule['highlight'] || strpos($available_cart_rule['code'], 'BO_ORDER_') === 0)
|
||||
{
|
||||
unset($available_cart_rules[$key]);
|
||||
continue;
|
||||
|
||||
@@ -353,7 +353,7 @@ class MailAlerts extends Module
|
||||
'{delivery_postal_code}' => $delivery->postcode,
|
||||
'{delivery_country}' => $delivery->country,
|
||||
'{delivery_state}' => $delivery->id_state ? $delivery_state->name : '',
|
||||
'{delivery_phone}' => $delivery->phone,
|
||||
'{delivery_phone}' => $delivery->phone ? $delivery->phone : $delivery->phone_mobile,
|
||||
'{delivery_other}' => $delivery->other,
|
||||
'{invoice_company}' => $invoice->company,
|
||||
'{invoice_firstname}' => $invoice->firstname,
|
||||
@@ -364,7 +364,7 @@ class MailAlerts extends Module
|
||||
'{invoice_postal_code}' => $invoice->postcode,
|
||||
'{invoice_country}' => $invoice->country,
|
||||
'{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',
|
||||
'{invoice_phone}' => $invoice->phone,
|
||||
'{invoice_phone}' => $invoice->phone ? $invoice->phone : $invoice->phone_mobile,
|
||||
'{invoice_other}' => $invoice->other,
|
||||
'{order_name}' => sprintf('%06d', $order->id),
|
||||
'{shop_name}' => Configuration::get('PS_SHOP_NAME'),
|
||||
|
||||
@@ -77,7 +77,7 @@ class Tools extends ToolsCore
|
||||
|
||||
|
||||
/**
|
||||
* Redirect url wich allready PS_BASE_URI after 5 sec
|
||||
* Redirect URLs already containing PS_BASE_URI after 5s
|
||||
*
|
||||
* @param string $url Desired URL
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
{if $discountDetail.id_discount_type == 1}
|
||||
{$discountDetail.value|escape:'htmlall':'UTF-8'}%
|
||||
{elseif $discountDetail.id_discount_type == 2}
|
||||
{convertPrice price=$discountDetail.value}
|
||||
{convertPrice price=$discountDetail.value} ({if $discountDetail.reduction_tax == 1}{l s='Tax included'}{else}{l s='Tax excluded'}{/if})
|
||||
{elseif $discountDetail.id_discount_type == 3}
|
||||
{l s='Free shipping'}
|
||||
{else}
|
||||
@@ -76,9 +76,6 @@
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
*{l s='Tax included'}
|
||||
</p>
|
||||
{else}
|
||||
<p class="warning">{l s='You do not have any vouchers.'}</p>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user