// product import multishop fix with category default
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14330 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+5
-11
@@ -4875,19 +4875,13 @@ class ProductCore extends ObjectModel
|
|||||||
WHERE `id_product` = '.(int)$id_product);
|
WHERE `id_product` = '.(int)$id_product);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateCategoryDefault($shop = null, $insert = false)
|
public function updateCategoryDefault($shop = null)
|
||||||
{
|
{
|
||||||
if (is_null($shop))
|
if (is_null($shop))
|
||||||
$shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
|
$shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
|
||||||
if ($insert)
|
return Db::getInstance()->execute('
|
||||||
return Db::getInstance()->execute('
|
INSERT INTO `'._DB_PREFIX_.'product_shop`
|
||||||
INSERT INTO `'._DB_PREFIX_.'product_shop`
|
VALUES ('.(int)$this->id.', '.(int)$shop->id.', '.(int)$this->id_category_default.')
|
||||||
VALUES ('.(int)$this->id.', '.(int)$shop->id.', '.(int)$this->id_category_default.')');
|
ON DUPLICATE KEY UPDATE `id_category_default` = '.(int)$this->id_category_default);
|
||||||
else
|
|
||||||
return Db::getInstance()->execute('
|
|
||||||
UPDATE `'._DB_PREFIX_.'product_shop`
|
|
||||||
SET `id_category_default` = '.(int)$this->id_category_default.'
|
|
||||||
WHERE `id_shop` = '.(int)$shop->id.'
|
|
||||||
AND `id_product` = '.(int)$this->id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1161,6 +1161,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
$shop = trim($shop);
|
$shop = trim($shop);
|
||||||
if (!is_numeric($shop))
|
if (!is_numeric($shop))
|
||||||
$shop = Shop::getIdByName($shop);
|
$shop = Shop::getIdByName($shop);
|
||||||
|
$product->updateCategoryDefault(new Shop($shop));
|
||||||
$shops[] = $shop;
|
$shops[] = $shop;
|
||||||
}
|
}
|
||||||
$product->associateTo($shops);
|
$product->associateTo($shops);
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ $_ERRORS['cc7fe0548f3832b01e1d4ce466b99b4c'] = 'Vous ne pouvez pas définir cett
|
|||||||
$_ERRORS['ccacacd12f75e1ab3f9ce3e234ed5777'] = 'Aucun moteur de tableau sélectionné';
|
$_ERRORS['ccacacd12f75e1ab3f9ce3e234ed5777'] = 'Aucun moteur de tableau sélectionné';
|
||||||
$_ERRORS['cd41badf2abd4a993073f9b5611de271'] = 'Numéro de commande non valable';
|
$_ERRORS['cd41badf2abd4a993073f9b5611de271'] = 'Numéro de commande non valable';
|
||||||
$_ERRORS['ce30da82a4a6b974c18780af4597c8ee'] = 'Une erreur est survenue pendant la configuration des priorités.';
|
$_ERRORS['ce30da82a4a6b974c18780af4597c8ee'] = 'Une erreur est survenue pendant la configuration des priorités.';
|
||||||
$_ERRORS['cf325676512d19d8150c0244327926df'] = 'Ce peux être copié';
|
$_ERRORS['cf325676512d19d8150c0244327926df'] = 'Ne peut être copié';
|
||||||
$_ERRORS['cf8a93e045f508c8a3c6430084f45825'] = 'Une erreur s\'est produite. Aucun stock n\'a été ajouté.';
|
$_ERRORS['cf8a93e045f508c8a3c6430084f45825'] = 'Une erreur s\'est produite. Aucun stock n\'a été ajouté.';
|
||||||
$_ERRORS['cfb0a6025f8279ec130db5d2883ead88'] = 'Une erreur s\'est produite pendant la mise à jour des paramètres de la personnalisation.';
|
$_ERRORS['cfb0a6025f8279ec130db5d2883ead88'] = 'Une erreur s\'est produite pendant la mise à jour des paramètres de la personnalisation.';
|
||||||
$_ERRORS['d0f1560c5d1b13b1e64fa87a301dd83b'] = 'Ce bon de réduction se trouve déjà dans votre panier';
|
$_ERRORS['d0f1560c5d1b13b1e64fa87a301dd83b'] = 'Ce bon de réduction se trouve déjà dans votre panier';
|
||||||
|
|||||||
Reference in New Issue
Block a user