// fix stock for virtual product

This commit is contained in:
lLefevre
2011-12-21 16:49:42 +00:00
parent e00622a9c0
commit 888f23231b
2 changed files with 7 additions and 5 deletions
@@ -128,6 +128,7 @@
$('li.tab-row a[id*="Shipping"]').show(); $('li.tab-row a[id*="Shipping"]').show();
$('#condition').removeAttr('disabled'); $('#condition').removeAttr('disabled');
$('#condition option[value=new]').removeAttr('selected'); $('#condition option[value=new]').removeAttr('selected');
$('.stockForVirtualProduct').show();
} }
else if (val == 2) else if (val == 2)
{ {
@@ -140,12 +141,14 @@
$('#condition').attr('disabled', 'disabled'); $('#condition').attr('disabled', 'disabled');
$('#condition option[value=refurbished]').removeAttr('selected'); $('#condition option[value=refurbished]').removeAttr('selected');
$('#condition option[value=used]').removeAttr('selected'); $('#condition option[value=used]').removeAttr('selected');
$('.stockForVirtualProduct').hide();
} }
else else
{ {
$('li.tab-row a[id*="Shipping"]').show(); $('li.tab-row a[id*="Shipping"]').show();
$('#condition').removeAttr('disabled'); $('#condition').removeAttr('disabled');
$('#condition option[value=new]').removeAttr('selected'); $('#condition option[value=new]').removeAttr('selected');
$('.stockForVirtualProduct').show();
} }
}); });
@@ -58,8 +58,7 @@
<table cellpadding="5" style="width:100%"> <table cellpadding="5" style="width:100%">
<tbody> <tbody>
{if !$product->is_virtual} <tr {if $product->is_virtual}style="display:none;"{/if} class="stockForVirtualProduct">
<tr>
<td valign="top" style="vertical-align:top;"> <td valign="top" style="vertical-align:top;">
<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} <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" /> type="checkbox" name="advanced_stock_management" class="advanced_stock_management" id="advanced_stock_management" />
@@ -67,15 +66,15 @@
<br /><br /> <br /><br />
</td> </td>
</tr> </tr>
<tr> <tr {if $product->is_virtual}style="display:none;"{/if} class="stockForVirtualProduct">
<td valign="top" style="vertical-align:top;"> <td valign="top" style="vertical-align:top;">
<input {if $product->depends_on_stock == 1 && $stock_management_active == 1}checked="checked" {/if} {if $stock_management_active == 0 || $product->advanced_stock_management == 0}disabled="disabled" {/if} type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_1" value="1"/> <input {if $product->depends_on_stock == 1 && $stock_management_active == 1}checked="checked" {/if} {if $stock_management_active == 0 || $product->advanced_stock_management == 0}disabled="disabled" {/if} type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_1" value="1"/>
<label style="float:none;font-weight:normal" for="depends_on_stock_1">{l s='Available quantities for current product and its combinations are based on stock in the warehouses'} {if $stock_management_active == 0 || $product->advanced_stock_management == 0}&nbsp;-&nbsp;<b>{l s='Not possible if stock management is not enabled AND/OR if this product does not use the stock management'}</b>{/if}</label> <label style="float:none;font-weight:normal" for="depends_on_stock_1">{l s='Available quantities for current product and its combinations are based on stock in the warehouses'} {if $stock_management_active == 0 || $product->advanced_stock_management == 0}&nbsp;-&nbsp;<b>{l s='Not possible if stock management is not enabled AND/OR if this product does not use the stock management'}</b>{/if}</label>
<br /><br /> <br /><br />
</td> </td>
</tr> </tr>
{/if}
<tr> <tr {if $product->is_virtual}style="display:none;"{/if} class="stockForVirtualProduct">
<td valign="top" style="vertical-align:top;"> <td valign="top" style="vertical-align:top;">
<input {if $product->depends_on_stock == 0 || $stock_management_active == 0}checked="checked" {/if} type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_0" value="0"/> <input {if $product->depends_on_stock == 0 || $stock_management_active == 0}checked="checked" {/if} type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_0" value="0"/>
<label style="float:none;font-weight:normal" for="depends_on_stock_0">{l s='I want to specify available quantities manually'}</label> <label style="float:none;font-weight:normal" for="depends_on_stock_0">{l s='I want to specify available quantities manually'}</label>