Added new coupon types
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{loop type="product" category={$smarty.post.category_id} name="list-of-products" backend_context="1"}
|
||||
<option style="padding-left: {$LEVEL * 10}px" value="{$ID}">{$TITLE}</option>
|
||||
{/loop}
|
||||
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group input-coupon-categories-id">
|
||||
|
||||
<label for="coupon-categories-id">{intl l="Applies to products in categories :"}</label>
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,75 @@
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user