+
+
-
-
- {if !$IS_ENABLED}{intl l='This coupon is disabled, you can enable to the bottom of this form.'}{/if}
-
+ {if !$IS_ENABLED}
+
+
+ {intl l='This coupon is disabled, you can enable to the bottom of this form.'}
+
+ {/if}
-
-
-
- {intl l='Title'}
- {$TITLE}
-
-
- {intl l='Expiration date'}
- {$EXPIRATION_DATE}
-
-
- {intl l='Usage left'}
-
- {if $USAGE_LEFT}
-
- {$USAGE_LEFT}
-
- {else}
-
- 0
-
- {/if}
-
-
-
- {$SHORT_DESCRIPTION}
-
-
- {$DESCRIPTION}
-
-
-
- {if $IS_CUMULATIVE}
-
- {intl l="May be cumulative"}
-
- {else}
-
- {intl l="Can't be cumulative"}
-
- {/if}
-
-
-
-
- {if $IS_REMOVING_POSTAGE}
-
+
+
+
+ {intl l='Title'}
+ {$TITLE}
+
+
+
+ {if $IS_ENABLED}
+
+ {intl l="Is enabled"}
+
+ {else}
+
+ {intl l="Is disabled"}
+
+ {/if}
+
+
+
+
+ {$TOOLTIP}
+
+
+
+ {intl l='Amount'}
+ {$AMOUNT}
+
+
+ {intl l='Expiration date'}
+ {$EXPIRATION_DATE} ({$DAY_LEFT_BEFORE_EXPIRATION} {intl l="days left"})
+
+
+ {intl l='Usage left'}
+
+ {if $USAGE_LEFT}
+
+ {$USAGE_LEFT}
+
+ {else}
+
+ 0
+
+ {/if}
+
+
+
+
+ {if $IS_CUMULATIVE}
+
+ {intl l="May be cumulative"}
+
+ {else}
+
+ {intl l="Can't be cumulative"}
+
+ {/if}
+
+
+
+
+ {if $IS_REMOVING_POSTAGE}
+
{intl l="Will remove postage"}
- {else}
-
+ {else}
+
{intl l="Won't remove postage"}
- {/if}
-
-
-
- {intl l='Amount'}
- {$AMOUNT}
-
-
- {intl l='Application field'}
-
-
- {foreach from=$APPLICATION_CONDITIONS item=rule name=rulesForeach}
- {if !$smarty.foreach.rulesForeach.first}
- {intl l='And'}
- {/if}
- {$rule nofilter}
- {/foreach}
-
-
-
-
- {intl l='Actions'}
-
- {intl l='Edit'}
- {intl l='Enabled'}
-
-
-
-
- {/loop}
-
-
+ {/if}
+
+
+
+
+ {if $IS_AVAILABLE_ON_SPECIAL_OFFERS}
+
+ {intl l="Will be available on special offers"}
+
+ {else}
+
+ {intl l="Won't be available on special offers"}
+
+ {/if}
+
+
+
+ {intl l='Application field'}
+
+
+ {foreach from=$APPLICATION_CONDITIONS item=rule name=rulesForeach}
+ {if !$smarty.foreach.rulesForeach.first}
+ {intl l='And'}
+ {/if}
+ {$rule nofilter}
+ {/foreach}
+
+
+
+
+ {$SHORT_DESCRIPTION}
+
+
+ {$DESCRIPTION}
+
+
+
+
+ {intl l='Edit'}
+
+
+
+
+
+
+
+ {/loop}
{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"}
diff --git a/templates/admin/default/coupon-update.html b/templates/admin/default/coupon-update.html
index 16771539a..0902dae4c 100755
--- a/templates/admin/default/coupon-update.html
+++ b/templates/admin/default/coupon-update.html
@@ -7,19 +7,20 @@
{form name="thelia.admin.coupon.creation"}
{include file='coupon/form.html' formAction={url path={$formAction}} form=$form noRules=false}
{/form}
-
{/block}
@@ -71,8 +72,6 @@
// Save Rules AJAX
couponManager.saveRuleAjax = function() {
$('#constraint-add-operators-values').html('
');
- console.log('about to save');
- console.log(couponManager.rulesToSave);
var $url = '{$urlAjaxUpdateRules}';
$.ajax({
type: "POST",
@@ -88,6 +87,11 @@
}).done(function(data) {
$('#constraint-list').html(data);
$('#constraint-add-operators-values').html('');
+ // Set the rule selector
+ $("#category-rule option").filter(function() {
+ return $(this).val() == 'thelia.constraint.rule.available_for_everyone';
+ }).prop('selected', true);
+
couponManager.onClickUpdateRule();
couponManager.onClickDeleteRule();
});
@@ -109,13 +113,22 @@
}
}).done(function(data) {
$('#constraint-add-operators-values').html(data);
-
+ couponManager.ruleToSave.serviceId = ruleId;
+ if (ruleId == -1) {
+ // Placeholder can't be saved
+ $('#constraint-save-btn').hide();
+ } else {
+ $('#constraint-save-btn').show();
+ }
return callBack();
});
};
// Rules which will be saved
couponManager.rulesToSave = couponManager.initRules();
+
+ $('#constraint-save-btn').hide();
+
});
{/block}
diff --git a/templates/admin/default/coupon/form.html b/templates/admin/default/coupon/form.html
index 5d30d201d..a4ec8b14a 100644
--- a/templates/admin/default/coupon/form.html
+++ b/templates/admin/default/coupon/form.html
@@ -11,152 +11,155 @@
{/form_field}
{form_field form=$form field='success_url'}
-
+
{/form_field}
-
+ {/form_field}
-
-
+ {/form_field}
-
{intl l='Save'}
+
{intl l='Save your modifications'}
@@ -186,22 +189,23 @@