Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -1191,6 +1191,7 @@ class CartCore extends ObjectModel
|
|||||||
// refresh cache of self::_products
|
// refresh cache of self::_products
|
||||||
$this->_products = $this->getProducts(true);
|
$this->_products = $this->getProducts(true);
|
||||||
CartRule::autoRemoveFromCart();
|
CartRule::autoRemoveFromCart();
|
||||||
|
CartRule::autoAddToCart();
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1023,6 +1023,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$handle = $this->openCsvFile();
|
$handle = $this->openCsvFile();
|
||||||
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
$default_language_id = (int)Configuration::get('PS_LANG_DEFAULT');
|
||||||
AdminImportController::setLocale();
|
AdminImportController::setLocale();
|
||||||
|
$shop_ids = Shop::getCompleteListOfShopsID();
|
||||||
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, $this->separator); $current_line++)
|
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, $this->separator); $current_line++)
|
||||||
{
|
{
|
||||||
if (Tools::getValue('convert'))
|
if (Tools::getValue('convert'))
|
||||||
@@ -1237,7 +1238,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
if (!$valid_link)
|
if (!$valid_link)
|
||||||
$this->warnings[] = sprintf(
|
$this->warnings[] = sprintf(
|
||||||
Tools::displayError('Rewrite link for %1$s (ID: %2$s) was re-written as %3$s.'),
|
Tools::displayError('Rewrite link for %1$s (ID: %2$s) was re-written as %3$s.'),
|
||||||
$link_rewrite,
|
$product->name[$default_language_id],
|
||||||
(isset($info['id']) ? $info['id'] : 'null'),
|
(isset($info['id']) ? $info['id'] : 'null'),
|
||||||
$link_rewrite
|
$link_rewrite
|
||||||
);
|
);
|
||||||
@@ -1250,6 +1251,11 @@ class AdminImportControllerCore extends AdminController
|
|||||||
if (!empty($meta_keyword))
|
if (!empty($meta_keyword))
|
||||||
$meta_keyword = str_replace($this->multiple_value_separator, ',', $meta_keyword);
|
$meta_keyword = str_replace($this->multiple_value_separator, ',', $meta_keyword);
|
||||||
|
|
||||||
|
// Convert comma into dot for all floating values
|
||||||
|
foreach (Product::$definition['fields'] as $key => $array)
|
||||||
|
if ($array['type'] == Product::TYPE_FLOAT)
|
||||||
|
$product->{$key} = str_replace(',', '.', $product->{$key});
|
||||||
|
|
||||||
$res = false;
|
$res = false;
|
||||||
$field_error = $product->validateFields(UNFRIENDLY_ERROR, true);
|
$field_error = $product->validateFields(UNFRIENDLY_ERROR, true);
|
||||||
$lang_field_error = $product->validateFieldsLang(UNFRIENDLY_ERROR, true);
|
$lang_field_error = $product->validateFieldsLang(UNFRIENDLY_ERROR, true);
|
||||||
@@ -1298,8 +1304,12 @@ class AdminImportControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
$shop = trim($shop);
|
$shop = trim($shop);
|
||||||
if (!is_numeric($shop))
|
if (!is_numeric($shop))
|
||||||
$shop = ShopGroup::getIdByName($shop);
|
$shop = Shop::getIdByName($shop);
|
||||||
$shops[] = $shop;
|
|
||||||
|
if (in_array($shop, $shop_ids))
|
||||||
|
$shops[] = $shop;
|
||||||
|
else
|
||||||
|
$this->addProductWarning(Tools::safeOutput($info['name']), $product->id, $this->l('Shop is not valid'));
|
||||||
}
|
}
|
||||||
if (empty($shops))
|
if (empty($shops))
|
||||||
$shops = Shop::getContextListShopID();
|
$shops = Shop::getContextListShopID();
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ class CartControllerCore extends FrontController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$removed = CartRule::autoRemoveFromCart();
|
$removed = CartRule::autoRemoveFromCart();
|
||||||
|
CartRule::autoAddToCart();
|
||||||
if (count($removed) && (int)Tools::getValue('allow_refresh'))
|
if (count($removed) && (int)Tools::getValue('allow_refresh'))
|
||||||
$this->ajax_refresh = true;
|
$this->ajax_refresh = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user