Merge branch 'master' into frontend
Conflicts: templates/default/layout.tpl
This commit is contained in:
@@ -151,7 +151,7 @@
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="pcc6" role="ADMIN" resource="admin.configuration.mailing-system" access="VIEW"}
|
||||
{* {loop type="auth" name="pcc6" role="ADMIN" resource="admin.configuration.mailing-system" access="VIEW"}
|
||||
<tr>
|
||||
<td><a href="{url path='/admin/configuration/mailing_system'}">{intl l='Mailing system'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/mailing_system'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
@@ -170,7 +170,7 @@
|
||||
<td><a href="{url path='/admin/configuration/system_logs'}">{intl l='System logs'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/system_logs'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
{/loop}*}
|
||||
|
||||
{module_include location='system_configuration_bottom'}
|
||||
</table>
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
<select name="{$name}" id="type" class="col-md-12 form-control">
|
||||
<option value="-1" data-description="">{intl l='Please select a coupon type'}</option>
|
||||
{foreach from=$availableCoupons item=availableCoupon}
|
||||
<option value="{$availableCoupon.serviceId}" data-description="{$availableCoupon.toolTip}" {if $value == $availableCoupon.serviceId}selected{/if}>
|
||||
<option value="{$availableCoupon.serviceId}" {if $value == $availableCoupon.serviceId}selected{/if}>
|
||||
{$availableCoupon.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{intl l="Current version"}</th>
|
||||
<td>V2.0.0-beta</td>
|
||||
<td>{$THELIA_VERSION}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{intl l="Latest version available"}</th>
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="VIEW"}
|
||||
{* {loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="VIEW"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Read the documentation of this module'}" href="{url path="/admin/module/documentation/$ID"}"><span class="glyphicon glyphicon-book"></span></a>
|
||||
{/loop}
|
||||
{/loop}*}
|
||||
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.modules" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this module'}" href="{url path="/admin/module/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<select id="tax_rule_field" required="required" name="{$name}" class="form-control">
|
||||
<option value="">{intl l="Select a tax tule"}</option>
|
||||
{loop name="tax" type="tax-rule" backend_context="1"}
|
||||
<option value="{$ID}" {if $IS_DEFAULT}selected="selected"{/if}>{$TITLE}</option>
|
||||
<option value="{$ID}" {if $ID == $TAX_RULE_ID}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
@@ -115,7 +115,7 @@
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="use_exchange_rate_box" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
|
||||
<input type="checkbox" data-pse-id="{$default_product_sale_element_id}" class="use_exchange_rate_box" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
|
||||
{$label}
|
||||
</label>
|
||||
</div>
|
||||
@@ -129,19 +129,21 @@
|
||||
<label for="price_without_tax" class="control-label">{$label} : </label>
|
||||
|
||||
<div class="input-group">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-price-type="without-tax" data-rel-price="price_with_tax" type="text" id="price_without_tax" required="required" name="{$name}" class="automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Price excl. taxes'}">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="price-without-tax" data-rel-price="price_with_tax" type="text" id="price_without_tax" required="required" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Price excl. taxes'}">
|
||||
<span class="input-group-addon">{$currency_symbol}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="price_with_tax" class="control-label">{intl l="Product price including taxes"} : </label>
|
||||
<div class="input-group">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-price-type="with-tax" data-rel-price="price_without_tax" type="text" id="price_with_tax" name="price_with_tax" class="automatic_price_field form-control" value="" title="{intl l='Product price including taxes'}" placeholder="{intl l='Price incl. taxes'}">
|
||||
<span class="input-group-addon">{$currency_symbol}</span>
|
||||
</div>
|
||||
</div>
|
||||
{form_field form=$form field='price_with_tax'}
|
||||
<div class="form-group">
|
||||
<label for="price_with_tax" class="control-label">{intl l="Product price including taxes"} : </label>
|
||||
<div class="input-group">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="price-with-tax" data-rel-price="price_without_tax" type="text" id="price_with_tax" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$value}" placeholder="{intl l='Price incl. taxes'}">
|
||||
<span class="input-group-addon">{$currency_symbol}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{module_include location='product_details_pricing_form'}
|
||||
</div>
|
||||
@@ -203,19 +205,21 @@
|
||||
<label for="sale_price_without_tax" class="control-label">{$label} : </label>
|
||||
|
||||
<div class="input-group">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-price-type="without-tax" data-rel-price="sale_price_with_tax" type="text" id="sale_price_without_tax" required="required" name="{$name}" class="automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product price'}">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="sale-price-without-tax" data-rel-price="sale_price_with_tax" type="text" id="sale_price_without_tax" required="required" name="{$name}" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product price'}">
|
||||
<span class="input-group-addon">{$currency_symbol}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='sale_price_with_tax'}
|
||||
<div class="form-group">
|
||||
<label for="sale_price_with_tax" class="control-label">{intl l="Sale price including taxes"} : </label>
|
||||
<label for="sale_price_with_tax" class="control-label">{$label} : </label>
|
||||
<div class="input-group">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-price-type="with-tax" data-rel-price="sale_price_without_tax" type="text" id="sale_price_with_tax" name="sale_price_with_tax" class="automatic_price_field form-control" value="" title="{intl l='Sale price including taxes'}" placeholder="{intl l='Sale price incl. taxes'}">
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-pse-id="{$default_product_sale_element_id}" data-price-type="sale-price-with-tax" data-rel-price="sale_price_without_tax" type="text" id="sale_price_with_tax" name="sale_price_with_tax" class="price_field automatic_price_field form-control" value="{$value}" title="{$label}" placeholder="{intl l='Sale price incl. taxes'}">
|
||||
<span class="input-group-addon">{$currency_symbol}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='onsale'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
@@ -253,37 +257,79 @@
|
||||
|
||||
{form name="thelia.admin.product_sale_element.update"}
|
||||
<form method="POST" action="{url path='/admin/product/combinations/update'}" {form_enctype form=$form}>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{include
|
||||
file = "includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons = false
|
||||
show_currencies = true
|
||||
page_url = "{url path='/admin/products/update' product_id=$ID}"
|
||||
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
|
||||
}
|
||||
|
||||
{include
|
||||
file = "includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons = false
|
||||
show_currencies = true
|
||||
page_url = "{url path='/admin/products/update' product_id=$ID}"
|
||||
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
|
||||
}
|
||||
{* Be sure to get the product ID, even if the form could not be validated *}
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
<input type="hidden" name="current_tab" value="details" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{form_field form=$form field='tax_rule'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="tax_rule_field" class="control-label">{$label} : </label>
|
||||
<div class="form-group">
|
||||
<select id="tax_rule_field" required="required" name="{$name}" class="form-control">
|
||||
<option value="">{intl l="Select a tax tule"}</option>
|
||||
{loop name="tax" type="tax-rule" backend_context="1"}
|
||||
<option value="{$ID}" {if $IS_DEFAULT}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='product_id'}
|
||||
<input type="hidden" name="{$name}" value="{$value}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
|
||||
{/form_field}
|
||||
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
|
||||
{loop type="currency" name="get-currency-symbol" id=$edit_currency_id backend_context="1"}
|
||||
{$currency_symbol = $SYMBOL}
|
||||
{$current_currency_is_default = $IS_DEFAULT}
|
||||
|
||||
{form_field form=$form field='currency'}
|
||||
<input type="hidden" name="{$name}" value="{$ID}" />
|
||||
{/form_field}
|
||||
{/loop}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{form_field form=$form field='tax_rule'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="tax_rule_field" class="control-label">{$label} : </label>
|
||||
<div class="form-group">
|
||||
<select id="tax_rule_field" required="required" name="{$name}" class="form-control">
|
||||
<option value="">{intl l="Select a tax tule"}</option>
|
||||
{loop name="tax" type="tax-rule" backend_context="1"}
|
||||
<option value="{$ID}" {if $ID == $TAX_RULE_ID}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{form_field form=$form field='use_exchange_rate'}
|
||||
{if $current_currency_is_default}
|
||||
<input type="hidden" name="{$name}" value="0">
|
||||
{$show_pricing_fields = true}
|
||||
{else}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label> </label>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" class="use_exchange_rate_box" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
|
||||
{$label}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{$show_pricing_fields = ($value == 0)}
|
||||
{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='product_before_combinations'}
|
||||
|
||||
@@ -294,6 +340,9 @@
|
||||
{module_include location='product_combinations_list_caption'}
|
||||
|
||||
{loop type="auth" name="can_create" role="ADMIN" resource="admin.product" access="UPDATE"}
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Quickly create combinations using the combination builder'}" href="#combination_generator_dialog" data-toggle="modal">
|
||||
{intl l='Combination builder'}
|
||||
</a>
|
||||
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new combination'}" href="#combination_creation_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus-sign"></span>
|
||||
</a>
|
||||
@@ -318,43 +367,91 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="product.sales.elements" type="product_sale_elements" product=$product_id currency=$edit_currency_id backend_context="1"}
|
||||
{* Get number of PSE defined, assumin the form have the same number of values for each fields *}
|
||||
|
||||
{form_field form=$form field='product_sale_element_id' value_key=0}
|
||||
{$pse_count = $total_value_count}
|
||||
{/form_field}
|
||||
|
||||
{for $idx = 0 to $total_value_count-1}
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
{$ID}: {loop name="product.sales.elements.combinations" type="attribute_combination" product_sale_elements=$ID backend_context="1"}
|
||||
{if $LOOP_COUNT > 1} - {/if}{$ATTRIBUTE_TITLE}
|
||||
{/loop}
|
||||
|
||||
{form_field form=$form field='product_sale_element_id' value_key=$idx}
|
||||
<input type="hidden" name="{$name}" value="{$value}" />
|
||||
|
||||
{$current_pse_id = $value}
|
||||
|
||||
{$current_pse_id}: {loop name="product.sales.elements.combinations" type="attribute_combination" product_sale_elements=$current_pse_id backend_context="1"}
|
||||
{if $LOOP_COUNT > 1} - {/if}{$ATTRIBUTE_TITLE}
|
||||
{/loop}
|
||||
{/form_field}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td><input class="form-control text-right" type="text" name="quantity[{$ID}]" value="{$REF}" /></td>
|
||||
<td><input class="form-control text-right" type="text" name="quantity[{$ID}]" value="{$EAN_CODE}" /></td>
|
||||
<td><input class="form-control text-right" type="text" name="quantity[{$ID}]" value="{$QUANTITY}" /></td>
|
||||
<td><input class="form-control text-right" type="text" name="price_wo_taxes[{$ID}]" value="{format_number number=$PRICE}" /></td>
|
||||
<td><input class="form-control text-right" type="text" name="price_w_taxes[{$ID}]" value="{format_number number=$TAXED_PRICE}" /></td>
|
||||
<td><input class="form-control text-right col-lg-1" type="text" name="weight[{$ID}]" value="{$WEIGHT}" /></td>
|
||||
<tr>
|
||||
{form_field form=$form field='reference' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}><input class="form-control" type="text" name="{$name}" value="{$value}" /></td>
|
||||
{/form_field}
|
||||
|
||||
<td class="text-center">
|
||||
<input class="form-control" type="radio" name="default" value="{$ID}" {if $IS_DEFAULT}checked="checked"{/if}/>
|
||||
{form_field form=$form field='ean_code' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}><input class="form-control" type="text" name="{$name}" value="{$value}" /></td>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='quantity' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}>
|
||||
<input class="form-control text-right" required type="text" name="{$name}" value="{$value}" />
|
||||
</td>
|
||||
{/form_field}
|
||||
|
||||
<td class="text-center">
|
||||
<input class="form-control" type="checkbox" name="on_sale[{$ID}]" value="{$ID}" {if $IS_PROMO}checked="checked"{/if}/>
|
||||
</td>
|
||||
{form_field form=$form field='price' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} required data-price-type="price-without-tax" data-rel-price="price_with_tax_{$idx}" id="price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right" required type="text" name="{$name}" value="{$value}" /></td>
|
||||
{/form_field}
|
||||
|
||||
<td class="text-center">
|
||||
<input class="form-control" type="checkbox" name="is_new[{$ID}]" value="{$ID}" {if $IS_NEW}checked="checked"{/if}/>
|
||||
</td>
|
||||
{form_field form=$form field='price_with_tax' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}><input {if !$show_pricing_fields}readonly{/if} data-price-type="price-with-tax" data-rel-price="price_without_tax_{$idx}" id="price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" /></td>
|
||||
{/form_field}
|
||||
|
||||
<td><input class="form-control text-right" type="text" name="sale_price_wo_taxes[{$ID}]" value="{format_number number=$PROMO_PRICE}" /></td>
|
||||
<td><input class="form-control text-right" type="text" name="sale_price_w_taxes[{$ID}]" value="{format_number number=$TAXED_PROMO_PRICE}" /></td>
|
||||
{form_field form=$form field='weight' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}><input required class="form-control text-right" required type="text" name="{$name}" value="{$value}" /></td>
|
||||
{/form_field}
|
||||
|
||||
<td class="actions">
|
||||
<a class="btn btn-default btn-xs combination-delete" title="{intl l='Delete this combination'}" href="#combination_delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{form_field form=$form field='default_pse'}
|
||||
<td class="{if $error}has-error {/if}text-center">
|
||||
<input class="form-control" type="radio" name="{$name}" value="{$current_pse_id}" {if $value == $current_pse_id}checked="checked"{/if}/>
|
||||
</td>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='onsale' value_key=$idx}
|
||||
<td class="{if $error}has-error {/if}text-center">
|
||||
<input class="form-control" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
|
||||
</td>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='isnew' value_key=$idx}
|
||||
<td class="{if $error}has-error {/if}text-center">
|
||||
<input class="form-control" type="checkbox" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}/>
|
||||
</td>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='sale_price' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}>
|
||||
<input {if !$show_pricing_fields}readonly{/if} required data-price-type="sale-price-without-tax" data-rel-price="sale_price_with_tax_{$idx}" id="sale_price_without_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" />
|
||||
</td>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='sale_price_with_tax' value_key=$idx}
|
||||
<td {if $error}class="has-error"{/if}>
|
||||
<input {if !$show_pricing_fields}readonly{/if} data-price-type="sale-price-with-tax" data-rel-price="sale_price_without_tax_{$idx}" id="sale_price_with_tax_{$idx}" class="price_field automatic_price_field form-control text-right" type="text" name="{$name}" value="{$value}" />
|
||||
</td>
|
||||
{/form_field}
|
||||
|
||||
<td class="actions">
|
||||
<a class="btn btn-default btn-xs combination-delete" title="{intl l='Delete this combination'}" href="#combination_delete_dialog" data-id="{$current_pse_id}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/for}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/modules'}">{intl l="Modules"}</a></li>
|
||||
</ul>
|
||||
{loop type="auth" name="can_create" role="ADMIN" resource="admin.module" access="UPDATE"}
|
||||
{* {loop type="auth" name="can_create" role="ADMIN" resource="admin.module" access="UPDATE"}
|
||||
<a class="btn btn-default btn-primary pull-right" title="{intl l='Install a new module'}" href="#install_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-import"></span> {intl l="Install a new module"}
|
||||
</a>
|
||||
{/loop}
|
||||
{/loop}*}
|
||||
</div>
|
||||
|
||||
{module_include location='modules_top'}
|
||||
|
||||
@@ -275,48 +275,84 @@ $(function() {
|
||||
});
|
||||
|
||||
// In details tab, process exchange rate usage checkbox changes
|
||||
$('use_exchange_rate_box').change(function(ev) {
|
||||
$('.')
|
||||
$('.use_exchange_rate_box').change(function(ev) {
|
||||
|
||||
if ($(this).is(':checked')) {
|
||||
|
||||
var pse_id = $(this).data('pse-id');
|
||||
|
||||
$('.price_field').prop('readonly', true);
|
||||
|
||||
// Reload prices
|
||||
$.ajax({
|
||||
url : '{url path="/admin/product/load-converted-prices"}',
|
||||
data : {
|
||||
product_sale_element_id : pse_id,
|
||||
currency_id : {$edit_currency_id}
|
||||
},
|
||||
type : 'get',
|
||||
dataType : 'json',
|
||||
success : function(json) {
|
||||
console.log(json);
|
||||
|
||||
$('input[data-pse-id="'+pse_id+'"][data-price-type="price-with-tax"]').val(json.price_with_tax);
|
||||
$('input[data-pse-id="'+pse_id+'"][data-price-type="price-without-tax"]').val(json.price_without_tax);
|
||||
$('input[data-pse-id="'+pse_id+'"][data-price-type="sale-price-with-tax"]').val(json.sale_price_with_tax);
|
||||
$('input[data-pse-id="'+pse_id+'"][data-price-type="sale-price-without-tax"]').val(json.sale_price_without_tax);
|
||||
},
|
||||
error : function(jqXHR, textStatus, errorThrown) {
|
||||
alert("{intl l='Failed to get converted prices. Please try again.'} (" +errorThrown+ ")");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
$('.price_field').prop('readonly', false)
|
||||
}
|
||||
});
|
||||
|
||||
function update_price(price, price_type, dest_field_id) {
|
||||
var tax_rule_id = $('#tax_rule_field').val();
|
||||
|
||||
if (tax_rule_id != "") {
|
||||
|
||||
var operation;
|
||||
|
||||
if (price_type.indexOf('with-tax') != -1)
|
||||
operation = 'from_tax';
|
||||
else if (price_type.indexOf('without-tax') != -1)
|
||||
operation = 'to_tax';
|
||||
else
|
||||
operation = '';
|
||||
|
||||
$.ajax({
|
||||
url : '{url path="/admin/product/calculate-price"}',
|
||||
data : {
|
||||
price : price,
|
||||
action : operation,
|
||||
product_id : {$product_id}
|
||||
},
|
||||
type : 'get',
|
||||
dataType : 'json',
|
||||
success : function(json) {
|
||||
$('#' + dest_field_id).val(json.result);
|
||||
},
|
||||
error : function(jqXHR, textStatus, errorThrown) {
|
||||
alert("{intl l='Failed to get prices. Please try again.'} (" +errorThrown+ ")");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Automatic update of price fields: any change in the taxed (resp. untaxed) price
|
||||
// will update the untaxed (resp. taxed) one
|
||||
$('.automatic_price_field').typeWatch({
|
||||
captureLength: 1,
|
||||
callback: function () {
|
||||
|
||||
var tax_rule_id = $('#tax_rule_field').val();
|
||||
|
||||
if (tax_rule_id != "") {
|
||||
var priceType = $(this).data('price-type');
|
||||
var dest_field_id = $(this).data('rel-price');
|
||||
|
||||
var operation;
|
||||
|
||||
if (priceType == 'with-tax')
|
||||
operation = 'from_tax';
|
||||
else if (priceType == 'without-tax')
|
||||
operation = 'to_tax';
|
||||
else
|
||||
operation = '';
|
||||
|
||||
$.ajax({
|
||||
url : '{url path="/admin/product/calculate-price"}',
|
||||
data : {
|
||||
price : $(this).val(),
|
||||
action : operation,
|
||||
tax_rule_id : $('#tax_rule_field').val()
|
||||
},
|
||||
type : 'get',
|
||||
dataType : 'json',
|
||||
success : function(json) {
|
||||
$('#' + dest_field_id).val(json.result);
|
||||
}
|
||||
});
|
||||
}
|
||||
wait : 300,
|
||||
callback : function () {
|
||||
update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price'));
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
238
templates/admin/default/search.html
Normal file
238
templates/admin/default/search.html
Normal file
@@ -0,0 +1,238 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Modules'}{/block}
|
||||
|
||||
{block name="check-resource"}admin.configuration.search{/block}
|
||||
{block name="check-access"}view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="modules">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="clearfix">
|
||||
<ul class="breadcrumb pull-left">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="#">{intl l="Search"}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{module_include location='modules_top'}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
{* customer search *}
|
||||
<div class="general-block-decorator">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<caption class="clearfix">
|
||||
{intl l='Customer'}
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="object-title">
|
||||
{intl l="customer ref"}
|
||||
</th>
|
||||
|
||||
<th class="object-title">
|
||||
{intl l="company"}
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{intl l="firstname & lastname"}
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{intl l="last order"}
|
||||
</th>
|
||||
|
||||
<th>{intl l='order amount'}</th>
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="customer_list" type="customer" current="false" visible="*" backend_context="1" search_term=$smarty.get.search_term search_in="ref,firstname,lastname,email"}
|
||||
{assign "lastOrderDate" ''}
|
||||
{assign "lastOrderAmount" ''}
|
||||
{assign "lastOrderCurrency" ''}
|
||||
|
||||
{loop type="order" name="last-order" customer=$ID order="create-date-reverse" limit="1"}
|
||||
{assign "lastOrderDate" "{format_date date=$CREATE_DATE}"}
|
||||
{assign "lastOrderAmount" "{format_number number=$TOTAL_TAXED_AMOUNT}"}
|
||||
{loop type="currency" name="order-currency" id=$CURRENCY}
|
||||
{assign "lastOrderCurrency" $SYMBOL}
|
||||
{/loop}
|
||||
{/loop}
|
||||
|
||||
<tr>
|
||||
<td><a href="{url path="/admin/customer/update/{$ID}"}">{$REF}</a></td>
|
||||
|
||||
<td>
|
||||
{$COMPANY}
|
||||
</td>
|
||||
|
||||
<td class="object-title">
|
||||
{$FIRSTNAME} {$LASTNAME}
|
||||
</td>
|
||||
|
||||
{module_include location='customer_list_row'}
|
||||
|
||||
<td>
|
||||
{$lastOrderDate}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{$lastOrderCurrency} {$lastOrderAmount}
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.customer" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path="/admin/customer/update/{$ID}" }"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_send_mail" role="ADMIN" resource="admin.customer" access="VIEW"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l="Send a mail to this customer"}" href="mailto:{$EMAIL}"><span class="glyphicon glyphicon-envelope"></span></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.customer" access="DELETE"}
|
||||
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_customer_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{* end customer search *}
|
||||
|
||||
{* order search *}
|
||||
<div class="general-block-decorator">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<caption class="clearfix">
|
||||
{intl l='Orders'}
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="Order n°"}</th>
|
||||
<th>{intl l="Date & Hour"}</th>
|
||||
<th>{intl l="Company"}</th>
|
||||
<th>{intl l="Name"}</th>
|
||||
<th>{intl l="Amount"}</th>
|
||||
<th>{intl l="Status"}</th>
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop type="order" name="order-search" backend_context=1 customer="*" search_term=$smarty.get.search_term search_in="ref,customer_ref,customer_firstname,customer_lastname,customer_email"}
|
||||
{loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS}
|
||||
{assign "orderInvoiceFirstName" $FIRSTNAME}
|
||||
{assign "orderInvoiceLastName" $LASTNAME}
|
||||
{assign "orderInvoiceCompany" $COMPANY}
|
||||
{/loop}
|
||||
|
||||
{loop type="order-status" name="order-status" id=$STATUS}
|
||||
{assign "orderStatus" $TITLE}
|
||||
{assign "orderStatusLabel" "order_$CODE"}
|
||||
{/loop}
|
||||
|
||||
<tr>
|
||||
|
||||
<td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td>
|
||||
<td>{format_date date=$CREATE_DATE}</td>
|
||||
<td>{$orderInvoiceCompany}</td>
|
||||
<td><a href="{url path="/admin/customer/update/$CUSTOMER"}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
|
||||
<td>{$TOTAL_TAXED_AMOUNT}</td>
|
||||
<td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td>
|
||||
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.order" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this order'}" href="{url path="/admin/order/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{* end order search *}
|
||||
|
||||
{* product search *}
|
||||
<div class="general-block-decorator">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<caption class="clearfix">
|
||||
{intl l='Product'}
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="ID"}</th>
|
||||
<th></th>
|
||||
<th>{intl l="Reference"}</th>
|
||||
<th>{intl l="Product title"}</th>
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop type="product" name="product-search" visible="*" search_mode="sentence" search_term=$smarty.get.search_term search_in="ref,title"}
|
||||
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{loop type="image" name="cat_image" source="product" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"}
|
||||
<a href="{url path='/admin/products/update' product_id=$ID}" title="{intl l='Edit this product'}">
|
||||
<img src="{$IMAGE_URL}" alt="{$TITLE}" />
|
||||
</a>
|
||||
{/loop}
|
||||
|
||||
<td class="object-title"><a href="{url path='/admin/products/update' product_id=$ID}" title="{intl l='Edit this product'}">{$REF}</a></td>
|
||||
|
||||
<td class="object-title"><a href="{url path='/admin/products/update' product_id=$ID}" title="{intl l='Edit this product'}">{$TITLE}</a></td>
|
||||
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.product" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Edit this product'}" href="{url path='/admin/products/update' product_id=$ID}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{* end product search *}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='modules_bottom'}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
|
||||
|
||||
<script>
|
||||
</script>
|
||||
{/block}
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#account" href="#account-info">
|
||||
{intl l="Personal Informations"}
|
||||
{intl l="Personal Information"}
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
@@ -118,7 +118,7 @@
|
||||
<div class="group-btn">
|
||||
<a href="{url path="/address/update/{$ID}"}" class="btn btn-edit-address" data-toggle="tooltip" title="{intl l="Edit this address"}"><i class="icon-pencil"></i> <span>{intl l="Edit"}</span></a>
|
||||
{if $DEFAULT != 1}
|
||||
<a href="{url path="/address/delete/s{$ID}"}" class="btn btn-remove-address" data-toggle="popover" title="Do you really want to delete this address ?" data-content="And here's some amazing content. It's very engaging. right?" title="{intl l="Remove this address"}" ><i class="icon-remove"></i> <span>{intl l="Cancel"}</span></a>
|
||||
<a href="{url path="/address/delete/{$ID}"}" class="btn btn-remove-address" data-toggle="popover" title="Do you really want to delete this address ?" data-content="And here's some amazing content. It's very engaging. right?" title="{intl l="Remove this address"}" ><i class="icon-remove"></i> <span>{intl l="Cancel"}</span></a>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
@@ -154,9 +154,9 @@
|
||||
{loop type="order" name="customer.orders"}
|
||||
<tr>
|
||||
<td>{$REF}</td>
|
||||
<td>{format_date date=$CREATED_AT}</td>
|
||||
<td>{loop type="currency" name="order.currency" id={$CURRENCY}}{$SYMBOL}{/loop} {format_number number=$TOTAL}</td>
|
||||
<td><span class="label-delivered">{$STATUS}</span></td>
|
||||
<td>{format_date date=$CREATE_DATE}</td>
|
||||
<td>{loop type="currency" name="order.currency" id={$CURRENCY}}{$SYMBOL}{/loop} {format_number number=$TOTAL_TAXED_AMOUNT}</td>
|
||||
<td><span class="label-delivered">{loop type="order-status" name="order.status" id={$STATUS}}{$TITLE}{/loop}</span></td>
|
||||
<td><a href="#" class="btn btn-order-details" data-toggle="tooltip" title="{intl l="View order %ref as pdf document" ref={$REF}}"><span class="icon-cloud-download"></span> {intl l="Order details"}</a></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
{/elseloop}
|
||||
</td>
|
||||
<td class="product" >
|
||||
<h3 class="name"><a href="{$URL}">
|
||||
<h3 class="name"><a href="{$PRODUCT_URL}">
|
||||
{$TITLE}
|
||||
</a></h3>
|
||||
<div class="product-options">
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
{loop name="product_thumbnail" type="image" product=$ID width="{$width}" height="{$height}" resize_mode="borders" limit="1"}
|
||||
<img itemprop="image" src="{$IMAGE_URL}" alt="Product #{$LOOP_COUNT}">
|
||||
{/loop}
|
||||
{elseloop rel="product_thumbnail"}
|
||||
{images file="../assets/img/{$width}x{$height}.png"}<img itemprop="image" src="{$asset_url}" alt="Product #{$LOOP_COUNT}">{/images}
|
||||
{/elseloop}
|
||||
|
||||
<span class="mask"></span>
|
||||
</a>
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ GNU General Public License : http://www.gnu.org/licenses/
|
||||
<!--[if IE 8 ]><html class="no-js oldie ie8" lang="{lang attr="code"}"> <![endif]-->
|
||||
<!--[if (gte IE 9)|!(IE)]><!--><html lang="{lang attr="code"}" class="no-js"> <!--<![endif]-->
|
||||
<head>
|
||||
|
||||
{* Test if javascript is enabled *}
|
||||
<script>(function(H) { H.className=H.className.replace(/\bno-js\b/,'js') } )(document.documentElement);</script>
|
||||
|
||||
@@ -160,7 +161,7 @@ GNU General Public License : http://www.gnu.org/licenses/
|
||||
<a class="current dropdown-toggle" data-toggle="dropdown" href="{url path="/language"}">{lang attr="title"}</a>
|
||||
<ul class="select dropdown-menu">
|
||||
{loop type="lang" name="lang_available" exclude="{lang attr="id"}"}
|
||||
<li><a href="?lang={$CODE}">{$TITLE}</a></li>
|
||||
<li><a href="{url path="{navigate to="current"}" lang={$CODE}}">{$TITLE}</a></li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -170,7 +171,7 @@ GNU General Public License : http://www.gnu.org/licenses/
|
||||
<a class="current dropdown-toggle" data-toggle="dropdown" href="{url path="/currency"}">{currency attr="code"}</a>
|
||||
<ul class="select dropdown-menu">
|
||||
{loop type="currency" name="currency_available" exclude="{currency attr="id"}" }
|
||||
<li><a href="?currency={$ISOCODE}">{$SYMBOL} - {$NAME}</a></li>
|
||||
<li><a href="{url path="{navigate to="current"}" currency={$ISOCODE}}">{$SYMBOL} - {$NAME}</a></li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -72,12 +72,11 @@
|
||||
{loop type="cart" name="cartloop"}
|
||||
<tr>
|
||||
<td class="image">
|
||||
<a href="{$PRODUCT_URL}" class="thumbnail">
|
||||
|
||||
{assign "cart_count" $LOOP_COUNT}
|
||||
{ifloop rel='product-image'}
|
||||
{loop type="image" name="product-image" product=$PRODUCT_ID limit="1" width="118" height="85" force_return="true"}
|
||||
<img src="{$IMAGE_URL}" alt="Product #{$cart_count}"></a>
|
||||
<img src="{$IMAGE_URL}" alt="Product #{$cart_count}">
|
||||
{/loop}
|
||||
{/ifloop}
|
||||
{elseloop rel="product-image"}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
{ifloop rel="product_list"}
|
||||
<ul class="product-col-3">
|
||||
{loop type="product" name="product_list" title="{$smarty.get.q}" limit=$limit page=$product_page order=$product_order}
|
||||
{include file="includes/single-product.html" product_id=$ID hasBtn=true hasDescription=true width="218" height="146"}
|
||||
{include file="includes/single-product.html" product_id=$ID hasBtn=true hasDescription=true width="369" height="247"}
|
||||
{assign "products_count" $LOOP_TOTAL}
|
||||
{/loop}
|
||||
</ul>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
{loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS}
|
||||
{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}<br />
|
||||
{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}<br />
|
||||
{$ZIPCODE} {$COUNTRY}<br/>
|
||||
{$ZIPCODE} {$CITY}<br/>
|
||||
{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
|
||||
{/loop}
|
||||
</td>
|
||||
@@ -108,7 +108,7 @@
|
||||
{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}
|
||||
{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}{$FIRSTNAME} {$LASTNAME}<br />
|
||||
{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}<br />
|
||||
{$ZIPCODE} {$COUNTRY}<br/>
|
||||
{$ZIPCODE} {$CITY}<br/>
|
||||
{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
|
||||
{/loop}
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user