// Updated mailalerts module

This commit is contained in:
bMancone
2012-03-01 13:32:16 +00:00
parent 06fb8925e9
commit 1ff1f00dab
8 changed files with 206 additions and 157 deletions
+22 -20
View File
@@ -149,6 +149,14 @@ class StockAvailableCore extends ObjectModel
Db::getInstance()->update($query['table'], $query['data'], $query['where']);
$product_quantity += $quantity;
Hook::exec('actionUpdateQuantity',
array(
'id_product' => $id_product,
'id_product_attribute' => $id_product_attribute,
'quantity' => $quantity
)
);
}
// updates
@@ -357,13 +365,13 @@ class StockAvailableCore extends ObjectModel
$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));
Hook::exec('actionUpdateQuantity',
array(
'id_product' => $id_product,
'id_product_attribute' => $id_product_attribute,
'quantity' => $stock_available->quantity
)
);
}
@@ -391,9 +399,6 @@ class StockAvailableCore extends ObjectModel
{
$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)
{
$stock_available = new StockAvailable($id_stock_available);
@@ -429,19 +434,16 @@ 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));
Hook::exec('actionUpdateQuantity',
array(
'id_product' => $id_product,
'id_product_attribute' => $id_product_attribute,
'quantity' => $stock_available->quantity
)
);
}
}
/**