[-] MO : MailAlerts module upgraded for PrestaShop 1.5
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12688 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1189,6 +1189,9 @@ class ProductCore extends ObjectModel
|
||||
$id_images, $reference, $ean13, $default, $location = null, $upc = null, $minimal_quantity, $available_date
|
||||
);
|
||||
$this->addSupplierReference($supplier_reference, $id_product_attribute);
|
||||
|
||||
Hook::exec('actionProductAttributeUpdate', array('id_product_attribute' => $id_product_attribute));
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -356,6 +356,14 @@ class StockAvailableCore extends ObjectModel
|
||||
$stock_available = new StockAvailable($id_stock_available);
|
||||
$stock_available->quantity = $stock_available->quantity + $delta_quantity;
|
||||
$stock_available->update();
|
||||
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
$product = new Product($id_product, true, $id_lang, $id_shop, Context::getContext());
|
||||
|
||||
if ($id_product_attribute != 0)
|
||||
Hook::exec('actionUpdateQuantity', array('product' => $product, 'attribute_id' => $id_product_attribute));
|
||||
else
|
||||
Hook::exec('actionProductUpdate', array('product' => $product));
|
||||
}
|
||||
|
||||
|
||||
@@ -375,12 +383,16 @@ class StockAvailableCore extends ObjectModel
|
||||
if (is_null($id_shop))
|
||||
$id_shop = (int)$context->shop->getID(true);
|
||||
|
||||
$id_lang = Context::getContext()->language->id;
|
||||
$depends_on_stock = StockAvailable::dependsOnStock($id_product);
|
||||
|
||||
//Try to set available quantitiy if product does not depend on physical stock
|
||||
if (!$depends_on_stock)
|
||||
{
|
||||
$id_stock_available = (int)StockAvailable::getStockAvailableIdByProductId($id_product, $id_product_attribute, $id_shop);
|
||||
|
||||
$product = new Product($id_product, true, $id_lang, $id_shop, $context);
|
||||
Hook::exec('actionUpdateQuantity', array('product' => $product, 'attribute_id' => $id_product_attribute));
|
||||
|
||||
if ($id_stock_available)
|
||||
{
|
||||
@@ -417,8 +429,19 @@ class StockAvailableCore extends ObjectModel
|
||||
}
|
||||
|
||||
$stock_available->add();
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$product = new Product($id_product, true, $id_lang, $id_shop, $context);
|
||||
|
||||
if ($id_product_attribute != 0)
|
||||
Hook::exec('actionUpdateQuantity', array('product' => $product, 'attribute_id' => $id_product_attribute));
|
||||
else
|
||||
Hook::exec('actionProductUpdate', array('product' => $product));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user