[+] BO : Products add fileset for informations and prices tab

This commit is contained in:
Jerome Nadaud
2013-08-19 11:59:27 +02:00
parent f73f84dbf2
commit 0aa908bd25
5 changed files with 745 additions and 741 deletions
@@ -251,11 +251,11 @@
{* all input are here *}
<div class="row">
{foreach $product_tabs key=numStep item=tab}
<fieldset id="product-tab-content-{$tab.id}" class="{if !$tab.selected}not-loaded{/if} product-tab-content" {if !$tab.selected}style="display:none"{/if}>
<div id="product-tab-content-{$tab.id}" class="{if !$tab.selected}not-loaded{/if} product-tab-content" {if !$tab.selected}style="display:none"{/if}>
{if $tab.selected}
{$custom_form}
{/if}
</fieldset>
</div>
{/foreach}
</div>
@@ -28,404 +28,406 @@
{assign var=class_input_ajax value=''}
{/if}
<input type="hidden" name="submitted_tabs[]" value="Informations" />
<h3 class="tab">{l s='Info.'}</h3>
<div class="alert alert-info">{l s='Product global information'}</div>
<script type="text/javascript">
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
var PS_ALLOW_ACCENTED_CHARS_URL = 1;
{else}
var PS_ALLOW_ACCENTED_CHARS_URL = 0;
{/if}
{$combinationImagesJs}
{if $check_product_association_ajax}
var search_term = '';
$('document').ready( function() {
$(".check_product_name")
.autocomplete(
'{$link->getAdminLink('AdminProducts', true)|addslashes}', {
minChars: 3,
max: 10,
width: $(".check_product_name").width(),
selectFirst: false,
scroll: false,
dataType: "json",
formatItem: function(data, i, max, value, term) {
search_term = term;
// adding the little
if ($('.ac_results').find('.separation').length == 0)
$('.ac_results').css('background-color', '#EFEFEF')
.prepend('<div style="color:#585A69; padding:2px 5px">{l s='Use a product from the list'}<div class="separation"></div></div>');
return value;
},
parse: function(data) {
var mytab = new Array();
for (var i = 0; i < data.length; i++)
mytab[mytab.length] = { data: data[i], value: data[i].name };
return mytab;
},
extraParams: {
ajax: 1,
action: 'checkProductName',
id_lang: {$id_lang}
}
}
)
.result(function(event, data, formatted) {
// keep the searched term in the input
$('#name_{$id_lang}').val(search_term);
jConfirm('{l s='Do you want to use this product?'}&nbsp;<strong>'+data.name+'</strong>', '{l s='Confirmation'}', function(confirm){
if (confirm == true)
document.location.href = '{$link->getAdminLink('AdminProducts', true)}&updateproduct&id_product='+data.id_product;
else
return false;
});
});
});
{/if}
</script>
{if isset($display_common_field) && $display_common_field}
<div class="alert alert-block" style="display: block">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div>
{/if}
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Informations"}
<div id="warn_virtual_combinations" class="alert alert-block" style="display:none">{l s='You cannot use combinations with a virtual product.'}</div>
<div class="row">
<label class="control-label col-lg-3" for="simple_product">{$bullet_common_field} {l s='Type:'}</label>
<div class="col-lg-9">
<div class="radio">
<label for="simple_product">
<input type="radio" name="type_product" id="simple_product" value="{Product::PTYPE_SIMPLE}" {if $product_type == Product::PTYPE_SIMPLE}checked="checked"{/if} />
{l s='Product'}
</label>
</div>
<div class="radio">
<label for="pack_product">
<input type="radio" name="type_product" {if $is_in_pack}disabled="disabled"{/if} id="pack_product" value="{Product::PTYPE_PACK}" {if $product_type == Product::PTYPE_PACK}checked="checked"{/if} />
{l s='Pack'}
</label>
</div>
<div class="radio">
<label for="virtual_product">
<input type="radio" name="type_product" id="virtual_product" {if $is_in_pack}disabled="disabled"{/if} value="{Product::PTYPE_VIRTUAL}" {if $product_type == Product::PTYPE_VIRTUAL}checked="checked"{/if} />
{l s='Virtual Product (services, booking or downloadable products)'}
</label>
</div>
</div>
</div>
<hr/>
<div class="row">
<label class="control-label col-lg-3 required" for="name_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Invalid characters:'} &lt;&gt;;=#{}">
{l s='Name:'}
</span>
</label>
<div class="col-lg-5">
<div class="row">
{include file="controllers/products/input_text_lang.tpl"
languages=$languages
input_class="{$class_input_ajax}{if !$product->id}copy2friendlyUrl{/if} updateCurrentText"
input_value=$product->name
input_name="name"
}
</div>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="reference">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Special characters allowed:'} .-_#\">
{$bullet_common_field} {l s='Reference:'}
</span>
</label>
<div class="col-lg-5">
<input type="text" id="reference" name="reference" value="{$product->reference|htmlentitiesUTF8}" />
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="ean13">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='(Europe, Japan)'}">
{$bullet_common_field} {l s='EAN13 or JAN:'}
</span>
</label>
<div class="col-lg-3">
<input maxlength="13" type="text" id="ean13" name="ean13" value="{$product->ean13|htmlentitiesUTF8}" />
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="upc">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='(US, Canada)'}">
{$bullet_common_field} {l s='UPC:'}
</span>
</label>
<div class="col-lg-3">
<input maxlength="12" type="text" id="upc" name="upc" value="{$product->upc|escape:html:'UTF-8'}" />
</div>
</div>
<hr/>
{* status informations *}
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<div class="row">
<label class="control-label col-lg-3">{l s='Status:'}</label>
<div class="input-group col-lg-3">
<span class="switch prestashop-switch">
<input onclick="toggleDraftWarning(false);showOptions(true);showRedirectProductOptions(false);" type="radio" name="active" id="active_on" value="1" {if $product->active || !$product->isAssociatedToShop()}checked="checked" {/if} />
<label for="active_on" class="radioCheck">
<i class="icon-check-sign"></i> {l s='Enabled'}
</label>
<input onclick="toggleDraftWarning(true);showOptions(false);showRedirectProductOptions(true);" type="radio" name="active" id="active_off" value="0" {if !$product->active && $product->isAssociatedToShop()}checked="checked"{/if} />
<label for="active_off" class="radioCheck">
<i class="icon-ban-circle"></i> {l s='Disabled'}
</label>
<span class="slide-button btn btn-default"></span>
</span>
</div>
</div>
<div class="row redirect_product_options" style="display:none">
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<label class="control-label col-lg-3" for="redirect_type">{l s='Redirect:'}</label>
<div class="col-lg-5">
<select name="redirect_type" id="redirect_type">
<option value="404" {if $product->redirect_type == '404'} selected="selected" {/if}>{l s='No redirect (404)'}</option>
<option value="301" {if $product->redirect_type == '301'} selected="selected" {/if}>{l s='Redirect permanently (301)'}</option>
<option value="302" {if $product->redirect_type == '302'} selected="selected" {/if}>{l s='Redirect temporarily (302)'}</option>
</select>
</div>
</div>
<div class="row redirect_product_options" style="display:none">
<div class="col-lg-9 col-offset-3">
<div class="alert alert-info">
{l s='404 : Not Found = Product does not exist and no redirect'}<br/>
{l s='301 : Moved Permanently = Product Moved Permanently'}<br/>
{l s='302 : Moved Temporarily = Product moved temporarily'}
</div>
</div>
</div>
<div class="row redirect_product_options redirect_product_options_product_choise" style="display:none">
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<label class="control-label col-lg-3" for="related_product_autocomplete_input">{l s='Related product:'}</label>
<div class="col-lg-7">
<input type="hidden" value="" name="id_product_redirected" />
<div class="input-group">
<input type="text" id="related_product_autocomplete_input" autocomplete="off" class="ac_input" />
<span class="input-group-addon"><i class="icon-search"></i></span>
</div>
<span id="related_product_remove" style="display:none">
<a class="btn btn-default" href="#" onclick="removeRelatedProduct(); return false" id="related_product_remove_link">
<i class="icon-trash"></i>
</a>
</span>
<span id="related_product_name">{l s='No related product'}</span>
</div>
<script>
var no_related_product = '{l s='No related product'}';
var id_product_redirected = {$product->id_product_redirected|intval};
var product_name_redirected = '{$product_name_redirected|escape:html:'UTF-8'}';
</script>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="visibility" type="default"}
<label class="control-label col-lg-3" for="visibility">{l s='Visibility:'}</label>
<div class="col-lg-3">
<select name="visibility" id="visibility">
<option value="both" {if $product->visibility == 'both'}selected="selected"{/if} >{l s='Everywhere'}</option>
<option value="catalog" {if $product->visibility == 'catalog'}selected="selected"{/if} >{l s='Catalog only'}</option>
<option value="search" {if $product->visibility == 'search'}selected="selected"{/if} >{l s='Search only'}</option>
<option value="none" {if $product->visibility == 'none'}selected="selected"{/if}>{l s='Nowhere'}</option>
</select>
</div>
</div>
<div id="product_options" class="row" {if !$product->active}style="display:none"{/if} >
<div class="col-lg-12">
{if isset($display_multishop_checkboxes) && $display_multishop_checkboxes}
<div class="row multishop_product_checkbox">
{include file="controllers/products/multishop/checkbox.tpl" only_checkbox="true" field="available_for_order" type="default"}
{include file="controllers/products/multishop/checkbox.tpl" only_checkbox="true" field="show_price" type="show_price"}
{include file="controllers/products/multishop/checkbox.tpl" only_checkbox="true" field="online_only" type="default"}
</div>
<fieldset>
<input type="hidden" name="submitted_tabs[]" value="Informations" />
<h3 class="tab">{l s='Info.'}</h3>
<div class="alert alert-info">{l s='Product global information'}</div>
<script type="text/javascript">
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
var PS_ALLOW_ACCENTED_CHARS_URL = 1;
{else}
var PS_ALLOW_ACCENTED_CHARS_URL = 0;
{/if}
<div class="row">
<label class="control-label col-lg-3" for="available_for_order">{l s='Options:'}</label>
<div class="col-lg-5">
<p class="checkbox">
<input type="checkbox" name="available_for_order" id="available_for_order" value="1" {if $product->available_for_order}checked="checked"{/if} />
<label for="available_for_order" class="t">{l s='Available for order'}</label>
</p>
<p class="checkbox">
<input type="checkbox" name="show_price" id="show_price" value="1" {if $product->show_price}checked="checked"{/if} {if $product->available_for_order}disabled="disabled"{/if}/>
<label for="show_price" class="t">{l s='show price'}</label>
</p>
<p class="checkbox">
<input type="checkbox" name="online_only" id="online_only" value="1" {if $product->online_only}checked="checked"{/if} />
<label for="online_only" class="t">{l s='Online only (not sold in store)'}</label>
</p>
{$combinationImagesJs}
{if $check_product_association_ajax}
var search_term = '';
$('document').ready( function() {
$(".check_product_name")
.autocomplete(
'{$link->getAdminLink('AdminProducts', true)|addslashes}', {
minChars: 3,
max: 10,
width: $(".check_product_name").width(),
selectFirst: false,
scroll: false,
dataType: "json",
formatItem: function(data, i, max, value, term) {
search_term = term;
// adding the little
if ($('.ac_results').find('.separation').length == 0)
$('.ac_results').css('background-color', '#EFEFEF')
.prepend('<div style="color:#585A69; padding:2px 5px">{l s='Use a product from the list'}<div class="separation"></div></div>');
return value;
},
parse: function(data) {
var mytab = new Array();
for (var i = 0; i < data.length; i++)
mytab[mytab.length] = { data: data[i], value: data[i].name };
return mytab;
},
extraParams: {
ajax: 1,
action: 'checkProductName',
id_lang: {$id_lang}
}
}
)
.result(function(event, data, formatted) {
// keep the searched term in the input
$('#name_{$id_lang}').val(search_term);
jConfirm('{l s='Do you want to use this product?'}&nbsp;<strong>'+data.name+'</strong>', '{l s='Confirmation'}', function(confirm){
if (confirm == true)
document.location.href = '{$link->getAdminLink('AdminProducts', true)}&updateproduct&id_product='+data.id_product;
else
return false;
});
});
});
{/if}
</script>
{if isset($display_common_field) && $display_common_field}
<div class="alert alert-block" style="display: block">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div>
{/if}
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Informations"}
<div id="warn_virtual_combinations" class="alert alert-block" style="display:none">{l s='You cannot use combinations with a virtual product.'}</div>
<div class="row">
<label class="control-label col-lg-3" for="simple_product">{$bullet_common_field} {l s='Type:'}</label>
<div class="col-lg-9">
<div class="radio">
<label for="simple_product">
<input type="radio" name="type_product" id="simple_product" value="{Product::PTYPE_SIMPLE}" {if $product_type == Product::PTYPE_SIMPLE}checked="checked"{/if} />
{l s='Product'}
</label>
</div>
<div class="radio">
<label for="pack_product">
<input type="radio" name="type_product" {if $is_in_pack}disabled="disabled"{/if} id="pack_product" value="{Product::PTYPE_PACK}" {if $product_type == Product::PTYPE_PACK}checked="checked"{/if} />
{l s='Pack'}
</label>
</div>
<div class="radio">
<label for="virtual_product">
<input type="radio" name="type_product" id="virtual_product" {if $is_in_pack}disabled="disabled"{/if} value="{Product::PTYPE_VIRTUAL}" {if $product_type == Product::PTYPE_VIRTUAL}checked="checked"{/if} />
{l s='Virtual Product (services, booking or downloadable products)'}
</label>
</div>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="condition" type="default"}
<label class="control-label col-lg-3" for="condition">{l s='Condition:'}</label>
<div class="col-lg-3">
<select name="condition" id="condition">
<option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option>
<option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option>
<option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option>
</select>
</div>
<hr/>
<div class="row">
<label class="control-label col-lg-3 required" for="name_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Invalid characters:'} &lt;&gt;;=#{}">
{l s='Name:'}
</span>
</label>
<div class="col-lg-5">
<div class="row">
{include file="controllers/products/input_text_lang.tpl"
languages=$languages
input_class="{$class_input_ajax}{if !$product->id}copy2friendlyUrl{/if} updateCurrentText"
input_value=$product->name
input_name="name"
}
</div>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="reference">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Special characters allowed:'} .-_#\">
{$bullet_common_field} {l s='Reference:'}
</span>
</label>
<div class="col-lg-5">
<input type="text" id="reference" name="reference" value="{$product->reference|htmlentitiesUTF8}" />
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="ean13">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='(Europe, Japan)'}">
{$bullet_common_field} {l s='EAN13 or JAN:'}
</span>
</label>
<div class="col-lg-3">
<input maxlength="13" type="text" id="ean13" name="ean13" value="{$product->ean13|htmlentitiesUTF8}" />
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="upc">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='(US, Canada)'}">
{$bullet_common_field} {l s='UPC:'}
</span>
</label>
<div class="col-lg-3">
<input maxlength="12" type="text" id="upc" name="upc" value="{$product->upc|escape:html:'UTF-8'}" />
</div>
</div>
<hr/>
{* status informations *}
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<div class="row">
<label class="control-label col-lg-3">{l s='Status:'}</label>
<div class="input-group col-lg-3">
<span class="switch prestashop-switch">
<input onclick="toggleDraftWarning(false);showOptions(true);showRedirectProductOptions(false);" type="radio" name="active" id="active_on" value="1" {if $product->active || !$product->isAssociatedToShop()}checked="checked" {/if} />
<label for="active_on" class="radioCheck">
<i class="icon-check-sign"></i> {l s='Enabled'}
</label>
<input onclick="toggleDraftWarning(true);showOptions(false);showRedirectProductOptions(true);" type="radio" name="active" id="active_off" value="0" {if !$product->active && $product->isAssociatedToShop()}checked="checked"{/if} />
<label for="active_off" class="radioCheck">
<i class="icon-ban-circle"></i> {l s='Disabled'}
</label>
<span class="slide-button btn btn-default"></span>
</span>
</div>
</div>
<div class="row redirect_product_options" style="display:none">
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<label class="control-label col-lg-3" for="redirect_type">{l s='Redirect:'}</label>
<div class="col-lg-5">
<select name="redirect_type" id="redirect_type">
<option value="404" {if $product->redirect_type == '404'} selected="selected" {/if}>{l s='No redirect (404)'}</option>
<option value="301" {if $product->redirect_type == '301'} selected="selected" {/if}>{l s='Redirect permanently (301)'}</option>
<option value="302" {if $product->redirect_type == '302'} selected="selected" {/if}>{l s='Redirect temporarily (302)'}</option>
</select>
</div>
</div>
<div class="row redirect_product_options" style="display:none">
<div class="col-lg-9 col-offset-3">
<div class="alert alert-info">
{l s='404 : Not Found = Product does not exist and no redirect'}<br/>
{l s='301 : Moved Permanently = Product Moved Permanently'}<br/>
{l s='302 : Moved Temporarily = Product moved temporarily'}
</div>
</div>
</div>
</div>
<hr/>
<div class="row redirect_product_options redirect_product_options_product_choise" style="display:none">
{include file="controllers/products/multishop/checkbox.tpl" field="active" type="radio" onclick=""}
<label class="control-label col-lg-3" for="related_product_autocomplete_input">{l s='Related product:'}</label>
<div class="col-lg-7">
<input type="hidden" value="" name="id_product_redirected" />
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="description_short" type="tinymce" multilang="true"}
<label class="control-label col-lg-3" for="description_short_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Appears in the product list(s), and on the top of the product page.'}">
{l s='Short description:'}
</span>
</label>
<div class="col-lg-9">
{include
file="controllers/products/textarea_lang.tpl"
languages=$languages
input_name='description_short'
input_value=$product->description_short
max=$PS_PRODUCT_SHORT_DESC_LIMIT}
</div>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="description" type="tinymce" multilang="true"}
<label class="control-label col-lg-3" for="description_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Appears in the body of the product page'}">
{l s='Description:'}
</span>
</label>
<div class="col-lg-9">
{include
file="controllers/products/textarea_lang.tpl"
languages=$languages input_name='description'
input_value=$product->description}
</div>
</div>
{if $images}
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
{l s='Do you want an image associated with the product in your description?'}
<a class="addImageDescription" href="javascript:void(0);">{l s='Click here'}</a>.
</div>
</div>
</div>
<div id="createImageDescription" class="panel" style="display:none">
<div class="row">
<label class="control-label col-lg-3" for="smallImage_0">{l s='Select your image:'}</label>
<div class="col-lg-9">
<ul class="list-inline">
{foreach from=$images item=image key=key}
<li>
<input type="radio" name="smallImage" id="smallImage_{$key}" value="{$image.id_image}" {if $key == 0}checked="checked"{/if} >
<label for="smallImage_{$key}" class="t">
<img src="{$image.src}" alt="{$image.legend}" />
</label>
</li>
{/foreach}
</ul>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="leftRight_1">{l s='Position:'}</label>
<div class="col-lg-5">
<p class="checkbox">
<input type="radio" name="leftRight" id="leftRight_1" value="left" checked>
<label for="leftRight_1" class="t">{l s='left'}</label>
</p>
<p class="checkbox">
<input type="radio" name="leftRight" id="leftRight_2" value="right">
<label for="leftRight_2" class="t">{l s='right'}</label>
</p>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="imageTypes_0">{l s='Select the type of picture:'}</label>
<div class="col-lg-5">
{foreach from=$imagesTypes key=key item=type}
<p class="checkbox">
<input type="radio" name="imageTypes" id="imageTypes_{$key}" value="{$type.name}" {if $key == 0}checked="checked"{/if}>
<label for="imageTypes_{$key}" class="t">
{$type.name} <span>({$type.width}px {l s='by'} {$type.height}px)</span>
</label>
</p>
{/foreach}
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="resultImage">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='The tag to copy/paste into the description.'}">
{l s='Image tag to insert:'}
<div class="input-group">
<input type="text" id="related_product_autocomplete_input" autocomplete="off" class="ac_input" />
<span class="input-group-addon"><i class="icon-search"></i></span>
</div>
<span id="related_product_remove" style="display:none">
<a class="btn btn-default" href="#" onclick="removeRelatedProduct(); return false" id="related_product_remove_link">
<i class="icon-trash"></i>
</a>
</span>
</label>
<div class="col-lg-4">
<input type="text" id="resultImage" name="resultImage" />
<span id="related_product_name">{l s='No related product'}</span>
</div>
<p class="help-block"></p>
<script>
var no_related_product = '{l s='No related product'}';
var id_product_redirected = {$product->id_product_redirected|intval};
var product_name_redirected = '{$product_name_redirected|escape:html:'UTF-8'}';
</script>
</div>
</div>
{/if}
<div class="row">
<label class="control-label col-lg-3" for="tags_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Tags separated by commas (e.g. dvd, dvd player, hifi)'} - {l s='Forbidden characters:'} !&lt;;&gt;;?=+#&quot;&deg;{}_$%">
{l s='Tags:'}
</span>
</label>
<div class="col-lg-8">
<div class="row">
{foreach from=$languages item=language}
<div class="input-group col-lg-12 translatable-field lang-{$language.id_lang}" style="display: table;">
<input type="text" id="tags_{$language.id_lang}" class=" updateCurrentText" name="tags_{$language.id_lang}" value="{$product->getTags($language.id_lang, true)|htmlentitiesUTF8}">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.iso_code}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$languages item=language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">
<img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.iso_code}
</a>
</li>
{/foreach}
</ul>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="visibility" type="default"}
<label class="control-label col-lg-3" for="visibility">{l s='Visibility:'}</label>
<div class="col-lg-3">
<select name="visibility" id="visibility">
<option value="both" {if $product->visibility == 'both'}selected="selected"{/if} >{l s='Everywhere'}</option>
<option value="catalog" {if $product->visibility == 'catalog'}selected="selected"{/if} >{l s='Catalog only'}</option>
<option value="search" {if $product->visibility == 'search'}selected="selected"{/if} >{l s='Search only'}</option>
<option value="none" {if $product->visibility == 'none'}selected="selected"{/if}>{l s='Nowhere'}</option>
</select>
</div>
</div>
<div id="product_options" class="row" {if !$product->active}style="display:none"{/if} >
<div class="col-lg-12">
{if isset($display_multishop_checkboxes) && $display_multishop_checkboxes}
<div class="row multishop_product_checkbox">
{include file="controllers/products/multishop/checkbox.tpl" only_checkbox="true" field="available_for_order" type="default"}
{include file="controllers/products/multishop/checkbox.tpl" only_checkbox="true" field="show_price" type="show_price"}
{include file="controllers/products/multishop/checkbox.tpl" only_checkbox="true" field="online_only" type="default"}
</div>
{/if}
<div class="row">
<label class="control-label col-lg-3" for="available_for_order">{l s='Options:'}</label>
<div class="col-lg-5">
<p class="checkbox">
<input type="checkbox" name="available_for_order" id="available_for_order" value="1" {if $product->available_for_order}checked="checked"{/if} />
<label for="available_for_order" class="t">{l s='Available for order'}</label>
</p>
<p class="checkbox">
<input type="checkbox" name="show_price" id="show_price" value="1" {if $product->show_price}checked="checked"{/if} {if $product->available_for_order}disabled="disabled"{/if}/>
<label for="show_price" class="t">{l s='show price'}</label>
</p>
<p class="checkbox">
<input type="checkbox" name="online_only" id="online_only" value="1" {if $product->online_only}checked="checked"{/if} />
<label for="online_only" class="t">{l s='Online only (not sold in store)'}</label>
</p>
</div>
</div>
{/foreach}
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="condition" type="default"}
<label class="control-label col-lg-3" for="condition">{l s='Condition:'}</label>
<div class="col-lg-3">
<select name="condition" id="condition">
<option value="new" {if $product->condition == 'new'}selected="selected"{/if} >{l s='New'}</option>
<option value="used" {if $product->condition == 'used'}selected="selected"{/if} >{l s='Used'}</option>
<option value="refurbished" {if $product->condition == 'refurbished'}selected="selected"{/if}>{l s='Refurbished'}</option>
</select>
</div>
</div>
</div>
</div>
</div>
<hr/>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="description_short" type="tinymce" multilang="true"}
<label class="control-label col-lg-3" for="description_short_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Appears in the product list(s), and on the top of the product page.'}">
{l s='Short description:'}
</span>
</label>
<div class="col-lg-9">
{include
file="controllers/products/textarea_lang.tpl"
languages=$languages
input_name='description_short'
input_value=$product->description_short
max=$PS_PRODUCT_SHORT_DESC_LIMIT}
</div>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="description" type="tinymce" multilang="true"}
<label class="control-label col-lg-3" for="description_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Appears in the body of the product page'}">
{l s='Description:'}
</span>
</label>
<div class="col-lg-9">
{include
file="controllers/products/textarea_lang.tpl"
languages=$languages input_name='description'
input_value=$product->description}
</div>
</div>
{if $images}
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
{l s='Do you want an image associated with the product in your description?'}
<a class="addImageDescription" href="javascript:void(0);">{l s='Click here'}</a>.
</div>
</div>
</div>
<div id="createImageDescription" class="panel" style="display:none">
<div class="row">
<label class="control-label col-lg-3" for="smallImage_0">{l s='Select your image:'}</label>
<div class="col-lg-9">
<ul class="list-inline">
{foreach from=$images item=image key=key}
<li>
<input type="radio" name="smallImage" id="smallImage_{$key}" value="{$image.id_image}" {if $key == 0}checked="checked"{/if} >
<label for="smallImage_{$key}" class="t">
<img src="{$image.src}" alt="{$image.legend}" />
</label>
</li>
{/foreach}
</ul>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="leftRight_1">{l s='Position:'}</label>
<div class="col-lg-5">
<p class="checkbox">
<input type="radio" name="leftRight" id="leftRight_1" value="left" checked>
<label for="leftRight_1" class="t">{l s='left'}</label>
</p>
<p class="checkbox">
<input type="radio" name="leftRight" id="leftRight_2" value="right">
<label for="leftRight_2" class="t">{l s='right'}</label>
</p>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="imageTypes_0">{l s='Select the type of picture:'}</label>
<div class="col-lg-5">
{foreach from=$imagesTypes key=key item=type}
<p class="checkbox">
<input type="radio" name="imageTypes" id="imageTypes_{$key}" value="{$type.name}" {if $key == 0}checked="checked"{/if}>
<label for="imageTypes_{$key}" class="t">
{$type.name} <span>({$type.width}px {l s='by'} {$type.height}px)</span>
</label>
</p>
{/foreach}
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="resultImage">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='The tag to copy/paste into the description.'}">
{l s='Image tag to insert:'}
</span>
</label>
<div class="col-lg-4">
<input type="text" id="resultImage" name="resultImage" />
</div>
<p class="help-block"></p>
</div>
</div>
{/if}
<div class="row">
<label class="control-label col-lg-3" for="tags_{$id_lang}">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Tags separated by commas (e.g. dvd, dvd player, hifi)'} - {l s='Forbidden characters:'} !&lt;;&gt;;?=+#&quot;&deg;{}_$%">
{l s='Tags:'}
</span>
</label>
<div class="col-lg-8">
<div class="row">
{foreach from=$languages item=language}
<div class="input-group col-lg-12 translatable-field lang-{$language.id_lang}" style="display: table;">
<input type="text" id="tags_{$language.id_lang}" class=" updateCurrentText" name="tags_{$language.id_lang}" value="{$product->getTags($language.id_lang, true)|htmlentitiesUTF8}">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.iso_code}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$languages item=language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">
<img src="{$base_url}/img/l/{$language.id_lang|intval}.jpg" alt=""> {$language.iso_code}
</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/foreach}
</div>
</div>
</div>
</fieldset>
@@ -103,397 +103,396 @@ $(document).ready(function () {
Customer.init();
});
</script>
<fieldset>
<input type="hidden" name="submitted_tabs[]" value="Prices" />
<h3>{l s='Product price'}</h3>
<input type="hidden" name="submitted_tabs[]" value="Prices" />
<h3>{l s='Product price'}</h3>
<div class="alert alert-info">
{l s='You must enter either the pre-tax retail price, or the retail price with tax. The input field will be automatically calculated.'}
</div>
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Prices"}
{include file="controllers/products/multishop/checkbox.tpl" field="wholesale_price" type="default"}
<div class="row">
<label class="control-label col-lg-3" for="wholesale_price">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Wholesale price'}">
{l s='Pre-tax wholesale price:'}
</span>
</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input maxlength="14" name="wholesale_price" id="wholesale_price" type="text" value="{{toolsConvertPrice price=$product->wholesale_price}|string_format:'%.2f'}" onchange="this.value = this.value.replace(/,/g, '.');" />
<div class="alert alert-info">
{l s='You must enter either the pre-tax retail price, or the retail price with tax. The input field will be automatically calculated.'}
</div>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="price" type="price"}
<label class="control-label col-lg-3" for="priceTE">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='The pre-tax retail price to sell this product'}">
{l s='Pre-tax retail price:'}
</span>
</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input type="hidden" id="priceTEReal" name="price" value="{toolsConvertPrice price=$product->price}" />
<input size="11" maxlength="14" id="priceTE" name="price_displayed" type="text" value="{{toolsConvertPrice price=$product->price}|string_format:'%.2f'}" onchange="noComma('priceTE'); $('#priceTEReal').val(this.value);" onkeyup="$('#priceType').val('TE'); $('#priceTEReal').val(this.value.replace(/,/g, '.')); if (isArrowKey(event)) return; calcPriceTI();" />
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Prices"}
{include file="controllers/products/multishop/checkbox.tpl" field="wholesale_price" type="default"}
<div class="row">
<label class="control-label col-lg-3" for="wholesale_price">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='Wholesale price'}">
{l s='Pre-tax wholesale price:'}
</span>
</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input maxlength="14" name="wholesale_price" id="wholesale_price" type="text" value="{{toolsConvertPrice price=$product->wholesale_price}|string_format:'%.2f'}" onchange="this.value = this.value.replace(/,/g, '.');" />
</div>
</div>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="id_tax_rules_group" type="default"}
<label class="control-label col-lg-3" for="id_tax_rules_group">{l s='Tax rule:'}</label>
<div class="col-lg-8">
<script type="text/javascript">
noTax = {if $tax_exclude_taxe_option}true{else}false{/if};
taxesArray = new Array ();
taxesArray[0] = 0;
{foreach $tax_rules_groups as $tax_rules_group}
{if isset($taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']])}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = {$taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']]};
{else}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = 0;
{/if}
{/foreach}
ecotaxTaxRate = {$ecotaxTaxRate / 100};
</script>
<div class="row">
<div class="col-lg-6">
<select onChange="javascript:calcPrice(); unitPriceWithTax('unit');" name="id_tax_rules_group" id="id_tax_rules_group" {if $tax_exclude_taxe_option}disabled="disabled"{/if} >
<option value="0">{l s='No Tax'}</option>
{foreach from=$tax_rules_groups item=tax_rules_group}
<option value="{$tax_rules_group.id_tax_rules_group}" {if $product->getIdTaxRulesGroup() == $tax_rules_group.id_tax_rules_group}selected="selected"{/if} >
{$tax_rules_group['name']|htmlentitiesUTF8}
</option>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="price" type="price"}
<label class="control-label col-lg-3" for="priceTE">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='The pre-tax retail price to sell this product'}">
{l s='Pre-tax retail price:'}
</span>
</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input type="hidden" id="priceTEReal" name="price" value="{toolsConvertPrice price=$product->price}" />
<input size="11" maxlength="14" id="priceTE" name="price_displayed" type="text" value="{{toolsConvertPrice price=$product->price}|string_format:'%.2f'}" onchange="noComma('priceTE'); $('#priceTEReal').val(this.value);" onkeyup="$('#priceType').val('TE'); $('#priceTEReal').val(this.value.replace(/,/g, '.')); if (isArrowKey(event)) return; calcPriceTI();" />
</div>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="id_tax_rules_group" type="default"}
<label class="control-label col-lg-3" for="id_tax_rules_group">{l s='Tax rule:'}</label>
<div class="col-lg-8">
<script type="text/javascript">
noTax = {if $tax_exclude_taxe_option}true{else}false{/if};
taxesArray = new Array ();
taxesArray[0] = 0;
{foreach $tax_rules_groups as $tax_rules_group}
{if isset($taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']])}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = {$taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']]};
{else}
taxesArray[{$tax_rules_group.id_tax_rules_group}] = 0;
{/if}
{/foreach}
</select>
</div>
<div class="col-lg-2">
<a class="btn btn-link confirm_leave" href="{$link->getAdminLink('AdminTaxRulesGroup')|escape:'htmlall':'UTF-8'}&addtax_rules_group&id_product={$product->id}" {if $tax_exclude_taxe_option}disabled="disabled"{/if}>
<i class="icon-plus-sign"></i> {l s='Create new taxe'} <i class="icon-external-link-sign"></i>
</a>
ecotaxTaxRate = {$ecotaxTaxRate / 100};
</script>
<div class="row">
<div class="col-lg-6">
<select onChange="javascript:calcPrice(); unitPriceWithTax('unit');" name="id_tax_rules_group" id="id_tax_rules_group" {if $tax_exclude_taxe_option}disabled="disabled"{/if} >
<option value="0">{l s='No Tax'}</option>
{foreach from=$tax_rules_groups item=tax_rules_group}
<option value="{$tax_rules_group.id_tax_rules_group}" {if $product->getIdTaxRulesGroup() == $tax_rules_group.id_tax_rules_group}selected="selected"{/if} >
{$tax_rules_group['name']|htmlentitiesUTF8}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-2">
<a class="btn btn-link confirm_leave" href="{$link->getAdminLink('AdminTaxRulesGroup')|escape:'htmlall':'UTF-8'}&addtax_rules_group&id_product={$product->id}" {if $tax_exclude_taxe_option}disabled="disabled"{/if}>
<i class="icon-plus-sign"></i> {l s='Create new taxe'} <i class="icon-external-link-sign"></i>
</a>
</div>
</div>
</div>
</div>
</div>
{if $tax_exclude_taxe_option}
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
{l s='Taxes are currently disabled'} :
<a href="{$link->getAdminLink('AdminTaxes')|escape:'htmlall':'UTF-8'}">{l s='Tax options'}</a>
<input type="hidden" value="{$product->getIdTaxRulesGroup()}" name="id_tax_rules_group" />
{if $tax_exclude_taxe_option}
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
{l s='Taxes are currently disabled'} :
<a href="{$link->getAdminLink('AdminTaxes')|escape:'htmlall':'UTF-8'}">{l s='Tax options'}</a>
<input type="hidden" value="{$product->getIdTaxRulesGroup()}" name="id_tax_rules_group" />
</div>
</div>
</div>
</div>
{/if}
{/if}
<div class="row" {if !$ps_use_ecotax} style="display:none;"{/if}>
{include file="controllers/products/multishop/checkbox.tpl" field="ecot" type="default"}
<label class="control-label col-lg-3" for="ecotax">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='already included in price'}">
{l s='Eco-tax (tax incl.):'}
</span>
</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input maxlength="14" id="ecotax" name="ecotax" type="text" value="{$product->ecotax|string_format:'%.2f'}" onkeyup="$('#priceType').val('TI');if (isArrowKey(event))return; calcPriceTE(); this.value = this.value.replace(/,/g, '.'); if (parseInt(this.value) > getE('priceTE').value) this.value = getE('priceTE').value; if (isNaN(this.value)) this.value = 0;" />
</div>
</div>
<div class="row" {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none;"{/if} >
<label class="control-label col-lg-3" for="priceTI">{l s='Retail price with tax:'}</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input id="priceType" name="priceType" type="hidden" value="TE" />
<input maxlength="14" id="priceTI" type="text" value="" onchange="noComma('priceTI');" onkeyup="$('#priceType').val('TI');if (isArrowKey(event)) return; calcPriceTE();" />
</div>
</div>
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="unit_price" type="unit_price"}
<label class="control-label col-lg-3" for="unit_price">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='e.g. per lb.'}">
{l s='Unit price:'}
</span>
</label>
<div class="input-group col-lg-4">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input maxlength="14" id="unit_price" name="unit_price" type="text" value="{$unit_price|string_format:'%.2f'}" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>
<span class="input-group-addon">{l s='per'}</span>
<input maxlength="10" id="unity" name="unity" type="text" value="{$product->unity|htmlentitiesUTF8}" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/>
</div>
</div>
{if $ps_tax && $country_display_tax_label}
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
<span>{l s='or'}
{$currency->prefix}<span id="unit_price_with_tax">0.00</span>{$currency->suffix}
{l s='per'} <span id="unity_second">{$product->unity}</span> {l s='with tax'}
<div class="row" {if !$ps_use_ecotax} style="display:none;"{/if}>
{include file="controllers/products/multishop/checkbox.tpl" field="ecot" type="default"}
<label class="control-label col-lg-3" for="ecotax">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='already included in price'}">
{l s='Eco-tax (tax incl.):'}
</span>
</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input maxlength="14" id="ecotax" name="ecotax" type="text" value="{$product->ecotax|string_format:'%.2f'}" onkeyup="$('#priceType').val('TI');if (isArrowKey(event))return; calcPriceTE(); this.value = this.value.replace(/,/g, '.'); if (parseInt(this.value) > getE('priceTE').value) this.value = getE('priceTE').value; if (isNaN(this.value)) this.value = 0;" />
</div>
</div>
</div>
{/if}
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="on_sale" type="default"}
<div class="col-lg-9 col-offset-3">
<div class="checkbox">
<label class="control-label" for="on_sale" >
<input type="checkbox" name="on_sale" id="on_sale" {if $product->on_sale}checked="checked"{/if} value="1" />
{l s='Display the "on sale" icon on the product page, and in the text found within the product listing.'}
</label>
<div class="row" {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none;"{/if} >
<label class="control-label col-lg-3" for="priceTI">{l s='Retail price with tax:'}</label>
<div class="input-group col-lg-2">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input id="priceType" name="priceType" type="hidden" value="TE" />
<input maxlength="14" id="priceTI" type="text" value="" onchange="noComma('priceTI');" onkeyup="$('#priceType').val('TI');if (isArrowKey(event)) return; calcPriceTE();" />
</div>
</div>
</div>
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
<strong>{l s='Final retail price:'}</strong>
<span {if !$country_display_tax_label}style="display:none"{/if} >
{$currency->prefix}
<span id="finalPrice" >0.00</span>
{$currency->suffix}
<span {if $ps_tax}style="display:none;"{/if}> ({l s='tax incl.'})</span>
</span>
<span {if $ps_tax}style="display:none;"{/if} >
{if $country_display_tax_label}
/
{/if}
{$currency->prefix}
<span id="finalPriceWithoutTax"></span>
{$currency->suffix}
{if $country_display_tax_label}({l s='tax excl.'}){/if}
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="unit_price" type="unit_price"}
<label class="control-label col-lg-3" for="unit_price">
<span class="label-tooltip" data-toggle="tooltip"
title="{l s='e.g. per lb.'}">
{l s='Unit price:'}
</span>
</label>
<div class="input-group col-lg-4">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input maxlength="14" id="unit_price" name="unit_price" type="text" value="{$unit_price|string_format:'%.2f'}" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>
<span class="input-group-addon">{l s='per'}</span>
<input maxlength="10" id="unity" name="unity" type="text" value="{$product->unity|htmlentitiesUTF8}" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/>
</div>
</div>
</div>
{if $ps_tax && $country_display_tax_label}
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
<span>{l s='or'}
{$currency->prefix}<span id="unit_price_with_tax">0.00</span>{$currency->suffix}
{l s='per'} <span id="unity_second">{$product->unity}</span> {l s='with tax'}
</span>
</div>
</div>
</div>
{/if}
{*todo separate fieldset*}
<div class="row">
{include file="controllers/products/multishop/checkbox.tpl" field="on_sale" type="default"}
<div class="col-lg-9 col-offset-3">
<div class="checkbox">
<label class="control-label" for="on_sale" >
<input type="checkbox" name="on_sale" id="on_sale" {if $product->on_sale}checked="checked"{/if} value="1" />
{l s='Display the "on sale" icon on the product page, and in the text found within the product listing.'}
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-9 col-offset-3">
<div class="alert">
<strong>{l s='Final retail price:'}</strong>
<span {if !$country_display_tax_label}style="display:none"{/if} >
{$currency->prefix}
<span id="finalPrice" >0.00</span>
{$currency->suffix}
<span {if $ps_tax}style="display:none;"{/if}> ({l s='tax incl.'})</span>
</span>
<span {if $ps_tax}style="display:none;"{/if} >
{if $country_display_tax_label}
/
{/if}
{$currency->prefix}
<span id="finalPriceWithoutTax"></span>
{$currency->suffix}
{if $country_display_tax_label}({l s='tax excl.'}){/if}
</span>
</div>
</div>
</div>
</fieldset>
{if isset($specificPriceModificationForm)}
<h3>{l s='Specific prices'}</h3>
<fieldset>
<h3>{l s='Specific prices'}</h3>
<div class="alert alert-info">
{l s='You can set specific prices for clients belonging to different groups, different countries, etc...'}
</div>
<div class="row">
<div class="col-lg-12">
<a class="btn btn-default" href="#" id="show_specific_price">
<i class="icon-plus-sign"></i> {l s='Add a new specific price'}
</a>
<a class="btn btn-default" href="#" id="hide_specific_price" style="display:none">
<i class="icon-remove"></i> {l s='Cancel new specific price'}
</a>
<div class="alert alert-info">
{l s='You can set specific prices for clients belonging to different groups, different countries, etc...'}
</div>
</div>
<script type="text/javascript">
var product_prices = new Array();
{foreach from=$combinations item='combination'}
product_prices['{$combination.id_product_attribute}'] = '{$combination.price}';
{/foreach}
</script>
<div class="row">
<div class="col-lg-12">
<a class="btn btn-default" href="#" id="show_specific_price">
<i class="icon-plus-sign"></i> {l s='Add a new specific price'}
</a>
<a class="btn btn-default" href="#" id="hide_specific_price" style="display:none">
<i class="icon-remove"></i> {l s='Cancel new specific price'}
</a>
</div>
</div>
<div id="add_specific_price" class="well" style="display: none;">
<div class="col-lg-12">
<script type="text/javascript">
var product_prices = new Array();
{foreach from=$combinations item='combination'}
product_prices['{$combination.id_product_attribute}'] = '{$combination.price}';
{/foreach}
</script>
<div class="row">
<label class="control-label col-lg-3" for="{if !$multi_shop}spm_currency_0{else}sp_id_shop{/if}">{l s='For:'}</label>
<div class="col-lg-9">
<div class="row">
{if !$multi_shop}
<input type="hidden" name="sp_id_shop" value="0" />
{else}
<div class="col-lg-3">
<select name="sp_id_shop" id="sp_id_shop">
{if !$admin_one_shop}<option value="0">{l s='All shops'}</option>{/if}
{foreach from=$shops item=shop}
<option value="{$shop.id_shop}">{$shop.name|htmlentitiesUTF8}</option>
{/foreach}
</select>
</div>
{/if}
<div class="col-lg-3">
<select name="sp_id_currency" id="spm_currency_0" onchange="changeCurrencySpecificPrice(0);">
<option value="0">{l s='All currencies'}</option>
{foreach from=$currencies item=curr}
<option value="{$curr.id_currency}">{$curr.name|htmlentitiesUTF8}</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<select name="sp_id_country" id="sp_id_country">
<option value="0">{l s='All countries'}</option>
{foreach from=$countries item=country}
<option value="{$country.id_country}">{$country.name|htmlentitiesUTF8}</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<select name="sp_id_group" id="sp_id_group">
<option value="0">{l s='All groups'}</option>
{foreach from=$groups item=group}
<option value="{$group.id_group}">{$group.name}</option>
{/foreach}
</select>
<div id="add_specific_price" class="well" style="display: none;">
<div class="col-lg-12">
<div class="row">
<label class="control-label col-lg-3" for="{if !$multi_shop}spm_currency_0{else}sp_id_shop{/if}">{l s='For:'}</label>
<div class="col-lg-9">
<div class="row">
{if !$multi_shop}
<input type="hidden" name="sp_id_shop" value="0" />
{else}
<div class="col-lg-3">
<select name="sp_id_shop" id="sp_id_shop">
{if !$admin_one_shop}<option value="0">{l s='All shops'}</option>{/if}
{foreach from=$shops item=shop}
<option value="{$shop.id_shop}">{$shop.name|htmlentitiesUTF8}</option>
{/foreach}
</select>
</div>
{/if}
<div class="col-lg-3">
<select name="sp_id_currency" id="spm_currency_0" onchange="changeCurrencySpecificPrice(0);">
<option value="0">{l s='All currencies'}</option>
{foreach from=$currencies item=curr}
<option value="{$curr.id_currency}">{$curr.name|htmlentitiesUTF8}</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<select name="sp_id_country" id="sp_id_country">
<option value="0">{l s='All countries'}</option>
{foreach from=$countries item=country}
<option value="{$country.id_country}">{$country.name|htmlentitiesUTF8}</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<select name="sp_id_group" id="sp_id_group">
<option value="0">{l s='All groups'}</option>
{foreach from=$groups item=group}
<option value="{$group.id_group}">{$group.name}</option>
{/foreach}
</select>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="customer">{l s='Customer:'}</label>
<div class="col-lg-9">
<input type="hidden" name="sp_id_customer" id="id_customer" value="0" />
<input type="text" name="customer" value="{l s='All customers'}" id="customer" autocomplete="off" />
<div class="row">
<label class="control-label col-lg-3" for="customer">{l s='Customer:'}</label>
<div class="col-lg-9">
<input type="hidden" name="sp_id_customer" id="id_customer" value="0" />
<input type="text" name="customer" value="{l s='All customers'}" id="customer" autocomplete="off" />
</div>
<img src="../img/admin/field-loader.gif" id="customerLoader" alt="{l s='Loading...'}" style="display: none;" />
<div id="customers"></div>
</div>
<img src="../img/admin/field-loader.gif" id="customerLoader" alt="{l s='Loading...'}" style="display: none;" />
<div id="customers"></div>
</div>
{if $combinations|@count != 0}
<div class="row">
<label class="control-label col-lg-3" for="sp_id_product_attribute">{l s='Combination:'}</label>
<div class="col-lg-4">
<select id="sp_id_product_attribute" name="sp_id_product_attribute">
<option value="0">{l s='Apply to all combinations'}</option>
{foreach from=$combinations item='combination'}
<option value="{$combination.id_product_attribute}">{$combination.attributes}</option>
{/foreach}
</select>
{if $combinations|@count != 0}
<div class="row">
<label class="control-label col-lg-3" for="sp_id_product_attribute">{l s='Combination:'}</label>
<div class="col-lg-4">
<select id="sp_id_product_attribute" name="sp_id_product_attribute">
<option value="0">{l s='Apply to all combinations'}</option>
{foreach from=$combinations item='combination'}
<option value="{$combination.id_product_attribute}">{$combination.attributes}</option>
{/foreach}
</select>
</div>
</div>
</div>
{/if}
{/if}
<div class="row">
<label class="control-label col-lg-3" for="sp_from">{l s='Available from:'}</label>
<div class="input-group col-lg-4">
<input class="datepicker" type="text" name="sp_from" value="" style="text-align: center" id="sp_from" />
<span class="input-group-addon">{l s='to'}</span>
<input class="datepicker" type="text" name="sp_to" value="" style="text-align: center" id="sp_to" />
<div class="row">
<label class="control-label col-lg-3" for="sp_from">{l s='Available from:'}</label>
<div class="input-group col-lg-4">
<input class="datepicker" type="text" name="sp_from" value="" style="text-align: center" id="sp_from" />
<span class="input-group-addon">{l s='to'}</span>
<input class="datepicker" type="text" name="sp_to" value="" style="text-align: center" id="sp_to" />
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="sp_from_quantity">{l s='Starting at'}</label>
<div class="input-group col-lg-4">
<span class="input-group-addon">{l s='unit'}</span>
<input type="text" name="sp_from_quantity" id="sp_from_quantity" value="1" />
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="sp_price">{l s='Product price'}
{if $country_display_tax_label}
{l s='(tax excl.):'}
{/if}
</label>
<div class="col-lg-9">
<div class="row">
<div class="input-group col-lg-4">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input type="text" disabled="disabled" name="sp_price" id="sp_price" value="{$product->price|string_format:'%.2f'}" />
</div>
<div class="col-lg-8">
<p class="checkbox">
<label for="leave_bprice">{l s='Leave base price:'}</label>
<input id="leave_bprice" type="checkbox" value="1" checked="checked" name="leave_bprice" />
</p>
</div>
</div>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="sp_reduction">{l s='Apply a discount of:'}</label>
<div class="col-lg-4">
<div class="row">
<div class="col-lg-6">
<input type="text" name="sp_reduction" id="sp_reduction" value="0.00"/>
</div>
<div class="col-lg-6">
<select name="sp_reduction_type" id="sp_reduction_type">
<option selected="selected">---</option>
<option value="amount">{l s='Amount'}</option>
<option value="percentage">{l s='Percentage'}</option>
</select>
</div>
</div>
</div>
<p class="help-block">{l s='The discount is applied after the tax'}</p>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="sp_from_quantity">{l s='Starting at'}</label>
<div class="input-group col-lg-4">
<span class="input-group-addon">{l s='unit'}</span>
<input type="text" name="sp_from_quantity" id="sp_from_quantity" value="1" />
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="sp_price">{l s='Product price'}
{if $country_display_tax_label}
{l s='(tax excl.):'}
{/if}
</label>
<div class="col-lg-9">
<div class="row">
<div class="input-group col-lg-4">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
<input type="text" disabled="disabled" name="sp_price" id="sp_price" value="{$product->price|string_format:'%.2f'}" />
</div>
<div class="col-lg-8">
<p class="checkbox">
<label for="leave_bprice">{l s='Leave base price:'}</label>
<input id="leave_bprice" type="checkbox" value="1" checked="checked" name="leave_bprice" />
</p>
</div>
</div>
</div>
</div>
<div class="row">
<label class="control-label col-lg-3" for="sp_reduction">{l s='Apply a discount of:'}</label>
<div class="col-lg-4">
<div class="row">
<div class="col-lg-6">
<input type="text" name="sp_reduction" id="sp_reduction" value="0.00"/>
</div>
<div class="col-lg-6">
<select name="sp_reduction_type" id="sp_reduction_type">
<option selected="selected">---</option>
<option value="amount">{l s='Amount'}</option>
<option value="percentage">{l s='Percentage'}</option>
</select>
</div>
</div>
</div>
<p class="help-block">{l s='The discount is applied after the tax'}</p>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
product_prices['0'] = $('#sp_current_ht_price').html();
$('#id_product_attribute').change(function() {
$('#sp_current_ht_price').html(product_prices[$('#id_product_attribute option:selected').val()]);
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
product_prices['0'] = $('#sp_current_ht_price').html();
$('#id_product_attribute').change(function() {
$('#sp_current_ht_price').html(product_prices[$('#id_product_attribute option:selected').val()]);
});
$('#leave_bprice').click(function() {
if (this.checked)
$('#sp_price').attr('disabled', 'disabled');
else
$('#sp_price').removeAttr('disabled');
});
$('.datepicker').datetimepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
// Define a custom regional settings in order to use PrestaShop translation tools
currentText: '{l s='Now'}',
closeText: '{l s='Done'}',
ampm: false,
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
timeFormat: 'hh:mm:ss tt',
timeSuffix: '',
timeOnlyTitle: '{l s='Choose Time'}',
timeText: '{l s='Time'}',
hourText: '{l s='Hour'}',
minuteText: '{l s='Minute'}',
});
});
$('#leave_bprice').click(function() {
if (this.checked)
$('#sp_price').attr('disabled', 'disabled');
else
$('#sp_price').removeAttr('disabled');
});
$('.datepicker').datetimepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd',
// Define a custom regional settings in order to use PrestaShop translation tools
currentText: '{l s='Now'}',
closeText: '{l s='Done'}',
ampm: false,
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
timeFormat: 'hh:mm:ss tt',
timeSuffix: '',
timeOnlyTitle: '{l s='Choose Time'}',
timeText: '{l s='Time'}',
hourText: '{l s='Hour'}',
minuteText: '{l s='Minute'}',
});
});
</script>
</script>
<table id="specific_prices_list" class="table">
<thead>
<tr>
<th class="cell border" >{l s='Rule'}</th>
<th class="cell border" >{l s='Combination'}</th>
{if $multi_shop}<th>{l s='Shop'}</th>{/if}
<th class="cell border">{l s='Currency'}</th>
<th class="cell border">{l s='Country'}</th>
<th class="cell border">{l s='Group'}</th>
<th class="cell border">{l s='Customer'}</th>
<th class="cell border">{l s='Fixed price'}</th>
<th class="cell border">{l s='Impact'}</th>
<th class="cell border">{l s='Period'}</th>
<th class="cell border">{l s='From (quantity)'}</th>
<th class="cell border">{l s='Action'}</th>
</tr>
</thead>
<tbody>
{$specificPriceModificationForm}
<script type="text/javascript">
$(document).ready(function() {
calcPriceTI();
unitPriceWithTax('unit');
});
</script>
{/if}
<table id="specific_prices_list" class="table">
<thead>
<tr>
<th class="cell border" >{l s='Rule'}</th>
<th class="cell border" >{l s='Combination'}</th>
{if $multi_shop}<th>{l s='Shop'}</th>{/if}
<th class="cell border">{l s='Currency'}</th>
<th class="cell border">{l s='Country'}</th>
<th class="cell border">{l s='Group'}</th>
<th class="cell border">{l s='Customer'}</th>
<th class="cell border">{l s='Fixed price'}</th>
<th class="cell border">{l s='Impact'}</th>
<th class="cell border">{l s='Period'}</th>
<th class="cell border">{l s='From (quantity)'}</th>
<th class="cell border">{l s='Action'}</th>
</tr>
</thead>
<tbody>
{$specificPriceModificationForm}
<script type="text/javascript">
$(document).ready(function() {
delete_price_rule = '{l s="Do you really want to remove this price rule?"}';
calcPriceTI();
unitPriceWithTax('unit');
});
</script>
{/if}
@@ -3275,8 +3275,9 @@ class AdminProductsControllerCore extends AdminController
}
}
$content .= '
</tbody>
</table>';
</tbody>
</table>
</fieldset>';
$content .= '
<script type="text/javascript">
@@ -3303,7 +3304,7 @@ class AdminProductsControllerCore extends AdminController
// Reindex array starting from 0
$specific_price_priorities = array_values($specific_price_priorities);
$content .= '
$content .= '<fieldset>
<h3>'.$this->l('Priority management').'</h3>
<div class="alert alert-info">
'.$this->l('Sometimes one customer can fit into multiple price rules. Priorities allow you to define which rule applies to the customer.').'
@@ -3350,6 +3351,7 @@ class AdminProductsControllerCore extends AdminController
</p>
</div>
</div>
</fieldset>
';
return $content;
}
+2 -1
View File
@@ -553,7 +553,8 @@ product_tabs['Prices'] = new function(){
this.bindDelete = function(){
$('#specific_prices_list').delegate('a[name="delete_link"]', 'click', function(e){
e.preventDefault();
self.deleteSpecificPrice(this.href, $(this).parents('tr'));
if (confirm(delete_price_rule))
self.deleteSpecificPrice(this.href, $(this).parents('tr'));
})
};