// Stockavailable debugged
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td valign="top" style="vertical-align:top;">
|
||||
<input {if $product->advanced_stock_management == 1 && $stock_management_active == 1}value="1" checked="checked" {/if} {if $stock_management_active == 0}disabled="disabled" {/if}
|
||||
<input {if $product->advanced_stock_management == 1 && $stock_management_active == 1}value="1" checked="checked"{else}value="0"{/if} {if $stock_management_active == 0}disabled="disabled" {/if}
|
||||
type="checkbox" name="advanced_stock_management" class="advanced_stock_management" id="advanced_stock_management" />
|
||||
<label style="float:none;font-weight:normal" for="advanced_stock_management">{l s='I want to use the advanced stock management system for this product'} {if $stock_management_active == 0} - <b>{l s='Not possible if stock management is not enabled'}</b>{/if}</label>
|
||||
<br /><br />
|
||||
@@ -288,10 +288,12 @@
|
||||
ajaxCall( { actionQty: 'advanced_stock_management', value: val } );
|
||||
if (val == 1)
|
||||
{
|
||||
$(this).val(1);
|
||||
$('#depends_on_stock_1').attr('disabled', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).val(0);
|
||||
$('#depends_on_stock_1').attr('disabled', true);
|
||||
$('#depends_on_stock_0').attr('checked', true);
|
||||
ajaxCall( { actionQty: 'depends_on_stock', value: 0} );
|
||||
|
||||
+1
-1
@@ -192,7 +192,7 @@ class ProductCore extends ObjectModel
|
||||
* @since 1.5.0
|
||||
* @var boolean Tells if the product uses the advanced stock management
|
||||
*/
|
||||
public $advanced_stock_management;
|
||||
public $advanced_stock_management = 0;
|
||||
|
||||
public $isFullyLoaded = false;
|
||||
|
||||
|
||||
@@ -165,6 +165,14 @@ class StockAvailableCore extends ObjectModel
|
||||
Db::getInstance()->autoExecute($query['table'], $query['data'], $query['type'], $query['where']);
|
||||
}
|
||||
}
|
||||
|
||||
// In case there are no warehouses, removes product from StockAvailable
|
||||
if (count($ids_warehouse) == 0)
|
||||
{
|
||||
self::removeProductFromStockAvailable($id_product);
|
||||
foreach ($ids_product_attribute as $id_product_attribute)
|
||||
self::removeProductFromStockAvailable($id_product, $id_product_attribute);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user