[-] BO : BugFix : #PSCFV-3235 : Multistore : unable to duplicate a product

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16552 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vChabot
2012-07-24 15:40:14 +00:00
parent 691d6b3851
commit acb7dd35ed
@@ -431,6 +431,16 @@ class AdminProductsControllerCore extends AdminController
if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product'))))
{
$id_product_old = $product->id;
if (empty($product->price) && Shop::getContext() == Shop::CONTEXT_GROUP)
{
$shops = ShopGroup::getShopsFromGroup(Shop::getContextShopGroupID());
foreach ($shops as $shop)
if ($product->isAssociatedToShop($shop['id_shop']))
{
$product_price = new Product($id_product_old, false, null, $shop['id_shop']);
$product->price = $product_price->price;
}
}
unset($product->id);
unset($product->id_product);
$product->indexed = 0;