Merge pull request #473 from roadster31/coupon-end
Major coupon types refactoring.
This commit is contained in:
@@ -62,6 +62,7 @@ return array(
|
||||
'Amount, e.g. 12.50' => 'Amount, e.g. 12.50',
|
||||
'An error occured' => 'An error occured',
|
||||
'And' => 'And',
|
||||
'Applies to attribute values :' => 'Applies to attribute values :',
|
||||
'Applies to products :' => 'Applies to products :',
|
||||
'Applies to products in categories :' => 'Applies to products in categories :',
|
||||
'Apply' => 'Apply',
|
||||
@@ -97,6 +98,7 @@ return array(
|
||||
'Catalog' => 'Catalog',
|
||||
'Categories' => 'Categories',
|
||||
'Categories in %cat' => 'Categories in %cat',
|
||||
'Category' => 'Category',
|
||||
'Category created on %date_create. Last modification: %date_change' => 'Category created on %date_create. Last modification: %date_change',
|
||||
'Category title' => 'Category title',
|
||||
'Cellular phone' => 'Cellular phone',
|
||||
@@ -143,6 +145,7 @@ return array(
|
||||
'Confirm' => 'Confirm',
|
||||
'Confirm changes' => 'Confirm changes',
|
||||
'Confirmation' => 'Confirmation',
|
||||
'Content' => 'Content',
|
||||
'Content title' => 'Content title',
|
||||
'Contents in %fold' => 'Contents in %fold',
|
||||
'Copy source text in input field' => 'Copy source text in input field',
|
||||
@@ -331,7 +334,6 @@ return array(
|
||||
'Do you really want to remove this zone ?' => 'Do you really want to remove this zone ?',
|
||||
'Do you really want to set this coupon available to everyone ?' => 'Do you really want to set this coupon available to everyone ?',
|
||||
'Do you really want to use this address by default ?' => 'Do you really want to use this address by default ?',
|
||||
'Document' => 'Document',
|
||||
'Document informations' => 'Document information',
|
||||
'Documents' => 'Documents',
|
||||
'Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.' => 'Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.',
|
||||
@@ -493,6 +495,7 @@ return array(
|
||||
'Flush the Thelia internal cache' => 'Flush the Thelia internal cache',
|
||||
'Flush the assets cache directory' => 'Flush the assets cache directory',
|
||||
'Flush the images and documents cache' => 'Flush the images and documents cache',
|
||||
'Folder' => 'Folder',
|
||||
'Folder created on %date_create. Last modification: %date_change' => 'Folder created on %date_create. Last modification: %date_change',
|
||||
'Folder title' => 'Folder title',
|
||||
'Folders' => 'Folders',
|
||||
@@ -529,7 +532,6 @@ return array(
|
||||
'If a translation is missing or incomplete :' => 'If a translation is missing or incomplete :',
|
||||
'If yes, redirections through Redirect::exec() will be displayed as links' => 'If yes, redirections through Redirect::exec() will be displayed as links',
|
||||
'Il seems that this string contains a Smarty variable ($). If \'s the case, it cannot be transleted properly.' => 'Il seems that this string contains a Smarty variable ($). If \'s the case, it cannot be transleted properly.',
|
||||
'Image' => 'Image',
|
||||
'Image information' => 'Image information',
|
||||
'Images' => 'Images',
|
||||
'Impossible to change default country. Please contact your administrator or try later' => 'Impossible to change default country. Please contact your administrator or try later',
|
||||
@@ -766,8 +768,11 @@ return array(
|
||||
'Select an attribute and click (+) to view available values' => 'Select an attribute and click (+) to view available values',
|
||||
'Select an attribute value...' => 'Select an attribute value...',
|
||||
'Select an attribute...' => 'Select an attribute...',
|
||||
'Select attribute :' => 'Select attribute :',
|
||||
'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => 'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.',
|
||||
'Select here the tax applicable to this product' => 'Select here the tax applicable to this product',
|
||||
'Select offered product :' => 'Select offered product :',
|
||||
'Select offrered product category :' => 'Select offrered product category :',
|
||||
'Select product category :' => 'Select product category :',
|
||||
'Send a mail to this customer' => 'Send a mail to this customer',
|
||||
'Send files' => 'Send files',
|
||||
@@ -939,6 +944,7 @@ return array(
|
||||
'Update this image' => 'Update this image',
|
||||
'Usage count' => 'Usages left',
|
||||
'Usages left' => 'Usages left',
|
||||
'Use Ctrl+click to select (or deselect) more that one attribute value' => 'Use Ctrl+click to select (or deselect) more that one attribute value',
|
||||
'Use Ctrl+click to select (or deselect) more that one category' => 'Use Ctrl+click to select (or deselect) more that one category',
|
||||
'Use Ctrl+click to select (or deselect) more that one country' => 'Utiliser Ctrl+clic pour sélectionner (ou dé-sélectionner) plusieurs pays.',
|
||||
'Use Ctrl+click to select (or deselect) more that one product' => 'Use Ctrl+click to select (or deselect) more that one product',
|
||||
|
||||
@@ -59,8 +59,12 @@ return array(
|
||||
'Alpha code 2' => 'Code alpha 2',
|
||||
'Alpha code 3' => 'Code alpha 3',
|
||||
'Amount' => 'Montant',
|
||||
'Amount, e.g. 12.50' => 'Montant, par ex. 12.50',
|
||||
'An error occured' => 'Une erreur est survenue',
|
||||
'And' => 'Et',
|
||||
'Applies to attribute values :' => 'Pour les valeurs de déclinaison :',
|
||||
'Applies to products :' => 'Pour les produits',
|
||||
'Applies to products in categories :' => 'Pour les produits des catégories :',
|
||||
'Apply' => 'Appliquer',
|
||||
'Associated countries' => 'Pays dans la zone',
|
||||
'Associations' => 'Associations',
|
||||
@@ -286,6 +290,7 @@ return array(
|
||||
'Disabled' => 'Désactivé',
|
||||
'Discount' => 'Remise',
|
||||
'Discount amount' => 'Montant de réduction',
|
||||
'Discount percentage' => 'Pourcentage de remise',
|
||||
'Do not use a product template' => 'Ne pas utiliser de gabarit',
|
||||
'Do you really want to add this attribute to all product templates ?' => 'Voulez-vous vraiment ajouter cette déclinaison de tous les gabarits de produit ?',
|
||||
'Do you really want to add this feature to all product templates ?' => 'Voulez-vous vraiment ajouter cette caractéristique à tous les gabarits de produit ?',
|
||||
@@ -329,7 +334,6 @@ return array(
|
||||
'Do you really want to remove this zone ?' => 'Voulez-vous vraiment supprimer cette zone ?',
|
||||
'Do you really want to set this coupon available to everyone ?' => 'êtes-vous sur de vouloir rendre ce code promo disponible à tout le monde ?',
|
||||
'Do you really want to use this address by default ?' => 'Voulez-vous vraiment utiliser cette adresse comme adresse par défaut ?',
|
||||
'Document' => 'Document',
|
||||
'Document informations' => 'Informations du document',
|
||||
'Documents' => 'Documents',
|
||||
'Don\'t repeat keywords over and over in a row. Rather, put in keyword phrases.' => 'Ne répétez pas sans cesse les même mots-clés dans une ligne. Préférez utiliser des expressions de mots-clés',
|
||||
@@ -528,7 +532,6 @@ return array(
|
||||
'If a translation is missing or incomplete :' => 'Si une traduction est manquante ou incomplète :',
|
||||
'If yes, redirections through Redirect::exec() will be displayed as links' => 'Si oui, les redirections générés pas Redirect::exec seront affichés par des liens',
|
||||
'Il seems that this string contains a Smarty variable ($). If \'s the case, it cannot be transleted properly.' => 'La chaîne semble contient une variable smarty ($). Si c\'est le cas elle ne peut pas être traduite correctement',
|
||||
'Image' => 'Image',
|
||||
'Image information' => 'Information de l\'image',
|
||||
'Images' => 'Images',
|
||||
'Impossible to change default country. Please contact your administrator or try later' => 'Impossible de modifier le pays par défaut. Veuillez contacter votre administrateur ou réessayer plus tard',
|
||||
@@ -639,6 +642,7 @@ return array(
|
||||
'Payment information' => 'Informations de paiement',
|
||||
'Payment module' => 'Module de paiement',
|
||||
'Payment modules' => 'Modules de payment',
|
||||
'Percent Discount' => 'Pourcentage de remise',
|
||||
'Period' => 'Période',
|
||||
'Phone' => 'Téléphone',
|
||||
'Phone number' => 'Numéro de téléphone',
|
||||
@@ -655,6 +659,7 @@ return array(
|
||||
'Please select the PDF template to translate' => 'Sélectionnez le template PDF à traduire',
|
||||
'Please select the module component' => 'Choisissez un composant du module',
|
||||
'Please select the module to translate' => 'Sélectionnez le module à traduire',
|
||||
'Please select...' => 'Merci de choisir...',
|
||||
'Please wait, loading' => 'Chargement, veuillez patienter',
|
||||
'Port' => 'Port',
|
||||
'Port :' => 'Port : ',
|
||||
@@ -763,8 +768,12 @@ return array(
|
||||
'Select an attribute and click (+) to view available values' => 'Sélectionnez une déclinaison et cliquez sur (+) pour voir les valeurs disponibles',
|
||||
'Select an attribute value...' => 'Sélectionnez une valeur de déclinaison...',
|
||||
'Select an attribute...' => 'Sélectionnez une déclinaison...',
|
||||
'Select attribute :' => 'Choisissez une déclinaison',
|
||||
'Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.' => 'Sélectionnez les valeurs de déclinaison à combiner. Vous pouvez entrer une valeur par défaut pour certains champs des combinaisons générées.',
|
||||
'Select here the tax applicable to this product' => 'Sélectionnez ici la taxe applicable sur ce produit',
|
||||
'Select offered product :' => 'Produit offert :',
|
||||
'Select offrered product category :' => 'Catégorie du produit offert :',
|
||||
'Select product category :' => 'Catégorie des propduits :',
|
||||
'Send a mail to this customer' => 'Contacter ce client par mail',
|
||||
'Send files' => 'Envoyer des fichiers',
|
||||
'Sequential number of log line' => 'Sequential number of log line',
|
||||
@@ -935,6 +944,7 @@ return array(
|
||||
'Update this image' => 'Modifier cette image',
|
||||
'Usage count' => 'Nombre d\'utilisations',
|
||||
'Usages left' => 'Utulisations restantes',
|
||||
'Use Ctrl+click to select (or deselect) more that one attribute value' => 'Ctrl+clic permet de séléctionner (ou dé-selectionner) plusieurs valeurs de déclinaison.',
|
||||
'Use Ctrl+click to select (or deselect) more that one category' => 'Ctrl+Clic permet de sélectionner ou dé-sélectionner plus d\'une catégorie',
|
||||
'Use Ctrl+click to select (or deselect) more that one country' => 'Ctrl+Clic permet de sélectionner ou dé-sélectionner plus d\'un pays',
|
||||
'Use Ctrl+click to select (or deselect) more that one product' => 'Ctrl+Clic permet de sélectionner ou dé-sélectionner plus d\'un produit',
|
||||
|
||||
@@ -214,10 +214,10 @@ $(function($){
|
||||
// ***********************************************
|
||||
|
||||
$.couponManager.displayEfffect = function(optionSelected) {
|
||||
var mainDiv = $('#coupon-type');
|
||||
mainDiv.find('.typeToolTip').html(optionSelected.data('description'));
|
||||
var typeDiv = $('#coupon-type');
|
||||
typeDiv.find('.typeToolTip').html(optionSelected.data('description'));
|
||||
|
||||
var inputsDiv = mainDiv.find('.inputs');
|
||||
var inputsDiv = $('.inputs', $('#coupon-inputs'));
|
||||
inputsDiv.html('<div class="loading" ></div>');
|
||||
var url = $.couponManager.urlAjaxAdminCouponDrawInputs;
|
||||
url = url.replace('couponServiceId', optionSelected.val());
|
||||
@@ -248,11 +248,11 @@ $(function($){
|
||||
|
||||
// Reload effect inputs when changing effect
|
||||
$.couponManager.onEffectChange = function() {
|
||||
var mainDiv = $('#coupon-type');
|
||||
var optionSelected = mainDiv.find('#type option:selected');
|
||||
mainDiv.find('.typeToolTip').html(optionSelected.data('description'));
|
||||
var typeDiv = $('#coupon-type');
|
||||
var optionSelected = typeDiv.find('#type option:selected');
|
||||
typeDiv.find('.typeToolTip').html(optionSelected.data('description'));
|
||||
|
||||
mainDiv.find('#type').on('change', function () {
|
||||
typeDiv.find('#type').on('change', function () {
|
||||
var optionSelected = $('option:selected', this);
|
||||
$.couponManager.displayEfffect(optionSelected);
|
||||
|
||||
|
||||
@@ -54,7 +54,31 @@
|
||||
{if $error}{$message}{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
<div id="coupon-type">
|
||||
{form_field form=$form field='type'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="type" class="control-label">{intl l='Coupon type * :'}</label>
|
||||
<select required name="{$name}" id="type" class="col-md-12 form-control">
|
||||
<option value="" data-description="" data-inputName="">{intl l='Please select a coupon type'}</option>
|
||||
{foreach from=$availableCoupons item=availableCoupon}
|
||||
<option value="{$availableCoupon.serviceId}" data-description="{$availableCoupon.toolTip}" data-inputName="{$availableCoupon.inputName}" {if $value == $availableCoupon.serviceId}selected{/if}>
|
||||
{$availableCoupon.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{if $error}{$message}{/if}
|
||||
<span class="help-block typeToolTip">{$availableCoupons.0.toolTip}</span>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{form_field form=$form field='isEnabled'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="is-enabled" class="checkbox control-label">
|
||||
@@ -163,23 +187,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div id="coupon-type">
|
||||
{form_field form=$form field='type'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="type" class="control-label">{intl l='Coupon type * :'}</label>
|
||||
<select required name="{$name}" id="type" class="col-md-12 form-control">
|
||||
<option value="" data-description="" data-inputName="">{intl l='Please select a coupon type'}</option>
|
||||
{foreach from=$availableCoupons item=availableCoupon}
|
||||
<option value="{$availableCoupon.serviceId}" data-description="{$availableCoupon.toolTip}" data-inputName="{$availableCoupon.inputName}" {if $value == $availableCoupon.serviceId}selected{/if}>
|
||||
{$availableCoupon.name}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{if $error}{$message}{/if}
|
||||
<span class="help-block typeToolTip">{$availableCoupons.0.toolTip}</span>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
<div id="coupon-inputs">
|
||||
<div class="inputs">
|
||||
{$couponInputsHtml nofilter}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{loop type="attribute_availability" attribute={$smarty.post.attribute_id} name="list-of-attribute_avs" backend_context="1"}
|
||||
<option value="{$ID}">{$TITLE}</option>
|
||||
{/loop}
|
||||
@@ -0,0 +1,65 @@
|
||||
{block name="discount-field"}{/block}
|
||||
|
||||
<div class="form-group input-coupon-attribute-id">
|
||||
|
||||
<label for="coupon-category-id">{intl l="Select attribute :"}</label>
|
||||
|
||||
<select required class="form-control" id="coupon-attribute-id" name="{$attribute_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="attribute" name="list-of-attributes" order="alpha" backend_context="1"}
|
||||
<option value="{$ID}" {if $ID == $attribute_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-coupon-attributeAvs-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-coupon-attributeAvs-id" {if $attribute_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="coupon-products-id">{intl l="Applies to attribute values :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-attributeAvs-id" name="{$attribute_av_field_name}[]">
|
||||
{loop type="attribute_availability" attribute=$attribute_value|default:0 name="list-of-attribute_avs" backend_context="1"}
|
||||
<option value="{$ID}" {if in_array($ID, $attribute_av_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one attribute value'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
|
||||
var $catSelect = $('#coupon-attribute-id');
|
||||
|
||||
$catSelect.change(function(ev) {
|
||||
|
||||
var $attribute_id = $(this).val();
|
||||
|
||||
$('#input-coupon-attributeAvs-id').hide();
|
||||
$('#coupon-attributeAvs-id').html('');
|
||||
|
||||
if ($attribute_id != 0) {
|
||||
|
||||
$('#input-coupon-attributeAvs-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-attribute-avs-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
attribute_id: $attribute_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('#coupon-attributeAvs-id').html(options);
|
||||
$('#input-coupon-attributeAvs-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-coupon-attributeAvs-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
{block name="javascript-init"}{/block}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,20 @@
|
||||
{block name="discount-field"}{/block}
|
||||
|
||||
<div class="form-group input-coupon-categories-id">
|
||||
|
||||
<label for="coupon-categories-id">{intl l="Applies to products in categories :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-categories-id" name="{$categories_field_name}[]">
|
||||
{loop type="category-tree" category=0 name="list-of-categories" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if in_array($ID, $categories_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
{block name="javascript-init"}{/block}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,65 @@
|
||||
{block name="discount-field"}{/block}
|
||||
|
||||
<div class="form-group input-coupon-category-id">
|
||||
|
||||
<label for="coupon-category-id">{intl l="Select product category :"}</label>
|
||||
|
||||
<select required class="form-control" id="coupon-category-id" name="{$category_id_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="category-tree" category=0 name="list-of-category" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if $ID == $category_id_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-coupon-products-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-coupon-products-id" {if $category_id_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="coupon-products-id">{intl l="Applies to products :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-products-id" name="{$products_field_name}[]">
|
||||
{loop type="product" category=$category_id_value|default:0 name="list-of-products" backend_context="1"}
|
||||
<option value="{$ID}" {if in_array($ID, $products_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one product'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
|
||||
var $catSelect = $('#coupon-category-id');
|
||||
|
||||
$catSelect.change(function(ev) {
|
||||
|
||||
var $category_id = $(this).val();
|
||||
|
||||
$('#input-coupon-products-id').hide();
|
||||
$('#coupon-products-id').html('');
|
||||
|
||||
if ($category_id != 0) {
|
||||
|
||||
$('#input-coupon-products-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-products-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_id: $category_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('#coupon-products-id').html(options);
|
||||
$('#input-coupon-products-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-coupon-products-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
{block name="javascript-init"}{/block}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,69 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-products.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-free-product-category-id">
|
||||
|
||||
<label for="free-product-category-id">{intl l="Select offrered product category :"}</label>
|
||||
|
||||
<select required class="form-control" id="free-product-category-id" name="{$offered_category_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="category-tree" category=0 name="list-of-category" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if $ID == $offered_category_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-free-products-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-free-products-id" {if $offered_category_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="free-products-id">{intl l="Select offered product :"}</label>
|
||||
|
||||
<select required class="form-control" id="free-products-id" name="{$offered_product_field_name}">
|
||||
{loop type="product" category=$offered_category_value|default:0 name="list-of-products" backend_context="1"}
|
||||
<option value="{$ID}" {if $ID == $offered_product_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name="javascript-init"}
|
||||
|
||||
// Hide selected products category selection if the
|
||||
// offered product is not yet selected.
|
||||
if ({$offered_category_value|default:0} == 0) {
|
||||
$('.input-coupon-category-id').hide();
|
||||
}
|
||||
|
||||
var $freeCatSelect = $('#free-product-category-id');
|
||||
|
||||
$freeCatSelect.change(function(ev) {
|
||||
|
||||
var $category_id = $(this).val();
|
||||
|
||||
$('.input-coupon-category-id').hide();
|
||||
$('#input-free-products-id').hide();
|
||||
$('#free-products-id').html('');
|
||||
|
||||
if ($category_id != 0) {
|
||||
|
||||
$('#input-free-products-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-products-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_id: $category_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('.input-coupon-category-id').show();
|
||||
$('#free-products-id').html(options);
|
||||
$('#input-free-products-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-free-products-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
{/block}
|
||||
@@ -0,0 +1,16 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-attributes.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-amount">
|
||||
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -1,26 +1,16 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-categories.html"}
|
||||
|
||||
<div class="form-group input-coupon-amount">
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-amount">
|
||||
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group input-coupon-categories-id">
|
||||
|
||||
<label for="coupon-categories-id">{intl l="Applies to products in categories :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-categories-id" name="{$categories_field_name}[]">
|
||||
{loop type="category-tree" category=0 name="list-of-categories" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if in_array($ID, $categories_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -1,77 +1,16 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-products.html"}
|
||||
|
||||
<div class="form-group input-coupon-amount">
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-amount">
|
||||
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
<label for="coupon-amount" class="control-label">{intl l="Discount amount"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="14.50">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group input-coupon-category-id">
|
||||
|
||||
<label for="coupon-category-id">{intl l="Select product category :"}</label>
|
||||
|
||||
<select required class="form-control" id="coupon-category-id" name="{$category_id_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="category-tree" category=0 name="list-of-category" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if $ID == $category_id_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-coupon-products-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-coupon-products-id" {if $category_id_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="coupon-products-id">{intl l="Applies to products :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-products-id" name="{$products_field_name}[]">
|
||||
{loop type="product" category=$category_id_value name="list-of-products" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if in_array($ID, $products_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
|
||||
var $catSelect = $('#coupon-category-id');
|
||||
|
||||
$catSelect.change(function(ev) {
|
||||
|
||||
var $category_id = $(this).val();
|
||||
|
||||
$('#input-coupon-products-id').hide();
|
||||
$('#coupon-products-id').html('');
|
||||
|
||||
if ($category_id != 0) {
|
||||
|
||||
$('#input-coupon-products-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-products-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_id: $category_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('#coupon-products-id').html(options);
|
||||
$('#input-coupon-products-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-coupon-products-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
{/block}
|
||||
@@ -0,0 +1,14 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-attributes.html"}
|
||||
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-percentage">
|
||||
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -1,24 +1,14 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-categories.html"}
|
||||
|
||||
<div class="form-group input-coupon-percentage">
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-percentage">
|
||||
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
|
||||
<div class="input-group-addon">%</div>
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group input-coupon-categories-id">
|
||||
|
||||
<label for="coupon-categories-id">{intl l="Applies to products in categories :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-categories-id" name="{$categories_field_name}[]">
|
||||
{loop type="category-tree" category=0 name="list-of-categories" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if in_array($ID, $categories_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -1,75 +1,14 @@
|
||||
{extends file="coupon/type-fragments/base-remove-on-products.html"}
|
||||
|
||||
<div class="form-group input-coupon-percentage">
|
||||
{block name="discount-field"}
|
||||
<div class="form-group input-coupon-percentage">
|
||||
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
<label for="coupon-percentage" class="control-label">{intl l="Discount percentage"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
<div class="input-group">
|
||||
<input id="coupon-percentage" type="number" class="form-control" name="{$percentage_field_name}" value="{$percentage_value}" placeholder="5">
|
||||
|
||||
<div class="input-group-addon">%</div>
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group input-coupon-category-id">
|
||||
|
||||
<label for="coupon-category-id">{intl l="Select product category :"}</label>
|
||||
|
||||
<select required class="form-control" id="coupon-category-id" name="{$category_id_field_name}">
|
||||
<option value="0">{intl l="Please select..."}</option>
|
||||
{loop type="category-tree" category=0 name="list-of-category" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if $ID == $category_id_value}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
|
||||
<div class="loading" id="input-coupon-products-id-loading" style="display: none"></div>
|
||||
|
||||
<div class="form-group" id="input-coupon-products-id" {if $category_id_value == 0}style="display: none"{/if}>
|
||||
|
||||
<label for="coupon-products-id">{intl l="Applies to products :"}</label>
|
||||
|
||||
<select required multiple size="10" class="form-control" id="coupon-products-id" name="{$products_field_name}[]">
|
||||
{loop type="product" category=$category_id_value name="list-of-products" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}" {if in_array($ID, $products_values)}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="label-help-block">{intl l='Use Ctrl+click to select (or deselect) more that one category'}</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function couponInputFormSetup() {
|
||||
|
||||
var $catSelect = $('#coupon-category-id');
|
||||
|
||||
$catSelect.change(function(ev) {
|
||||
|
||||
var $category_id = $(this).val();
|
||||
|
||||
$('#input-coupon-products-id').hide();
|
||||
$('#coupon-products-id').html('');
|
||||
|
||||
if ($category_id != 0) {
|
||||
|
||||
$('#input-coupon-products-id-loading').show();
|
||||
|
||||
$.ajax({
|
||||
url: "{url path='/admin/coupon/type-fragments/ajax-products-list'}",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_id: $category_id
|
||||
},
|
||||
success: function(options) {
|
||||
$('#coupon-products-id').html(options);
|
||||
$('#input-coupon-products-id').show();
|
||||
},
|
||||
complete: function() {
|
||||
$('#input-coupon-products-id-loading').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
{/block}
|
||||
@@ -2,7 +2,7 @@
|
||||
<label for="coupon-amount" class="control-label">{intl l='Discount amount'}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$fieldName}" value="{$value}" placeholder="{intl l="Amount, e.g. 12.50"}">
|
||||
<input id="coupon-amount" type="money" class="form-control" name="{$amount_field_name}" value="{$amount_value}" placeholder="{intl l="Amount, e.g. 12.50"}">
|
||||
|
||||
{loop type="currency" name="get-symbol" default_only="true"}
|
||||
<div class="input-group-addon">{$SYMBOL}</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<label for="coupon-percent" class="control-label">{intl l='Percent Discount'}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<input id="coupon-percent" class="form-control" name="{$fieldName}" type="text" value="{$value}"/>
|
||||
<input id="coupon-percent" class="form-control" name="{$percentage_field_name}" type="text" value="{$percentage_value}"/>
|
||||
<div class="input-group-addon">%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user