first commit
This commit is contained in:
@@ -0,0 +1,207 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Free shipping' d='Admin.Shipping.Feature'}</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="free_shipping" id="free_shipping_on" value="1" {if $currentTab->getFieldValue($currentObject, 'free_shipping')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="free_shipping_on">
|
||||
{l s='Yes' d='Admin.Global'}
|
||||
</label>
|
||||
<input type="radio" name="free_shipping" id="free_shipping_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'free_shipping')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="free_shipping_off">
|
||||
{l s='No' d='Admin.Global'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Apply a discount' d='Admin.Catalog.Feature'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="radio">
|
||||
<label for="apply_discount_percent">
|
||||
<input type="radio" name="apply_discount" id="apply_discount_percent" value="percent" {if $currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval > 0}checked="checked"{/if} />
|
||||
{l s='Percent (%)' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label for="apply_discount_amount">
|
||||
<input type="radio" name="apply_discount" id="apply_discount_amount" value="amount" {if $currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval > 0}checked="checked"{/if} />
|
||||
{l s='Amount' d='Admin.Global'}
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label for="apply_discount_off">
|
||||
<input type="radio" name="apply_discount" id="apply_discount_off" value="off" {if !$currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval > 0 && !$currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval > 0}checked="checked"{/if} />
|
||||
<i class="icon-remove color_danger"></i> {l s='None' d='Admin.Global'}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="apply_discount_percent_div" class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Value' d='Admin.Global'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">%</span>
|
||||
<input type="text" id="reduction_percent" class="input-mini" name="reduction_percent" value="{$currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval}" />
|
||||
</div>
|
||||
<span class="help-block"><i class="icon-warning-sign"></i> {l s='Does not apply to the shipping costs' d='Admin.Catalog.Help'}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="apply_discount_amount_div" class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Amount' d='Admin.Global'}</label>
|
||||
<div class="col-lg-7">
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<input type="text" id="reduction_amount" name="reduction_amount" value="{$currentTab->getFieldValue($currentObject, 'reduction_amount')|floatval}" onchange="this.value = this.value.replace(/,/g, '.');" />
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<select name="reduction_currency" >
|
||||
{foreach from=$currencies item='currency'}
|
||||
<option value="{$currency.id_currency|intval}" {if $currentTab->getFieldValue($currentObject, 'reduction_currency') == $currency.id_currency || (!$currentTab->getFieldValue($currentObject, 'reduction_currency') && $currency.id_currency == $defaultCurrency)}selected="selected"{/if}>{$currency.iso_code}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<select name="reduction_tax" >
|
||||
<option value="0" {if $currentTab->getFieldValue($currentObject, 'reduction_tax') == 0}selected="selected"{/if}>{l s='Tax excluded' d='Admin.Global'}</option>
|
||||
<option value="1" {if $currentTab->getFieldValue($currentObject, 'reduction_tax') == 1}selected="selected"{/if}>{l s='Tax included' d='Admin.Global'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="apply_discount_to_div" class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Apply a discount to' d='Admin.Catalog.Feature'}</label>
|
||||
<div class="col-lg-7">
|
||||
<p class="radio">
|
||||
<label for="apply_discount_to_order">
|
||||
<input type="radio" name="apply_discount_to" id="apply_discount_to_order" value="order"{if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval == 0} checked="checked"{/if} />
|
||||
{l s='Order (without shipping)' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label for="apply_discount_to_product">
|
||||
<input type="radio" name="apply_discount_to" id="apply_discount_to_product" value="specific"{if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval > 0} checked="checked"{/if} />
|
||||
{l s='Specific product' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label for="apply_discount_to_cheapest">
|
||||
<input type="radio" name="apply_discount_to" id="apply_discount_to_cheapest" value="cheapest"{if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval == -1} checked="checked"{/if} />
|
||||
{l s='Cheapest product' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<p class="radio">
|
||||
<label for="apply_discount_to_selection">
|
||||
<input type="radio" name="apply_discount_to" id="apply_discount_to_selection" value="selection"{if $currentTab->getFieldValue($currentObject, 'reduction_product')|intval == -2} checked="checked"{/if}{if $product_rule_groups|@count == 0}disabled="disabled"{/if} />
|
||||
{l s='Selected product(s)' d='Admin.Catalog.Feature'}{if $product_rule_groups|@count == 0} <span id="apply_discount_to_selection_warning" class="text-muted clearfix"><i class="icon-warning-sign"></i> <a href="#" id="apply_discount_to_selection_shortcut">{l s='You must select some products before' d='Admin.Catalog.Notification'}</a></span>{/if}
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="apply_discount_to_product_div" class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Product' d='Admin.Global'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-5">
|
||||
<input type="text" id="reductionProductFilter" name="reductionProductFilter" value="{$reductionProductFilter|escape:'html':'UTF-8'}" />
|
||||
<input type="hidden" id="reduction_product" name="reduction_product" value="{$currentTab->getFieldValue($currentObject, 'reduction_product')|intval}" />
|
||||
<span class="input-group-addon"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="apply_discount_to_product_special" class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='If enabled, the voucher will not apply to products already on sale.'}">
|
||||
{l s='Exclude discounted products' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="reduction_exclude_special" id="reduction_exclude_special_on" value="1"{if $currentTab->getFieldValue($currentObject, 'reduction_exclude_special')|intval} checked="checked"{/if}/>
|
||||
<label class="t" for="reduction_exclude_special_on">
|
||||
{l s='Yes' d='Admin.Global'}
|
||||
</label>
|
||||
<input type="radio" name="reduction_exclude_special" id="reduction_exclude_special_off" value="0"{if !$currentTab->getFieldValue($currentObject, 'reduction_exclude_special')|intval} checked="checked"{/if}/>
|
||||
<label class="t" for="reduction_exclude_special_off">
|
||||
{l s='No' d='Admin.Global'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Send a free gift' d='Admin.Catalog.Feature'}</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="free_gift" id="free_gift_on" value="1" {if $currentTab->getFieldValue($currentObject, 'gift_product')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="free_gift_on">
|
||||
{l s='Yes' d='Admin.Global'}
|
||||
</label>
|
||||
<input type="radio" name="free_gift" id="free_gift_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'gift_product')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="free_gift_off">
|
||||
{l s='No' d='Admin.Global'}
|
||||
</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="free_gift_div" class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Search a product' d='Admin.Catalog.Feature'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-5">
|
||||
<input type="text" id="giftProductFilter" value="{$giftProductFilter}" />
|
||||
<span class="input-group-addon"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="gift_products_found" {if $gift_product_select == ''}style="display:none"{/if}>
|
||||
<div id="gift_product_list" class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Matching products' d='Admin.Catalog.Feature'}</label>
|
||||
<div class="col-lg-5">
|
||||
<select name="gift_product" id="gift_product" onclick="displayProductAttributes();" class="control-form">
|
||||
{$gift_product_select}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="gift_attributes_list" class="form-group" {if !$hasAttribute}style="display:none"{/if}>
|
||||
<label class="control-label col-lg-3">{l s='Available combinations' d='Admin.Catalog.Feature'}</label>
|
||||
<div class="col-lg-5" id="gift_attributes_list_select">
|
||||
{$gift_product_attribute_select}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="gift_products_err" class="alert alert-warning" style="display:none"></div>
|
||||
@@ -0,0 +1,331 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Optional: The cart rule will be available to everyone if you leave this field blank.' d='Admin.Catalog.Help'}">
|
||||
{l s='Limit to a single customer' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-12">
|
||||
<span class="input-group-addon"><i class="icon-user"></i></span>
|
||||
<input type="hidden" id="id_customer" name="id_customer" value="{$currentTab->getFieldValue($currentObject, 'id_customer')|intval}" />
|
||||
<input type="text" id="customerFilter" class="input-xlarge" name="customerFilter" value="{if $customerFilter}{$customerFilter|escape:'html':'UTF-8'}{elseif isset($smarty.post.customerFilter)}{$smarty.post.customerFilter|escape}{/if}" />
|
||||
<span class="input-group-addon"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='The default period is one month.' d='Admin.Catalog.Help'}">
|
||||
{l s='Valid' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{l s='From' d='Admin.Global'}</span>
|
||||
<input type="text" class="datepicker input-medium" name="date_from"
|
||||
value="{if $currentTab->getFieldValue($currentObject, 'date_from')}{$currentTab->getFieldValue($currentObject, 'date_from')|escape}{else}{$defaultDateFrom}{/if}" />
|
||||
<span class="input-group-addon"><i class="icon-calendar-empty"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{l s='To' d='Admin.Global'}</span>
|
||||
<input type="text" class="datepicker input-medium" name="date_to"
|
||||
value="{if $currentTab->getFieldValue($currentObject, 'date_to')}{$currentTab->getFieldValue($currentObject, 'date_to')|escape}{else}{$defaultDateTo}{/if}" />
|
||||
<span class="input-group-addon"><i class="icon-calendar-empty"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='You can choose a minimum amount for the cart either with or without the taxes and shipping.' d='Admin.Catalog.Help'}">
|
||||
{l s='Minimum amount' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<input type="text" name="minimum_amount" value="{$currentTab->getFieldValue($currentObject, 'minimum_amount')|floatval}" />
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<select name="minimum_amount_currency">
|
||||
{foreach from=$currencies item='currency'}
|
||||
<option value="{$currency.id_currency|intval}"
|
||||
{if $currentTab->getFieldValue($currentObject, 'minimum_amount_currency') == $currency.id_currency
|
||||
|| (!$currentTab->getFieldValue($currentObject, 'minimum_amount_currency') && $currency.id_currency == $defaultCurrency)}
|
||||
selected="selected"
|
||||
{/if}
|
||||
>
|
||||
{$currency.iso_code}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<select name="minimum_amount_tax">
|
||||
<option value="0" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_tax') == 0}selected="selected"{/if}>{l s='Tax excluded' d='Admin.Global'}</option>
|
||||
<option value="1" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_tax') == 1}selected="selected"{/if}>{l s='Tax included' d='Admin.Global'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<select name="minimum_amount_shipping">
|
||||
<option value="0" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_shipping') == 0}selected="selected"{/if}>{l s='Shipping excluded' d='Admin.Catalog.Feature'}</option>
|
||||
<option value="1" {if $currentTab->getFieldValue($currentObject, 'minimum_amount_shipping') == 1}selected="selected"{/if}>{l s='Shipping included' d='Admin.Catalog.Feature'}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='The cart rule will be applied to the first "X" customers only.' d='Admin.Catalog.Help'}">
|
||||
{l s='Total available' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<input class="form-control" type="text" name="quantity" value="{$currentTab->getFieldValue($currentObject, 'quantity')|intval}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='A customer will only be able to use the cart rule "X" time(s).' d='Admin.Catalog.Help'}">
|
||||
{l s='Total available for each user' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<input class="form-control" type="text" name="quantity_per_user" value="{$currentTab->getFieldValue($currentObject, 'quantity_per_user')|intval}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
{l s='Restrictions' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
{if ($countries.unselected|@count) + ($countries.selected|@count) > 1}
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="country_restriction" name="country_restriction" value="1" {if $countries.unselected|@count}checked="checked"{/if} />
|
||||
{l s='Country selection' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<span class="help-block">{l s='This restriction applies to the country of delivery.' d='Admin.Catalog.Help'}</span>
|
||||
<div id="country_restriction_div">
|
||||
<br />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<p>{l s='Unselected countries' d='Admin.Catalog.Feature'}</p>
|
||||
<select id="country_select_1" multiple>
|
||||
{foreach from=$countries.unselected item='country'}
|
||||
<option value="{$country.id_country|intval}"> {$country.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="country_select_add" class="btn btn-default btn-block clearfix">{l s='Add' d='Admin.Actions'} <i class="icon-arrow-right"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{l s='Selected countries' d='Admin.Catalog.Feature'}</p>
|
||||
<select name="country_select[]" id="country_select_2" class="input-large" multiple>
|
||||
{foreach from=$countries.selected item='country'}
|
||||
<option value="{$country.id_country|intval}"> {$country.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="country_select_remove" class="btn btn-default btn-block clearfix"><i class="icon-arrow-left"></i> {l s='Remove' d='Admin.Actions'} </a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if ($carriers.unselected|@count) + ($carriers.selected|@count) > 1}
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="carrier_restriction" name="carrier_restriction" value="1" {if $carriers.unselected|@count}checked="checked"{/if} />
|
||||
{l s='Carrier selection' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<div id="carrier_restriction_div">
|
||||
<br />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<p>{l s='Unselected carriers' d='Admin.Catalog.Feature'}</p>
|
||||
<select id="carrier_select_1" class="input-large" multiple>
|
||||
{foreach from=$carriers.unselected item='carrier'}
|
||||
<option value="{$carrier.id_reference|intval}"> {$carrier.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="carrier_select_add" class="btn btn-default btn-block clearfix" >{l s='Add' d='Admin.Actions'} <i class="icon-arrow-right"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{l s='Selected carriers' d='Admin.Catalog.Feature'}</p>
|
||||
<select name="carrier_select[]" id="carrier_select_2" class="input-large" multiple>
|
||||
{foreach from=$carriers.selected item='carrier'}
|
||||
<option value="{$carrier.id_reference|intval}"> {$carrier.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="carrier_select_remove" class="btn btn-default btn-block clearfix"><i class="icon-arrow-left"></i> {l s='Remove' d='Admin.Actions'} </a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if ($groups.unselected|@count) + ($groups.selected|@count) > 1}
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="group_restriction" name="group_restriction" value="1" {if $groups.unselected|@count}checked="checked"{/if} />
|
||||
{l s='Customer group selection' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<div id="group_restriction_div">
|
||||
<br />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<p>{l s='Unselected groups' d='Admin.Catalog.Feature'}</p>
|
||||
<select id="group_select_1" class="input-large" multiple>
|
||||
{foreach from=$groups.unselected item='group'}
|
||||
<option value="{$group.id_group|intval}"> {$group.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="group_select_add" class="btn btn-default btn-block clearfix" >{l s='Add' d='Admin.Actions'} <i class="icon-arrow-right"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{l s='Selected groups' d='Admin.Catalog.Feature'}</p>
|
||||
<select name="group_select[]" class="input-large" id="group_select_2" multiple>
|
||||
{foreach from=$groups.selected item='group'}
|
||||
<option value="{$group.id_group|intval}"> {$group.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="group_select_remove" class="btn btn-default btn-block clearfix" ><i class="icon-arrow-left"></i> {l s='Remove' d='Admin.Actions'}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if ($cart_rules.unselected|@count) + ($cart_rules.selected|@count) > 0}
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="cart_rule_restriction" name="cart_rule_restriction" value="1" {if $cart_rules.unselected|@count}checked="checked"{/if} />
|
||||
{l s='Compatibility with other cart rules' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<div id="cart_rule_restriction_div">
|
||||
<br />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<p>{l s='Uncombinable cart rules' d='Admin.Catalog.Feature'}</p>
|
||||
<input id="cart_rule_select_1_filter" autocomplete="off" class="form-control uncombinable_search_filter" type="text" name="uncombinable_filter" placeholder="{l s='Search' d='Admin.Actions'}" value="">
|
||||
<select id="cart_rule_select_1" class="jscroll" multiple="">
|
||||
</select>
|
||||
<a class="jscroll-next btn btn-default btn-block clearfix" href="">{l s='Next' d='Admin.Global'}</a>
|
||||
<a id="cart_rule_select_add" class="btn btn-default btn-block clearfix">{l s='Add' d='Admin.Actions'} <i class="icon-arrow-right"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{l s='Combinable cart rules' d='Admin.Catalog.Feature'}</p>
|
||||
<input id="cart_rule_select_2_filter" autocomplete="off" class="form-control combinable_search_filter" type="text" name="combinable_filter" placeholder="{l s='Search' d='Admin.Actions'}" value="">
|
||||
<select name="cart_rule_select[]" class="jscroll" id="cart_rule_select_2" multiple>
|
||||
</select>
|
||||
<a class="jscroll-next btn btn-default btn-block clearfix" href="">{l s='Next' d='Admin.Global'}</a>
|
||||
<a id="cart_rule_select_remove" class="btn btn-default btn-block clearfix" ><i class="icon-arrow-left"></i> {l s='Remove' d='Admin.Actions'}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="product_restriction" name="product_restriction" value="1" {if $product_rule_groups|@count}checked="checked"{/if} />
|
||||
{l s='Product selection' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<div id="product_restriction_div">
|
||||
<br />
|
||||
<table id="product_rule_group_table" class="table">
|
||||
{foreach from=$product_rule_groups item='product_rule_group'}
|
||||
{$product_rule_group}
|
||||
{/foreach}
|
||||
</table>
|
||||
<a href="javascript:addProductRuleGroup();" class="btn btn-default ">
|
||||
<i class="icon-plus-sign"></i> {l s='Product selection' d='Admin.Catalog.Feature'}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{if ($shops.unselected|@count) + ($shops.selected|@count) > 1}
|
||||
<p class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="shop_restriction" name="shop_restriction" value="1" {if $shops.unselected|@count}checked="checked"{/if} />
|
||||
{l s='Shop selection' d='Admin.Catalog.Feature'}
|
||||
</label>
|
||||
</p>
|
||||
<div id="shop_restriction_div">
|
||||
<br/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>
|
||||
<p>{l s='Unselected shops' d='Admin.Catalog.Feature'}</p>
|
||||
<select id="shop_select_1" multiple>
|
||||
{foreach from=$shops.unselected item='shop'}
|
||||
<option value="{$shop.id_shop|intval}"> {$shop.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="shop_select_add" class="btn btn-default btn-block clearfix" >{l s='Add' d='Admin.Actions'} <i class="icon-arrow-right"></i></a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{l s='Selected shops' d='Admin.Catalog.Feature'}</p>
|
||||
<select name="shop_select[]" id="shop_select_2" multiple>
|
||||
{foreach from=$shops.selected item='shop'}
|
||||
<option value="{$shop.id_shop|intval}"> {$shop.name|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<a id="shop_select_remove" class="btn btn-default btn-block clearfix" ><i class="icon-arrow-left"></i> {l s='Remove' d='Admin.Actions'}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,468 @@
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*/
|
||||
|
||||
function addProductRuleGroup() {
|
||||
$('#product_rule_group_table').show();
|
||||
product_rule_groups_counter += 1;
|
||||
product_rule_counters[product_rule_groups_counter] = 0;
|
||||
|
||||
$.get(
|
||||
'ajax-tab.php',
|
||||
{
|
||||
controller: 'AdminCartRules', token: currentToken, newProductRuleGroup: 1, product_rule_group_id: product_rule_groups_counter,
|
||||
},
|
||||
(content) => {
|
||||
if (content != '') $('#product_rule_group_table').append(content);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function removeProductRuleGroup(id) {
|
||||
$(`#product_rule_group_${id}_tr`).remove();
|
||||
}
|
||||
|
||||
function addProductRule(product_rule_group_id) {
|
||||
product_rule_counters[product_rule_group_id] += 1;
|
||||
if ($(`#product_rule_type_${product_rule_group_id}`).val() != 0) {
|
||||
$.get(
|
||||
'ajax-tab.php',
|
||||
{
|
||||
controller: 'AdminCartRules', token: currentToken, newProductRule: 1, product_rule_type: $(`#product_rule_type_${product_rule_group_id}`).val(), product_rule_group_id, product_rule_id: product_rule_counters[product_rule_group_id],
|
||||
},
|
||||
(content) => {
|
||||
if (content != '') $(`#product_rule_table_${product_rule_group_id}`).append(content);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function removeProductRule(product_rule_group_id, product_rule_id) {
|
||||
$(`#product_rule_${product_rule_group_id}_${product_rule_id}_tr`).remove();
|
||||
}
|
||||
|
||||
function toggleCartRuleFilter(id) {
|
||||
if ($(id).prop('checked')) $(`#${$(id).attr('id')}_div`).show(400);
|
||||
else $(`#${$(id).attr('id')}_div`).hide(200);
|
||||
}
|
||||
|
||||
function removeCartRuleOption(item) {
|
||||
const id = $(item).attr('id').replace('_remove', '');
|
||||
$(`#${id}_2 option:selected`).remove().appendTo(`#${id}_1`);
|
||||
}
|
||||
|
||||
function addCartRuleOption(item) {
|
||||
const id = $(item).attr('id').replace('_add', '');
|
||||
$(`#${id}_1 option:selected`).remove().appendTo(`#${id}_2`);
|
||||
}
|
||||
|
||||
function updateProductRuleShortDescription(item) {
|
||||
/** ***** For IE: put a product in condition on cart rules ****** */
|
||||
if (typeof String.prototype.trim !== 'function') {
|
||||
String.prototype.trim = function () {
|
||||
return this.replace(/^\s+|\s+$/g, '');
|
||||
};
|
||||
}
|
||||
|
||||
const id1 = $(item).attr('id').replace('_add', '').replace('_remove', '');
|
||||
const id2 = id1.replace('_select', '');
|
||||
const {length} = $(`#${id1}_2 option`);
|
||||
|
||||
if (length == 1) $(`#${id2}_match`).val($(`#${id1}_2 option`).first().text().trim());
|
||||
else $(`#${id2}_match`).val(length);
|
||||
}
|
||||
|
||||
window.restrictions = new Array('country', 'carrier', 'group', 'cart_rule', 'shop');
|
||||
|
||||
for (i in restrictions) {
|
||||
toggleCartRuleFilter($(`#${restrictions[i]}_restriction`));
|
||||
$(`#${restrictions[i]}_restriction`).change(function () { toggleCartRuleFilter(this); });
|
||||
$(`#${restrictions[i]}_select_remove`).click(function () { removeCartRuleOption(this); });
|
||||
$(`#${restrictions[i]}_select_add`).click(function () { addCartRuleOption(this); });
|
||||
}
|
||||
|
||||
toggleCartRuleFilter($('#product_restriction'));
|
||||
|
||||
$('#group_restriction').change(function () {
|
||||
$('#customerFilter').prop('disabled', $(this).prop('checked'));
|
||||
}).change();
|
||||
|
||||
$('#customerFilter').on('change keyup', function () {
|
||||
$('#group_restriction').prop('disabled', $(this).val() !== '');
|
||||
}).change();
|
||||
|
||||
$('#product_restriction').change(function () {
|
||||
toggleCartRuleFilter(this);
|
||||
|
||||
if ($(this).prop('checked')) {
|
||||
$('#apply_discount_to_selection').prop('disabled', false);
|
||||
$('#apply_discount_to_selection_warning').hide();
|
||||
} else {
|
||||
$('#apply_discount_to_selection').prop('disabled', true);
|
||||
$('#apply_discount_to_selection_warning').show();
|
||||
}
|
||||
});
|
||||
|
||||
$('#apply_discount_to_selection_shortcut').click((e) => {
|
||||
displayCartRuleTab('conditions');
|
||||
$('#product_restriction').focus();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
function toggleApplyDiscount(percent, amount, apply_to) {
|
||||
if (percent) {
|
||||
$('#apply_discount_percent_div').show(400);
|
||||
if ($('#apply_discount_to_product').prop('checked')) toggleApplyDiscountTo();
|
||||
$('#apply_discount_to_cheapest').show();
|
||||
$('*[for=apply_discount_to_cheapest]').show();
|
||||
$('#apply_discount_to_selection').show();
|
||||
$('*[for=apply_discount_to_selection]').show();
|
||||
$('#apply_discount_to_product_special').show(400);
|
||||
} else {
|
||||
$('#apply_discount_percent_div').hide(200);
|
||||
$('#reduction_percent').val('0');
|
||||
}
|
||||
|
||||
if (amount) {
|
||||
$('#apply_discount_amount_div').show(400);
|
||||
if ($('#apply_discount_to_product').prop('checked')) toggleApplyDiscountTo();
|
||||
$('#apply_discount_to_cheapest').hide();
|
||||
$('*[for=apply_discount_to_cheapest]').hide();
|
||||
$('#apply_discount_to_cheapest').prop('checked', false);
|
||||
$('#apply_discount_to_selection').hide();
|
||||
$('*[for=apply_discount_to_selection]').hide();
|
||||
$('#apply_discount_to_selection').prop('checked', false);
|
||||
$('#apply_discount_to_product_special').hide(200);
|
||||
} else {
|
||||
$('#apply_discount_amount_div').hide(200);
|
||||
$('#reduction_amount').val('0');
|
||||
|
||||
if ($('#apply_discount_off').prop('checked')) {
|
||||
$('#apply_discount_to_product').prop('checked', false);
|
||||
toggleApplyDiscountTo();
|
||||
}
|
||||
}
|
||||
|
||||
if (apply_to) $('#apply_discount_to_div').show(400);
|
||||
else {
|
||||
toggleApplyDiscountTo();
|
||||
$('#apply_discount_to_div').hide(200);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleApplyDiscountTo() {
|
||||
if ($('#apply_discount_to_product').prop('checked')) $('#apply_discount_to_product_div').show(400);
|
||||
else {
|
||||
$('#apply_discount_to_product_div').hide(200);
|
||||
$('#reductionProductFilter').val('');
|
||||
if ($('#apply_discount_to_order').prop('checked')) $('#reduction_product').val('0');
|
||||
if ($('#apply_discount_to_cheapest').prop('checked')) $('#reduction_product').val('-1');
|
||||
if ($('#apply_discount_to_selection').prop('checked')) $('#reduction_product').val('-2');
|
||||
}
|
||||
}
|
||||
|
||||
function toggleGiftProduct() {
|
||||
if ($('#free_gift_on').prop('checked')) $('#free_gift_div').show(400);
|
||||
else {
|
||||
$('#gift_product').val('0');
|
||||
$('#giftProductFilter').val('');
|
||||
$('#free_gift_div').hide(200);
|
||||
}
|
||||
}
|
||||
|
||||
$('#apply_discount_percent').click(() => {
|
||||
toggleApplyDiscount(true, false, true);
|
||||
});
|
||||
if ($('#apply_discount_percent').prop('checked')) toggleApplyDiscount(true, false, true);
|
||||
|
||||
$('#apply_discount_amount').click(() => {
|
||||
toggleApplyDiscount(false, true, true);
|
||||
});
|
||||
if ($('#apply_discount_amount').prop('checked')) toggleApplyDiscount(false, true, true);
|
||||
|
||||
$('#apply_discount_off').click(() => {
|
||||
toggleApplyDiscount(false, false, false);
|
||||
});
|
||||
if ($('#apply_discount_off').prop('checked')) toggleApplyDiscount(false, false, false);
|
||||
|
||||
$('#apply_discount_to_order').click(() => {
|
||||
toggleApplyDiscountTo();
|
||||
},
|
||||
);
|
||||
if ($('#apply_discount_to_order').prop('checked')) toggleApplyDiscountTo();
|
||||
|
||||
$('#apply_discount_to_product').click(() => {
|
||||
toggleApplyDiscountTo();
|
||||
},
|
||||
);
|
||||
if ($('#apply_discount_to_product').prop('checked')) toggleApplyDiscountTo();
|
||||
|
||||
$('#apply_discount_to_cheapest').click(() => {
|
||||
toggleApplyDiscountTo();
|
||||
},
|
||||
);
|
||||
if ($('#apply_discount_to_cheapest').prop('checked')) toggleApplyDiscountTo();
|
||||
|
||||
$('#apply_discount_to_selection').click(() => {
|
||||
toggleApplyDiscountTo();
|
||||
},
|
||||
);
|
||||
if ($('#apply_discount_to_selection').prop('checked')) toggleApplyDiscountTo();
|
||||
|
||||
$('#free_gift_on').click(() => {
|
||||
toggleGiftProduct();
|
||||
},
|
||||
);
|
||||
$('#free_gift_off').click(() => {
|
||||
toggleGiftProduct();
|
||||
},
|
||||
);
|
||||
toggleGiftProduct();
|
||||
|
||||
// Main form submit
|
||||
$('#cart_rule_form').submit(() => {
|
||||
if ($('#customerFilter').val() == '') $('#id_customer').val('0');
|
||||
|
||||
for (i in restrictions) {
|
||||
if ($(`#${restrictions[i]}_select_1 option`).length == 0) $(`#${restrictions[i]}_restriction`).prop('checked', false);
|
||||
else {
|
||||
$(`#${restrictions[i]}_select_2 option`).each(function (i) {
|
||||
$(this).prop('selected', true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$('.product_rule_toselect option').each(function (i) {
|
||||
$(this).prop('selected', true);
|
||||
});
|
||||
});
|
||||
|
||||
$('#reductionProductFilter')
|
||||
.autocomplete(
|
||||
'ajax-tab.php', {
|
||||
minChars: 2,
|
||||
max: 50,
|
||||
width: 500,
|
||||
selectFirst: false,
|
||||
scroll: false,
|
||||
dataType: 'json',
|
||||
formatItem(data, i, max, value, term) {
|
||||
return value;
|
||||
},
|
||||
parse(data) {
|
||||
const mytab = new Array();
|
||||
|
||||
for (let i = 0; i < data.length; i++) mytab[mytab.length] = {data: data[i], value: (`${data[i].reference} ${data[i].name}`).trim()};
|
||||
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
controller: 'AdminCartRules',
|
||||
token: currentToken,
|
||||
reductionProductFilter: 1,
|
||||
},
|
||||
},
|
||||
)
|
||||
.result((event, data, formatted) => {
|
||||
$('#reduction_product').val(data.id_product);
|
||||
$('#reductionProductFilter').val((`${data.reference} ${data.name}`).trim());
|
||||
});
|
||||
|
||||
$('#customerFilter')
|
||||
.autocomplete(
|
||||
'ajax-tab.php', {
|
||||
minChars: 2,
|
||||
max: 50,
|
||||
width: 500,
|
||||
selectFirst: false,
|
||||
scroll: false,
|
||||
dataType: 'json',
|
||||
formatItem(data, i, max, value, term) {
|
||||
return value;
|
||||
},
|
||||
parse(data) {
|
||||
const mytab = new Array();
|
||||
|
||||
for (let i = 0; i < data.length; i++) mytab[mytab.length] = {data: data[i], value: `${data[i].cname} (${data[i].email})`};
|
||||
|
||||
return mytab;
|
||||
},
|
||||
extraParams: {
|
||||
controller: 'AdminCartRules',
|
||||
token: currentToken,
|
||||
customerFilter: 1,
|
||||
},
|
||||
},
|
||||
)
|
||||
.result((event, data, formatted) => {
|
||||
$('#id_customer').val(data.id_customer);
|
||||
$('#customerFilter').val(`${data.cname} (${data.email})`);
|
||||
});
|
||||
|
||||
function displayCartRuleTab(tab) {
|
||||
$('.cart_rule_tab').hide();
|
||||
$('.tab-row.active').removeClass('active');
|
||||
$(`#cart_rule_${tab}`).show();
|
||||
$(`#cart_rule_link_${tab}`).parent().addClass('active');
|
||||
$('#currentFormTab').val(tab);
|
||||
}
|
||||
|
||||
$('.cart_rule_tab').hide();
|
||||
$('.tab-row.active').removeClass('active');
|
||||
$(`#cart_rule_${currentFormTab}`).show();
|
||||
$(`#cart_rule_link_${currentFormTab}`).parent().addClass('active');
|
||||
|
||||
window.date = new Date();
|
||||
window.hours = date.getHours();
|
||||
|
||||
if (hours < 10) hours = `0${hours}`;
|
||||
window.mins = date.getMinutes();
|
||||
|
||||
if (mins < 10) mins = `0${mins}`;
|
||||
window.secs = date.getSeconds();
|
||||
|
||||
if (secs < 10) secs = `0${secs}`;
|
||||
|
||||
$('.datepicker').datetimepicker({
|
||||
beforeShow(input, inst) {
|
||||
setTimeout(() => {
|
||||
inst.dpDiv.css({
|
||||
'z-index': 1031,
|
||||
});
|
||||
}, 0);
|
||||
},
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd',
|
||||
// Define a custom regional settings in order to use PrestaShop translation tools
|
||||
currentText,
|
||||
closeText,
|
||||
ampm: false,
|
||||
amNames: ['AM', 'A'],
|
||||
pmNames: ['PM', 'P'],
|
||||
timeFormat: 'hh:mm:ss tt',
|
||||
timeSuffix: '',
|
||||
timeOnlyTitle,
|
||||
timeText,
|
||||
hourText,
|
||||
minuteText,
|
||||
});
|
||||
|
||||
$('#giftProductFilter').typeWatch({
|
||||
captureLength: 2,
|
||||
highlight: false,
|
||||
wait: 100,
|
||||
callback() { searchProducts(); },
|
||||
});
|
||||
|
||||
window.gift_product_search = $('#giftProductFilter').val();
|
||||
function searchProducts() {
|
||||
if ($('#giftProductFilter').val() == gift_product_search) return;
|
||||
gift_product_search = $('#giftProductFilter').val();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: {'cache-control': 'no-cache'},
|
||||
url: `${'ajax-tab.php' + '?rand='}${new Date().getTime()}`,
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
data: {
|
||||
controller: 'AdminCartRules',
|
||||
token: currentToken,
|
||||
action: 'searchProducts',
|
||||
product_search: $('#giftProductFilter').val(),
|
||||
},
|
||||
success(res) {
|
||||
let products_found = '';
|
||||
let attributes_html = '';
|
||||
stock = {};
|
||||
|
||||
if (res.found) {
|
||||
$('#gift_products_err').hide();
|
||||
$('#gift_products_found').show();
|
||||
$.each(res.products, function () {
|
||||
products_found += `<option value="${this.id_product}">${this.name}${this.combinations.length == 0 ? ` - ${this.formatted_price}` : ''}</option>`;
|
||||
|
||||
attributes_html += `<select class="id_product_attribute" id="ipa_${this.id_product}" name="ipa_${this.id_product}" style="display:none">`;
|
||||
$.each(this.combinations, function () {
|
||||
attributes_html += `<option ${this.default_on == 1 ? 'selected="selected"' : ''} value="${this.id_product_attribute}">${this.attributes} - ${this.formatted_price}</option>`;
|
||||
});
|
||||
attributes_html += '</select>';
|
||||
});
|
||||
|
||||
$('#gift_product_list #gift_product').html(products_found);
|
||||
$('#gift_attributes_list #gift_attributes_list_select').html(attributes_html);
|
||||
displayProductAttributes();
|
||||
} else {
|
||||
$('#products_found').hide();
|
||||
$('#products_err').html(res.notfound);
|
||||
$('#products_err').show();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function displayProductAttributes() {
|
||||
if ($(`#ipa_${$('#gift_product option:selected').val()} option`).length === 0) $('#gift_attributes_list').hide();
|
||||
else {
|
||||
$('#gift_attributes_list').show();
|
||||
$('.id_product_attribute').hide();
|
||||
$(`#ipa_${$('#gift_product option:selected').val()}`).show();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(() => {
|
||||
$(window).keydown((event) => {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if ($('#cart_rule_select_1').length > 0 && $('#cart_rule_select_2').length > 0) {
|
||||
$('#cart_rule_select_1').jscroll().data('jscrollapi').load_scroll(`${baseHref}&type=unselected&search=`);
|
||||
$('#cart_rule_select_2').jscroll().data('jscrollapi').load_scroll(`${baseHref}&type=selected&search=`);
|
||||
|
||||
$('.uncombinable_search_filter').typeWatch({
|
||||
captureLength: -1,
|
||||
highlight: true,
|
||||
wait: 500,
|
||||
callback(text) { combinable_filter('#cart_rule_select_1', text, 'unselected'); },
|
||||
});
|
||||
|
||||
$('.combinable_search_filter').typeWatch({
|
||||
captureLength: -1,
|
||||
highlight: true,
|
||||
wait: 500,
|
||||
callback(text) { combinable_filter('#cart_rule_select_2', text, 'selected'); },
|
||||
});
|
||||
}
|
||||
|
||||
displayProductAttributes();
|
||||
});
|
||||
|
||||
function combinable_filter(id_rule, search, type) {
|
||||
const href = `${baseHref}&type=${encodeURIComponent(type)}&search=${encodeURIComponent(search)}`;
|
||||
$(id_rule).jscroll().data('jscrollapi').load_scroll(href);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
<div class="panel">
|
||||
<h3><i class="icon-tag"></i> {l s='Cart rule' d='Admin.Catalog.Feature'}</h3>
|
||||
<div class="productTabs">
|
||||
<ul class="tab nav nav-tabs">
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_informations" href="javascript:displayCartRuleTab('informations');"><i class="icon-info"></i> {l s='Information' d='Admin.Catalog.Feature'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_conditions" href="javascript:displayCartRuleTab('conditions');"><i class="icon-random"></i> {l s='Conditions' d='Admin.Catalog.Feature'}</a>
|
||||
</li>
|
||||
<li class="tab-row">
|
||||
<a class="tab-page" id="cart_rule_link_actions" href="javascript:displayCartRuleTab('actions');"><i class="icon-wrench"></i> {l s='Actions' d='Admin.Global'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<form action="{$currentIndex|escape}&token={$currentToken|escape}&addcart_rule" id="cart_rule_form" class="form-horizontal" method="post">
|
||||
{if $currentObject->id}<input type="hidden" name="id_cart_rule" value="{$currentObject->id|intval}" />{/if}
|
||||
<input type="hidden" id="currentFormTab" name="currentFormTab" value="informations" />
|
||||
<div id="cart_rule_informations" class="panel cart_rule_tab">
|
||||
{include file='controllers/cart_rules/informations.tpl'}
|
||||
</div>
|
||||
<div id="cart_rule_conditions" class="panel cart_rule_tab">
|
||||
{include file='controllers/cart_rules/conditions.tpl'}
|
||||
</div>
|
||||
<div id="cart_rule_actions" class="panel cart_rule_tab">
|
||||
{include file='controllers/cart_rules/actions.tpl'}
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default pull-right" name="submitAddcart_rule" id="{$table|escape}_form_submit_btn">{l s='Save' d='Admin.Actions'}
|
||||
</button>
|
||||
<!--<input type="submit" value="{l s='Save and stay' d='Admin.Actions'}" class="button" name="submitAddcart_ruleAndStay" id="" />-->
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
var product_rule_groups_counter = {if isset($product_rule_groups_counter)}{$product_rule_groups_counter|intval}{else}0{/if};
|
||||
var product_rule_counters = new Array();
|
||||
var currentToken = '{$currentToken|escape:'quotes'}';
|
||||
var currentFormTab = '{if isset($smarty.post.currentFormTab)}{$smarty.post.currentFormTab|escape:'html'}{else}informations{/if}';
|
||||
var currentText = '{l s='Now' js=1 d='Admin.Catalog.Feature'}';
|
||||
var closeText = '{l s='Done' js=1 d='Admin.Catalog.Feature'}';
|
||||
var timeOnlyTitle = '{l s='Choose Time' js=1 d='Admin.Catalog.Feature'}';
|
||||
var timeText = '{l s='Time' js=1 d='Admin.Catalog.Feature'}';
|
||||
var hourText = '{l s='Hour' js=1 d='Admin.Global'}';
|
||||
var minuteText = '{l s='Minute' js=1 d='Admin.Catalog.Feature'}';
|
||||
|
||||
var languages = new Array();
|
||||
{foreach from=$languages item=language key=k}
|
||||
languages[{$k}] = {
|
||||
id_lang: {$language.id_lang},
|
||||
iso_code: '{$language.iso_code|escape:'quotes'}',
|
||||
name: '{$language.name|escape:'quotes'}'
|
||||
};
|
||||
{/foreach}
|
||||
displayFlags(languages, {$id_lang_default});
|
||||
|
||||
{if isset($refresh_cart) }
|
||||
if (typeof window.parent.order_create !== "undefined") {
|
||||
window.parent.order_create.refreshCart();
|
||||
}
|
||||
window.parent.$.fancybox.close();
|
||||
{/if}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript" src="themes/default/template/controllers/cart_rules/form.js"></script>
|
||||
{include file="footer_toolbar.tpl"}
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,34 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
{extends file="helpers/list/list_header.tpl"}
|
||||
{block name='override_header'}
|
||||
{if $submit_form_ajax}
|
||||
<script type="text/javascript">
|
||||
$('#voucher', window.parent.document).val('{$new_cart_rule->code|escape:'html':'UTF-8'}');
|
||||
parent.add_cart_rule({$new_cart_rule->id|intval});
|
||||
parent.$.fancybox.close();
|
||||
</script>
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,158 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3 required">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='This will be displayed in the cart summary, as well as on the invoice.' d='Admin.Catalog.Help'}">
|
||||
{l s='Name' d='Admin.Global'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
{foreach from=$languages item=language}
|
||||
{if $languages|count > 1}
|
||||
<div class="row">
|
||||
<div class="translatable-field lang-{$language.id_lang}" {if $language.id_lang != $id_lang_default}style="display:none"{/if}>
|
||||
<div class="col-lg-9">
|
||||
{/if}
|
||||
<input id="name_{$language.id_lang|intval}" type="text" name="name_{$language.id_lang|intval}" value="{$currentTab->getFieldValue($currentObject, 'name', $language.id_lang|intval)|escape:'html':'UTF-8'}">
|
||||
{if $languages|count > 1}
|
||||
</div>
|
||||
<div class="col-lg-2">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
{$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});" tabindex="-1">{$language.name}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='For your eyes only. This will never be displayed to the customer.' d='Admin.Catalog.Help'}">
|
||||
{l s='Description' d='Admin.Global'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
<textarea name="description" rows="2" class="textarea-autosize">{$currentTab->getFieldValue($currentObject, 'description')|escape}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{{l s='This is the code users should enter to apply the voucher to a cart. Either create your own code or generate one by clicking on "%generate_label%".' d='Admin.Catalog.Help' sprintf=['%generate_label%' => {l s='Generate' d='Admin.Actions'}]}|escape:"html"}">
|
||||
{l s='Code' d='Admin.Global'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="input-group col-lg-4">
|
||||
<input type="text" id="code" name="code" value="{$currentTab->getFieldValue($currentObject, 'code')|escape}" />
|
||||
<span class="input-group-btn">
|
||||
<a href="javascript:gencode(8);" class="btn btn-default"><i class="icon-random"></i> {l s='Generate' d='Admin.Actions'}</a>
|
||||
</span>
|
||||
</div>
|
||||
<span class="help-block">{l s='Caution! If you leave this field blank, the rule will automatically be applied to benefiting customers.' d='Admin.Catalog.Help'}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="cart-rules-highlight"{if !$currentTab->getFieldValue($currentObject, 'code')} style="display: none;"{/if}>
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='If the voucher is not yet in the cart, it will be displayed in the cart summary.' d='Admin.Catalog.Help'}">
|
||||
{l s='Highlight' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="highlight" id="highlight_on" value="1" {if $currentTab->getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if}/>
|
||||
<label for="highlight_on">{l s='Yes' d='Admin.Global'}</label>
|
||||
<input type="radio" name="highlight" id="highlight_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if} />
|
||||
<label for="highlight_off">{l s='No' d='Admin.Global'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Only applicable if the voucher value is greater than the cart total.' d='Admin.Catalog.Help'}
|
||||
{l s='If you do not allow partial use, the voucher value will be lowered to the total order amount. If you allow partial use, however, a new voucher will be created with the remainder.' d='Admin.Catalog.Help'}">
|
||||
{l s='Partial use' d='Admin.Catalog.Feature'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="partial_use" id="partial_use_on" value="1" {if $currentTab->getFieldValue($currentObject, 'partial_use')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="partial_use_on">{l s='Yes' d='Admin.Global'}</label>
|
||||
<input type="radio" name="partial_use" id="partial_use_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'partial_use')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="partial_use_off">{l s='No' d='Admin.Global'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='Cart rules are applied by priority. A cart rule with a priority of "1" will be processed before a cart rule with a priority of "2".' d='Admin.Catalog.Help'}">
|
||||
{l s='Priority' d='Admin.Global'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-1">
|
||||
<input type="text" class="input-mini" name="priority" value="{$currentTab->getFieldValue($currentObject, 'priority')|intval}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Status' d='Admin.Global'}</label>
|
||||
<div class="col-lg-9">
|
||||
<span class="switch prestashop-switch fixed-width-lg">
|
||||
<input type="radio" name="active" id="active_on" value="1" {if $currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="active_on">{l s='Yes' d='Admin.Global'}</label>
|
||||
<input type="radio" name="active" id="active_off" value="0" {if !$currentTab->getFieldValue($currentObject, 'active')|intval}checked="checked"{/if} />
|
||||
<label class="t" for="active_off">{l s='No' d='Admin.Global'}</label>
|
||||
<a class="slide-button btn"></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(".textarea-autosize").autosize();
|
||||
$(document).ready(function() {
|
||||
$('#code').bind('keyup change', function() {
|
||||
$('#cart-rules-highlight').toggle($(this).val() !== "");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,62 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
<tr id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_tr">
|
||||
<td>
|
||||
<input type="hidden" name="product_rule_{$product_rule_group_id|intval}[]" value="{$product_rule_id}" />
|
||||
<input type="hidden" name="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_type" value="{$product_rule_type|escape}" />
|
||||
{* Everything is on a single line in order to avoid a empty space between the [ ] and the word *}
|
||||
[{if $product_rule_type == 'products'}{l s='Products' d='Admin.Global'}{elseif $product_rule_type == 'categories'}{l s='Categories' d='Admin.Global'}{elseif $product_rule_type == 'manufacturers'}{l s='Brands' d='Admin.Global'}{elseif $product_rule_type == 'suppliers'}{l s='Suppliers' d='Admin.Global'}{elseif $product_rule_type == 'attributes'}{l s='Attributes' d='Admin.Global'}{/if}]
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_match" value="" disabled="disabled" />
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-default" id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_link" href="#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_content">
|
||||
<i class="icon-list-ul"></i>
|
||||
{l s='Choose' d='Admin.Actions'}
|
||||
</a>
|
||||
<div>
|
||||
<div id="product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_content">
|
||||
{$product_rule_choose_content}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<a class="btn btn-default" href="javascript:removeProductRule({$product_rule_group_id|intval}, {$product_rule_id|intval});">
|
||||
<i class="icon-remove"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_content').parent().hide();
|
||||
$("#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_link").fancybox({
|
||||
autoDimensions: false,
|
||||
autoSize: false,
|
||||
width: 900,
|
||||
autoHeight: true,
|
||||
});
|
||||
$(document).ready(function() { updateProductRuleShortDescription($('#product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add')); });
|
||||
</script>
|
||||
@@ -0,0 +1,75 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
<tr id="product_rule_group_{$product_rule_group_id|intval}_tr">
|
||||
<td>
|
||||
<a class="btn btn-default" href="javascript:removeProductRuleGroup({$product_rule_group_id|intval});">
|
||||
<i class="icon-remove text-danger"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-4">{l s='Number of products required in the cart to enjoy the discount:' d='Admin.Catalog.Feature'}</label>
|
||||
<div class="col-lg-1 pull-left">
|
||||
<input type="hidden" name="product_rule_group[]" value="{$product_rule_group_id|intval}" />
|
||||
<input class="form-control" type="text" name="product_rule_group_{$product_rule_group_id|intval}_quantity" value="{$product_rule_group_quantity|intval}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label col-lg-4">{l s='Add a rule concerning'}</label>
|
||||
<div class="col-lg-4">
|
||||
<select class="form-control" id="product_rule_type_{$product_rule_group_id|intval}">
|
||||
<option value="">{l s='-- Choose --' d='Admin.Actions'}</option>
|
||||
<option value="products">{l s='Products' d='Admin.Global'}</option>
|
||||
<option value="attributes">{l s='Attributes' d='Admin.Global'}</option>
|
||||
<option value="categories">{l s='Categories' d='Admin.Global'}</option>
|
||||
<option value="manufacturers">{l s='Brands' d='Admin.Global'}</option>
|
||||
<option value="suppliers">{l s='Suppliers' d='Admin.Global'}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<a class="btn btn-default" href="javascript:addProductRule({$product_rule_group_id|intval});">
|
||||
<i class="icon-plus-sign"></i>
|
||||
{l s="Add" d='Admin.Actions'}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{l s='The product(s) are matching one of these:'}
|
||||
<table id="product_rule_table_{$product_rule_group_id|intval}" class="table table-bordered">
|
||||
{if isset($product_rules) && $product_rules|@count}
|
||||
{foreach from=$product_rules item='product_rule'}
|
||||
{$product_rule}
|
||||
{/foreach}
|
||||
{/if}
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,58 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/OSL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
|
||||
*}
|
||||
<div class="col-lg-12 bootstrap">
|
||||
<div class="col-lg-6">
|
||||
{l s='Unselected' d='Admin.Global'}
|
||||
<select multiple size="20" id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_1">
|
||||
{foreach from=$product_rule_itemlist.unselected item='item'}
|
||||
<option value="{$item.id|intval}" title="{$item.name|escape:'html':'UTF-8'}"> {$item.name|escape:'html':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<div class="clearfix"> </div>
|
||||
<a id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add" class="btn btn-default btn-block" >
|
||||
{l s='Add' d='Admin.Actions'}
|
||||
<i class="icon-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{l s='Selected' d='Admin.Global'}
|
||||
<select multiple size="20" name="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}[]" id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_2" class="product_rule_toselect" >
|
||||
{foreach from=$product_rule_itemlist.selected item='item'}
|
||||
<option value="{$item.id|intval}" title="{$item.name|escape:'html':'UTF-8'}"> {$item.name|escape:'html':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<div class="clearfix"> </div>
|
||||
<a id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_remove" class="btn btn-default btn-block" >
|
||||
<i class="icon-arrow-left"></i>
|
||||
{l s='Remove' d='Admin.Actions'}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_remove').click(function() { removeCartRuleOption(this); updateProductRuleShortDescription(this); });
|
||||
$('#product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add').click(function() { addCartRuleOption(this); updateProductRuleShortDescription(this); });
|
||||
$(document).ready(function() { updateProductRuleShortDescription($('#product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add')); });
|
||||
</script>
|
||||
Reference in New Issue
Block a user