// More BO product page cleanup
This commit is contained in:
@@ -92,109 +92,28 @@
|
||||
$('#product-tab-content-wait').show();
|
||||
var post_data = {$post_data};
|
||||
|
||||
var product_type;
|
||||
{*var is_pack = {$is_pack};
|
||||
var is_virtual = {$product->is_virtual};
|
||||
var mce_maximum = '{l s='Maximum'}';
|
||||
var product_type = {$product_type};
|
||||
{*var mce_maximum = '{l s='Maximum'}';
|
||||
var mce_characters = '{l s='characters'}';*}
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
product_type = $("input[name=type_product]:checked").val();
|
||||
$('#product-tab-content-wait').show();
|
||||
{if $is_pack}
|
||||
tabs_manager.onLoad('Informations', function(){
|
||||
$('#pack_product').attr('checked', 'checked');
|
||||
});
|
||||
//product_type = $("input[name=type_product]:checked").val();
|
||||
if (product_type == product_type_pack)
|
||||
{
|
||||
$('li.tab-row a[id*="VirtualProduct"]').hide();
|
||||
{elseif $product->is_virtual}
|
||||
tabs_manager.onLoad('Informations', function(){
|
||||
$('#virtual_product').attr('checked', 'checked');
|
||||
$('#condition').attr('disabled', 'disabled');
|
||||
$('#condition option[value=new]').attr('selected', 'selected');
|
||||
});
|
||||
}
|
||||
else if (product_type == product_type_virtual)
|
||||
{
|
||||
$('li.tab-row a[id*="Pack"]').hide();
|
||||
$('li.tab-row a[id*="Shipping"]').hide();
|
||||
{else}
|
||||
tabs_manager.onLoad('Informations', function(){
|
||||
$('#simple_product').attr('checked', 'checked');
|
||||
});
|
||||
$('li.tab-row a[id*="Pack"]').hide();
|
||||
$('li.tab-row a[id*="VirtualProduct"]').hide();
|
||||
{/if}
|
||||
|
||||
$('input[name="type_product"]').live('click', function()
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reset settings
|
||||
$('li.tab-row a[id*="Pack"]').hide();
|
||||
$('li.tab-row a[id*="VirtualProduct"]').hide();
|
||||
$('div.ppack').hide();
|
||||
$('#is_virtual_good').removeAttr('checked');
|
||||
$('div.is_virtual_good').hide();
|
||||
$('#is_virtual').val(0);
|
||||
$("#virtual_good_attributes").hide();
|
||||
|
||||
// product_type is now global
|
||||
product_type = $(this).val();
|
||||
|
||||
// until a product is added in the pack
|
||||
// if product is PTYPE_PACK, save buttons will be disabled
|
||||
if (product_type == {Product::PTYPE_PACK})
|
||||
{
|
||||
//when you change the type of the product, directly go to the pack tab
|
||||
$('li.tab-row a[id*="Pack"]').show().click();
|
||||
$('#ppack').val(1).attr('checked', true).attr('disabled', 'disabled');
|
||||
$('#ppackdiv').show();
|
||||
// If the pack tab has not finished loaded the changes will be made when the loading event is triggered
|
||||
$("#product-tab-content-Pack").bind('loaded', function(){
|
||||
$('#ppack').val(1).attr('checked', true).attr('disabled', 'disabled');
|
||||
$('#ppackdiv').show();
|
||||
});
|
||||
$("#product-tab-content-Quantities").bind('loaded', function(){
|
||||
$('.stockForVirtualProduct').show();
|
||||
});
|
||||
|
||||
$('li.tab-row a[id*="Shipping"]').show();
|
||||
$('#condition').removeAttr('disabled');
|
||||
$('#condition option[value=new]').removeAttr('selected');
|
||||
$('.stockForVirtualProduct').show();
|
||||
// if pack is enabled, if you choose pack, automatically switch to pack page
|
||||
}
|
||||
else if (product_type == {Product::PTYPE_VIRTUAL})
|
||||
{
|
||||
$('li.tab-row a[id*="VirtualProduct"]').show().click();
|
||||
|
||||
tabs_manager.onLoad('VirtualProduct', function(){
|
||||
$('#is_virtual_good').attr('checked', true);
|
||||
$('#virtual_good').show();
|
||||
$('#is_virtual').val(1);
|
||||
$("#virtual_good_attributes").show();
|
||||
});
|
||||
|
||||
tabs_manager.onLoad('Quantities', function(){
|
||||
$('.stockForVirtualProduct').hide();
|
||||
});
|
||||
|
||||
$('li.tab-row a[id*="Shipping"]').hide();
|
||||
|
||||
tabs_manager.onLoad('Informations', function(){
|
||||
$('#condition').attr('disabled', 'disabled');
|
||||
$('#condition option[value=refurbished]').removeAttr('selected');
|
||||
$('#condition option[value=used]').removeAttr('selected');
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// 3rd case : product_type is PTYPE_SIMPLE (0)
|
||||
$('li.tab-row a[id*="Shipping"]').show();
|
||||
$('#condition').removeAttr('disabled');
|
||||
$('#condition option[value=new]').removeAttr('selected');
|
||||
$('.stockForVirtualProduct').show();
|
||||
}
|
||||
// this handle the save button displays and warnings
|
||||
handleSaveButtons();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$('#desc-product-newCombination').hide();
|
||||
|
||||
|
||||
@@ -34,11 +34,11 @@
|
||||
|
||||
<div>
|
||||
<label class="text">{l s='Type:'}</label>
|
||||
<input type="radio" name="type_product" id="simple_product" value="{Product::PTYPE_SIMPLE}" {if (isset($smarty.post.type_product) && Product::PTYPE_SIMPLE == $smarty.post.type_product)}checked="checked"{/if} />
|
||||
<input type="radio" name="type_product" id="simple_product" value="{Product::PTYPE_SIMPLE}" {if $product_type == Product::PTYPE_SIMPLE}checked="checked"{/if} />
|
||||
<label class="radioCheck" for="simple_product">{l s='Product'}</label>
|
||||
<input type="radio" name="type_product" id="pack_product" value="{Product::PTYPE_PACK}" {if $is_pack || (isset($smarty.post.type_product) && Product::PTYPE_PACK == $smarty.post.type_product)}checked="checked"{/if} />
|
||||
<input type="radio" name="type_product" id="pack_product" value="{Product::PTYPE_PACK}" {if $product_type == Product::PTYPE_PACK}checked="checked"{/if} />
|
||||
<label class="radioCheck" for="pack_product">{l s='Pack'}</label>
|
||||
<input type="radio" name="type_product" id="virtual_product" value="{Product::PTYPE_VIRTUAL}" {if (isset($smarty.post.type_product) && Product::PTYPE_VIRTUAL == $smarty.post.type_product)}checked="checked"{/if} />
|
||||
<input type="radio" name="type_product" id="virtual_product" value="{Product::PTYPE_VIRTUAL}" {if $product_type == Product::PTYPE_VIRTUAL}checked="checked"{/if} />
|
||||
<label class="radioCheck" for="virtual_product">{l s='Virtual Product (services, booking and downloadable products)'}</label>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
<tr>
|
||||
<td>
|
||||
<div class="ppack">
|
||||
<input type="checkbox" name="ppack" id="ppack" value="1" {if $is_pack}checked="checked"{/if} onclick="$('#ppackdiv').slideToggle();" />
|
||||
<input type="checkbox" name="ppack" id="ppack" value="1" {if $product_type == Product::PTYPE_PACK}checked="checked"{/if} onclick="$('#ppackdiv').slideToggle();" />
|
||||
<label class="t" for="ppack">{l s='Pack'}</label>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div id="ppackdiv" {if !$is_pack}style="display: none;"{/if}>
|
||||
<div id="ppackdiv" {if !($product_type == Product::PTYPE_PACK)}style="display: none;"{/if}>
|
||||
|
||||
<label for="curPackItemName" style="width:560px;text-align:left;">
|
||||
{l s='Begin typing the first letters of the product name, then select the product from the drop-down list:'}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{* BEGIN CUSTOMER AUTO-COMPLETE / TO REFACTO *}
|
||||
|
||||
<script type="text/javascript">
|
||||
var Customer = {
|
||||
"hiddenField": jQuery('#id_customer'),
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
$('#is_virtual_file_product').hide();
|
||||
}
|
||||
|
||||
$('input[name=is_virtual_file]').live('change', function() {
|
||||
$('input[name=is_virtual_file]').live('change', function(e) {
|
||||
if($(this).val() == '1')
|
||||
{
|
||||
$('#virtual_good_more').show();
|
||||
|
||||
Reference in New Issue
Block a user