// BO product page fix js trigger order

This commit is contained in:
tDidierjean
2012-04-02 09:26:33 +00:00
parent 6eea5e8005
commit abbdc64906
2 changed files with 17 additions and 16 deletions
@@ -105,11 +105,11 @@
{elseif $product->is_virtual}
onTabLoad('Informations', function(){
$('#virtual_product').attr('checked', 'checked');
$('#condition').attr('disabled', 'disabled');
$('#condition option[value=new]').attr('selected', 'selected');
});
$('li.tab-row a[id*="Pack"]').hide();
$('li.tab-row a[id*="Shipping"]').hide();
$('#condition').attr('disabled', 'disabled');
$('#condition option[value=new]').attr('selected', 'selected');
{else}
onTabLoad('Informations', function(){
$('#simple_product').attr('checked', 'checked');
@@ -158,24 +158,25 @@
else if (product_type == {Product::PTYPE_VIRTUAL})
{
$('li.tab-row a[id*="VirtualProduct"]').show().click();
$('#is_virtual_good').attr('checked', true);
$('#virtual_good').show();
$('#is_virtual').val(1);
$("#virtual_good_attributes").show();
// If the virtual product tab has not finished loaded the changes will be made when the loading event is triggered
$("#product-tab-content-VirtualProduct").bind('loaded', function(){
onTabLoad('VirtualProduct', function(){
$('#is_virtual_good').attr('checked', true);
$('#virtual_good').show();
$('#is_virtual').val(1);
$("#virtual_good_attributes").show();
});
$("#product-tab-content-Quantities").bind('loaded', function(){
onTabLoad('Quantities', function(){
$('.stockForVirtualProduct').hide();
});
$('li.tab-row a[id*="Shipping"]').hide();
$('#condition').attr('disabled', 'disabled');
$('#condition option[value=refurbished]').removeAttr('selected');
$('#condition option[value=used]').removeAttr('selected');
$('.stockForVirtualProduct').hide();
onTabLoad('Informations', function(){
$('#condition').attr('disabled', 'disabled');
$('#condition option[value=refurbished]').removeAttr('selected');
$('#condition option[value=used]').removeAttr('selected');
});
}
else
{
@@ -154,8 +154,8 @@
<input type="hidden" id="is_virtual" name="is_virtual" value="{$product->is_virtual}" />
<div>
<label>{l s='Does this product has an associated file?'}</label>
<label class="radio_check" style="width:50px"><input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}</label>
<label style="width:50px;"><input type="radio" value="0" id="virtual_good_file_2" name="is_virtual_file" {if !$product_downloaded}checked="checked"{/if} />{l s='No'}</label>
<label style="width:50px"><input type="radio" value="1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}</label>
<label style="width:50px;"><input type="radio" value="0" name="is_virtual_file" {if !$product_downloaded}checked="checked"{/if} />{l s='No'}</label>
</div><br />
<div class="separation"></div>
{if $download_product_file_missing}
@@ -208,7 +208,7 @@
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$product->productDownload->filename}" />
<label class="t">{l s='Link to the file:'}</label>
</td>
<td class="col-right">
<td class="col-right">
{$product->productDownload->getHtmlLink(false, true)}
<a onclick="return confirm('{l s='Delete this file'})')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>