// Improved stock management for packs
This commit is contained in:
1 parent
fddb0bd908
commit
a905674ef7
2 files changed
+5
-1
No files matched your search
@@ -109,6 +109,7 @@
|
|||||||
{if isset($pack_quantity)}
|
{if isset($pack_quantity)}
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top" style="text-align:left;vertical-align:top;">
|
<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>
|
<p><b>{l s='Given the quantities of the products in this pack, the maximum quantity should be: '} {$pack_quantity}</b></p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -3547,7 +3547,10 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
foreach ($items as $item)
|
foreach ($items as $item)
|
||||||
{
|
{
|
||||||
if (!$item->isAvailableWhenOutOfStock((int)$item->out_of_stock))
|
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
|
// gets the minimum
|
||||||
|
|||||||
Reference in new issue
Block a user