// Improved stock management for packs

This commit is contained in:
bMancone
2012-03-01 14:28:56 +00:00
parent fddb0bd908
commit a905674ef7
2 changed files with 5 additions and 1 deletions
@@ -109,6 +109,7 @@
{if isset($pack_quantity)}
<tr>
<td valign="top" style="text-align:left;vertical-align:top;">
<p><b>{l s='When a product has combinations, quantities will be based on the default combination.'}</b></p>
<p><b>{l s='Given the quantities of the products in this pack, the maximum quantity should be: '} {$pack_quantity}</b></p>
</td>
</tr>
@@ -3547,7 +3547,10 @@ class AdminProductsControllerCore extends AdminController
foreach ($items as $item)
{
if (!$item->isAvailableWhenOutOfStock((int)$item->out_of_stock))
$pack_quantities[] = Product::getQuantity($item->id) / ($item->pack_quantity !== 0 ? $item->pack_quantity : 1);
{
$pack_id_product_attribute = Product::getDefaultAttribute($item->id, 1);
$pack_quantities[] = Product::getQuantity($item->id, $pack_id_product_attribute) / ($item->pack_quantity !== 0 ? $item->pack_quantity : 1);
}
}
// gets the minimum