diff --git a/core/lib/Thelia/Action/Coupon.php b/core/lib/Thelia/Action/Coupon.php
index 036502c68..c1affe633 100755
--- a/core/lib/Thelia/Action/Coupon.php
+++ b/core/lib/Thelia/Action/Coupon.php
@@ -32,6 +32,7 @@ use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Coupon\CouponFactory;
use Thelia\Coupon\CouponManager;
+use Thelia\Coupon\CouponRuleCollection;
use Thelia\Coupon\Type\CouponInterface;
use Thelia\Model\Coupon as CouponModel;
@@ -137,11 +138,21 @@ class Coupon extends BaseAction implements EventSubscriberInterface
{
$coupon->setDispatcher($this->getDispatcher());
+ // Set default rule if none found
+ $noConditionRule = $this->container->get('thelia.constraint.rule.available_for_everyone');
+ $constraintFactory = $this->container->get('thelia.constraint.factory');
+ $couponRuleCollection = new CouponRuleCollection();
+ $couponRuleCollection->add($noConditionRule);
+ $defaultSerializedRule = $constraintFactory->serializeCouponRuleCollection(
+ $couponRuleCollection
+ );
+
+
$coupon->createOrUpdate(
$event->getCode(),
$event->getTitle(),
$event->getAmount(),
- $event->getEffect(),
+ $event->getType(),
$event->isRemovingPostage(),
$event->getShortDescription(),
$event->getDescription(),
@@ -150,9 +161,12 @@ class Coupon extends BaseAction implements EventSubscriberInterface
$event->isAvailableOnSpecialOffers(),
$event->isCumulative(),
$event->getMaxUsage(),
+ $defaultSerializedRule,
$event->getLocale()
);
+
+
$event->setCoupon($coupon);
}
diff --git a/core/lib/Thelia/Action/Image.php b/core/lib/Thelia/Action/Image.php
index 4660f93b8..ba5ee153f 100755
--- a/core/lib/Thelia/Action/Image.php
+++ b/core/lib/Thelia/Action/Image.php
@@ -229,7 +229,7 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
// Compute the image URL
$processed_image_url = $this->getCacheFileURL($subdir, basename($cacheFilePath));
- // compute the full resulution image path in cache
+ // compute the full resolution image path in cache
$original_image_url = $this->getCacheFileURL($subdir, basename($originalImagePathInCache));
// Update the event with file path and file URL
diff --git a/core/lib/Thelia/Controller/Admin/CouponController.php b/core/lib/Thelia/Controller/Admin/CouponController.php
index f7804de8e..1c7b1c603 100755
--- a/core/lib/Thelia/Controller/Admin/CouponController.php
+++ b/core/lib/Thelia/Controller/Admin/CouponController.php
@@ -78,13 +78,13 @@ class CouponController extends BaseAdminController
$args['urlReadCoupon'] = $this->getRoute(
'admin.coupon.read',
- array('couponId' => 'couponId'),
+ array('couponId' => 0),
Router::ABSOLUTE_URL
);
$args['urlEditCoupon'] = $this->getRoute(
'admin.coupon.update',
- array('couponId' => 'couponId'),
+ array('couponId' => 0),
Router::ABSOLUTE_URL
);
@@ -164,7 +164,7 @@ class CouponController extends BaseAdminController
$args['dateFormat'] = $this->getSession()->getLang()->getDateFormat();
$args['availableCoupons'] = $this->getAvailableCoupons();
- $args['formAction'] = 'admin/coupon/create/';
+ $args['formAction'] = 'admin/coupon/create';
return $this->render(
'coupon-create',
@@ -223,7 +223,7 @@ class CouponController extends BaseAdminController
'code' => $coupon->getCode(),
'title' => $coupon->getTitle(),
'amount' => $coupon->getAmount(),
- 'effect' => $coupon->getType(),
+ 'type' => $coupon->getType(),
'shortDescription' => $coupon->getShortDescription(),
'description' => $coupon->getDescription(),
'isEnabled' => ($coupon->getIsEnabled() == 1),
@@ -271,7 +271,7 @@ class CouponController extends BaseAdminController
Router::ABSOLUTE_URL
);
- $args['formAction'] = 'admin/coupon/update/' . $couponId;
+ $args['formAction'] = 'admin/coupon/update' . $couponId;
return $this->render('coupon-update', $args);
}
@@ -347,20 +347,7 @@ class CouponController extends BaseAdminController
);
$couponEvent = new CouponCreateOrUpdateEvent(
- $coupon->getCode(),
- $coupon->getTitle(),
- $coupon->getAmount(),
- $coupon->getType(),
- $coupon->getShortDescription(),
- $coupon->getDescription(),
- $coupon->getIsEnabled(),
- $coupon->getExpirationDate(),
- $coupon->getIsAvailableOnSpecialOffers(),
- $coupon->getIsCumulative(),
- $coupon->getIsRemovingPostage(),
- $coupon->getMaxUsage(),
- $rules,
- $coupon->getLocale()
+ $coupon->getCode(), $coupon->getTitle(), $coupon->getAmount(), $coupon->getType(), $coupon->getShortDescription(), $coupon->getDescription(), $coupon->getIsEnabled(), $coupon->getExpirationDate(), $coupon->getIsAvailableOnSpecialOffers(), $coupon->getIsCumulative(), $coupon->getIsRemovingPostage(), $coupon->getMaxUsage(), $coupon->getLocale()
);
$couponEvent->setCoupon($coupon);
@@ -497,20 +484,7 @@ class CouponController extends BaseAdminController
$data = $form->getData();
$couponEvent = new CouponCreateOrUpdateEvent(
- $data['code'],
- $data['title'],
- $data['amount'],
- $data['type'],
- $data['shortDescription'],
- $data['description'],
- $data['isEnabled'],
- \DateTime::createFromFormat('Y-m-d', $data['expirationDate']),
- $data['isAvailableOnSpecialOffers'],
- $data['isCumulative'],
- $data['isRemovingPostage'],
- $data['maxUsage'],
- new CouponRuleCollection(array()),
- $data['locale']
+ $data['code'], $data['title'], $data['amount'], $data['type'], $data['shortDescription'], $data['description'], $data['isEnabled'], \DateTime::createFromFormat('Y-m-d', $data['expirationDate']), $data['isAvailableOnSpecialOffers'], $data['isCumulative'], $data['isRemovingPostage'], $data['maxUsage'], $data['locale']
);
// Dispatch Event to the Action
@@ -538,7 +512,6 @@ class CouponController extends BaseAdminController
} catch (FormValidationException $e) {
// Invalid data entered
$message = 'Please check your input:';
- $this->logError($action, $message, $e);
} catch (\Exception $e) {
// Any other error
diff --git a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php
index e8f54fffb..4b85065dc 100644
--- a/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php
+++ b/core/lib/Thelia/Core/Event/Coupon/CouponCreateOrUpdateEvent.php
@@ -78,8 +78,8 @@ class CouponCreateOrUpdateEvent extends ActionEvent
/** @var Coupon Coupon model */
protected $coupon = null;
- /** @var string Coupon effect */
- protected $effect;
+ /** @var string Coupon type */
+ protected $type;
/** @var string Language code ISO (ex: fr_FR) */
protected $locale = null;
@@ -87,36 +87,22 @@ class CouponCreateOrUpdateEvent extends ActionEvent
/**
* Constructor
*
- * @param string $code Coupon Code
- * @param string $title Coupon title
- * @param float $amount Amount removed from the Total Checkout
- * @param string $type Coupon type
- * @param string $shortDescription Coupon short description
- * @param string $description Coupon description
- * @param boolean $isEnabled Enable/Disable
- * @param \DateTime $expirationDate Coupon expiration date
- * @param boolean $isAvailableOnSpecialOffers Is available on special offers
- * @param boolean $isCumulative Is cumulative
- * @param boolean $isRemovingPostage Is removing Postage
- * @param int $maxUsage Coupon quantity
- * @param CouponRuleCollection $rules CouponRuleInterface to add
- * @param string $locale Coupon Language code ISO (ex: fr_FR)
+ * @param string $code Coupon Code
+ * @param string $title Coupon title
+ * @param float $amount Amount removed from the Total Checkout
+ * @param string $type Coupon type
+ * @param string $shortDescription Coupon short description
+ * @param string $description Coupon description
+ * @param boolean $isEnabled Enable/Disable
+ * @param \DateTime $expirationDate Coupon expiration date
+ * @param boolean $isAvailableOnSpecialOffers Is available on special offers
+ * @param boolean $isCumulative Is cumulative
+ * @param boolean $isRemovingPostage Is removing Postage
+ * @param int $maxUsage Coupon quantity
+ * @param string $locale Coupon Language code ISO (ex: fr_FR)
*/
public function __construct(
- $code,
- $title,
- $amount,
- $type,
- $shortDescription,
- $description,
- $isEnabled,
- \DateTime $expirationDate,
- $isAvailableOnSpecialOffers,
- $isCumulative,
- $isRemovingPostage,
- $maxUsage,
- $rules,
- $locale
+ $code, $title, $amount, $type, $shortDescription, $description, $isEnabled, \DateTime $expirationDate, $isAvailableOnSpecialOffers, $isCumulative, $isRemovingPostage, $maxUsage, $locale
) {
$this->amount = $amount;
$this->code = $code;
@@ -127,7 +113,6 @@ class CouponCreateOrUpdateEvent extends ActionEvent
$this->isEnabled = $isEnabled;
$this->isRemovingPostage = $isRemovingPostage;
$this->maxUsage = $maxUsage;
- $this->rules = $rules;
$this->shortDescription = $shortDescription;
$this->title = $title;
$this->type = $type;
@@ -206,22 +191,6 @@ class CouponCreateOrUpdateEvent extends ActionEvent
return $this->amount;
}
- /**
- * Return condition to validate the Coupon or not
- *
- * @return CouponRuleCollection
- */
- public function getRules()
- {
- if ($this->rules === null || !is_object($this->rules)) {
- $rules = $this->rules;
- } else {
- $rules = clone $this->rules;
- }
-
- return $rules;
- }
-
/**
* Return Coupon expiration date
*
diff --git a/core/lib/Thelia/Model/Coupon.php b/core/lib/Thelia/Model/Coupon.php
index e40fd9078..d25c48354 100755
--- a/core/lib/Thelia/Model/Coupon.php
+++ b/core/lib/Thelia/Model/Coupon.php
@@ -63,11 +63,12 @@ class Coupon extends BaseCoupon
* @param boolean $isAvailableOnSpecialOffers Is available on special offers
* @param boolean $isCumulative Is cumulative
* @param int $maxUsage Coupon quantity
+ * @param string $defaultSerializedRule Serialized default rule added if none found
* @param string $locale Coupon Language code ISO (ex: fr_FR)
*
* @throws \Exception
*/
- function createOrUpdate($code, $title, $amount, $type, $isRemovingPostage, $shortDescription, $description, $isEnabled, $expirationDate, $isAvailableOnSpecialOffers, $isCumulative, $maxUsage, $locale = null)
+ function createOrUpdate($code, $title, $amount, $type, $isRemovingPostage, $shortDescription, $description, $isEnabled, $expirationDate, $isAvailableOnSpecialOffers, $isCumulative, $maxUsage, $defaultSerializedRule, $locale = null)
{
$this->setCode($code)
->setTitle($title)
@@ -82,6 +83,11 @@ class Coupon extends BaseCoupon
->setIsCumulative($isCumulative)
->setMaxUsage($maxUsage);
+ // If no rule given, set default rule
+ if (null === $this->getSerializedRules()) {
+ $this->setSerializedRules($defaultSerializedRule);
+ }
+
// Set object language (i18n)
if (!is_null($locale)) {
$this->setLocale($locale);
diff --git a/templates/admin/default/admin-layout.tpl b/templates/admin/default/admin-layout.tpl
index 553466def..2dbf87a46 100644
--- a/templates/admin/default/admin-layout.tpl
+++ b/templates/admin/default/admin-layout.tpl
@@ -147,7 +147,7 @@
{loop name="menu-auth-coupon" type="auth" roles="ADMIN" permissions="admin.coupon.view"}
{/loop}
diff --git a/templates/admin/default/assets/js/coupon.js b/templates/admin/default/assets/js/coupon.js
index dae26d4b4..089db5ef2 100644
--- a/templates/admin/default/assets/js/coupon.js
+++ b/templates/admin/default/assets/js/coupon.js
@@ -1,5 +1,17 @@
$(function($){
+ // Manage how coupon and rules are saved
+ $.couponManager = {};
+ // Rule to be saved
+ $.couponManager.ruleToSave = {};
+ $.couponManager.ruleToSave.serviceId = false;
+ $.couponManager.ruleToSave.operators = {};
+ $.couponManager.ruleToSave.values = {};
+ // Rules payload to save
+ $.couponManager.rulesToSave = [];
+ // Rule being updated id
+ $.couponManager.ruleToUpdateId = false;
+
// Clean array from deleteValue (undefined) keys
Array.prototype.clean = function(deleteValue) {
for (var i = 0; i < this.length; i++) {
@@ -12,109 +24,109 @@ $(function($){
};
// Remove 1 Rule then Save Rules AJAX
- couponManager.removeRuleAjax = function(id) {
+ $.couponManager.removeRuleAjax = function(id) {
// Delete rule in temporary array
- delete couponManager.rulesToSave[id];
- couponManager.rulesToSave.clean(undefined);
+ delete $.couponManager.rulesToSave[id];
+ $.couponManager.rulesToSave.clean(undefined);
// Save
- couponManager.saveRuleAjax();
+ $.couponManager.saveRuleAjax();
};
// Add 1 Rule / or update the temporary Rules array then Save Rules via AJAX
- couponManager.createOrUpdateRuleAjax = function() {
- var id = couponManager.ruleToUpdateId;
+ $.couponManager.createOrUpdateRuleAjax = function() {
+ var id = $.couponManager.ruleToUpdateId;
// If create
if(!id) {
- couponManager.rulesToSave.push(couponManager.ruleToSave);
+ $.couponManager.rulesToSave.push($.couponManager.ruleToSave);
} else { // else update
- couponManager.rulesToSave[id] = couponManager.ruleToSave;
+ $.couponManager.rulesToSave[id] = $.couponManager.ruleToSave;
// reset edit mode to off
- couponManager.ruleToUpdateId = false;
+ $.couponManager.ruleToUpdateId = false;
}
// Save
- couponManager.saveRuleAjax();
+ $.couponManager.saveRuleAjax();
};
// Set rule inputs to allow editing
- couponManager.updateRuleSelectAjax = function(id) {
- couponManager.ruleToUpdateId = id;
- couponManager.ruleToSave = couponManager.rulesToSave[id];
+ $.couponManager.updateRuleSelectAjax = function(id) {
+ $.couponManager.ruleToUpdateId = id;
+ $.couponManager.ruleToSave = $.couponManager.rulesToSave[id];
// Set the rule selector
$("#category-rule option").filter(function() {
- return $(this).val() == couponManager.ruleToSave.serviceId;
+ return $(this).val() == $.couponManager.ruleToSave.serviceId;
}).prop('selected', true);
// Force rule input refresh
- couponManager.loadRuleInputs(couponManager.ruleToSave.serviceId, function() {
- couponManager.fillInRuleInputs();
+ $.couponManager.loadRuleInputs($.couponManager.ruleToSave.serviceId, function() {
+ $.couponManager.fillInRuleInputs();
});
};
// Fill in rule inputs
- couponManager.fillInRuleInputs = function() {
+ $.couponManager.fillInRuleInputs = function() {
var operatorId = null;
var valueId = null;
var idName = null;
- var id = couponManager.ruleToUpdateId;
+ var id = $.couponManager.ruleToUpdateId;
if(id) {
- couponManager.ruleToSave = couponManager.rulesToSave[id];
+ $.couponManager.ruleToSave = $.couponManager.rulesToSave[id];
}
- for (idName in couponManager.ruleToSave.operators) {
+ for (idName in $.couponManager.ruleToSave.operators) {
// Setting idName operator select
operatorId = idName + '-operator';
- $('#' + operatorId).val(couponManager.ruleToSave.operators[idName]);
+ $('#' + operatorId).val($.couponManager.ruleToSave.operators[idName]);
// Setting idName value input
valueId = idName + '-value';
- $('#' + valueId).val(couponManager.ruleToSave.values[idName]);
+ $('#' + valueId).val($.couponManager.ruleToSave.values[idName]);
}
};
// Save rules on click
- couponManager.onClickSaveRule = function() {
+ $.couponManager.onClickSaveRule = function() {
$('#constraint-save-btn').on('click', function () {
if($('#category-rule').val() == 'thelia.constraint.rule.available_for_everyone') {
// @todo translate + modal
var r= confirm("Do you really want to set this coupon available to everyone ?");
if (r == true) {
- couponManager.createOrUpdateRuleAjax();
+ $.couponManager.createOrUpdateRuleAjax();
}
}
});
};
- couponManager.onClickSaveRule();
+ $.couponManager.onClickSaveRule();
// Remove rule on click
- couponManager.onClickDeleteRule = function() {
+ $.couponManager.onClickDeleteRule = function() {
$('.constraint-delete-btn').on('click', function (e) {
e.preventDefault();
var $this = $(this);
- couponManager.removeRuleAjax($this.attr('data-int'));
+ $.couponManager.removeRuleAjax($this.attr('data-int'));
});
};
- couponManager.onClickDeleteRule();
+ $.couponManager.onClickDeleteRule();
// Update rule on click
- couponManager.onClickUpdateRule = function() {
+ $.couponManager.onClickUpdateRule = function() {
$('.constraint-update-btn').on('click', function (e) {
e.preventDefault();
var $this = $(this);
- couponManager.updateRuleSelectAjax($this.attr('data-int'));
+ $.couponManager.updateRuleSelectAjax($this.attr('data-int'));
// Hide row being updated
$this.parent().parent().remove();
});
};
- couponManager.onClickUpdateRule();
+ $.couponManager.onClickUpdateRule();
// Reload effect inputs when changing effect
- couponManager.onEffectChange = function() {
+ $.couponManager.onEffectChange = function() {
var optionSelected = $("option:selected", this);
$('#effectToolTip').html(optionSelected.attr("data-description"));
$('#effect').on('change', function () {
@@ -122,22 +134,22 @@ $(function($){
$('#effectToolTip').html(optionSelected.attr("data-description"));
});
};
- couponManager.onEffectChange();
+ $.couponManager.onEffectChange();
// Reload rule inputs when changing effect
- couponManager.onRuleChange = function() {
+ $.couponManager.onRuleChange = function() {
$('#category-rule').on('change', function () {
- couponManager.loadRuleInputs($(this).val(), function() {});
+ $.couponManager.loadRuleInputs($(this).val(), function() {});
});
};
- couponManager.onRuleChange();
+ $.couponManager.onRuleChange();
// Fill in ready to be saved rule array
// var onInputsChange = function()
// In AJAX response
// Set max usage to unlimited or not
- couponManager.onUsageUnlimitedChange = function() {
+ $.couponManager.onUsageUnlimitedChange = function() {
var isUnlimited = $('#is-unlimited');
if ($('#max-usage').val() == -1) {
isUnlimited.prop('checked', true);
@@ -160,20 +172,9 @@ $(function($){
}
});
};
- couponManager.onUsageUnlimitedChange();
+ $.couponManager.onUsageUnlimitedChange();
});
-// Rule to save
-var couponManager = {};
-// Rule to be saved
-couponManager.ruleToSave = {};
-couponManager.ruleToSave.serviceId = false;
-couponManager.ruleToSave.operators = {};
-couponManager.ruleToSave.values = {};
-// Rules payload to save
-couponManager.rulesToSave = [];
-// Rule being updated id
-couponManager.ruleToUpdateId = false;
diff --git a/templates/admin/default/coupon-create.html b/templates/admin/default/coupon-create.html
index f8a0411e1..4b23ca118 100755
--- a/templates/admin/default/coupon-create.html
+++ b/templates/admin/default/coupon-create.html
@@ -8,7 +8,7 @@
diff --git a/templates/admin/default/coupon-list.html b/templates/admin/default/coupon-list.html
index 3abc9268d..07e7420db 100755
--- a/templates/admin/default/coupon-list.html
+++ b/templates/admin/default/coupon-list.html
@@ -8,7 +8,7 @@
@@ -39,13 +39,29 @@
{loop type="coupon" name="list_coupon" is_enabled="1" backend_context="true"}
- | {block name="coupon-code"}{$CODE}{/block} |
+ {block name="coupon-code"}{$CODE}{/block} |
{block name="coupon-title"}{$TITLE}{/block} |
{block name="coupon-expiration-date"}{$EXPIRATION_DATE}{/block} |
- {block name="coupon-usage-left"}{$USAGE_LEFT}{/block} |
+
+ {block name="coupon-usage-left"}
+ {if $USAGE_LEFT == -1}
+
+ {intl l="Unlimited"}
+
+ {elseif $USAGE_LEFT}
+
+ {$USAGE_LEFT}
+
+ {else}
+
+ 0
+
+ {/if}
+ {/block}
+ |
{block name="coupon-action"}
-
+
{intl l='Edit'}
{/block}
@@ -80,7 +96,23 @@
| {block name="coupon-code"}{$CODE}{/block} |
{block name="coupon-title"}{$TITLE}{/block} |
{block name="coupon-expiration-date"}{$EXPIRATION_DATE}{/block} |
- {block name="coupon-usage-left"}{$USAGE_LEFT}{/block} |
+
+ {block name="coupon-usage-left"}
+ {if $USAGE_LEFT == -1}
+
+ {intl l="Unlimited"}
+
+ {elseif $USAGE_LEFT}
+
+ {$USAGE_LEFT}
+
+ {else}
+
+ 0
+
+ {/if}
+ {/block}
+ |
{block name="coupon-action"}
diff --git a/templates/admin/default/coupon-read.html b/templates/admin/default/coupon-read.html
index 8f14dd44f..aa0bfc5a1 100755
--- a/templates/admin/default/coupon-read.html
+++ b/templates/admin/default/coupon-read.html
@@ -8,7 +8,7 @@
@@ -64,7 +64,11 @@
| {intl l='Usage left'} |
- {if $USAGE_LEFT}
+ {if $USAGE_LEFT == -1}
+
+ {intl l="Unlimited"}
+
+ {elseif $USAGE_LEFT}
{$USAGE_LEFT}
diff --git a/templates/admin/default/coupon-update.html b/templates/admin/default/coupon-update.html
index 0902dae4c..8ef58f271 100755
--- a/templates/admin/default/coupon-update.html
+++ b/templates/admin/default/coupon-update.html
@@ -8,7 +8,7 @@
@@ -48,7 +48,7 @@
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
// Init Rules
- couponManager.initRules = function() {
+ $.couponManager.initRules = function() {
var rules = [];
{foreach from=$rulesObject key=k item=rule}
// Init rule
@@ -70,13 +70,13 @@
};
// Save Rules AJAX
- couponManager.saveRuleAjax = function() {
+ $.couponManager.saveRuleAjax = function() {
$('#constraint-add-operators-values').html('');
var $url = '{$urlAjaxUpdateRules}';
$.ajax({
type: "POST",
url: $url,
- data: {literal}{{/literal}rules:JSON.stringify(couponManager.rulesToSave){literal}}{/literal},
+ data: {literal}{{/literal}rules:JSON.stringify($.couponManager.rulesToSave){literal}}{/literal},
statusCode: {
404: function() {
$('#constraint-add-operators-values').html(
@@ -92,13 +92,13 @@
return $(this).val() == 'thelia.constraint.rule.available_for_everyone';
}).prop('selected', true);
- couponManager.onClickUpdateRule();
- couponManager.onClickDeleteRule();
+ $.couponManager.onClickUpdateRule();
+ $.couponManager.onClickDeleteRule();
});
};
// Reload rule inputs
- couponManager.loadRuleInputs = function(ruleId, callBack) {
+ $.couponManager.loadRuleInputs = function(ruleId, callBack) {
$('#constraint-add-operators-values').html('');
var url = "{$urlAjaxGetRuleInput}";
url = url.replace('ruleId', ruleId)
@@ -113,7 +113,7 @@
}
}).done(function(data) {
$('#constraint-add-operators-values').html(data);
- couponManager.ruleToSave.serviceId = ruleId;
+ $.couponManager.ruleToSave.serviceId = ruleId;
if (ruleId == -1) {
// Placeholder can't be saved
$('#constraint-save-btn').hide();
@@ -125,7 +125,7 @@
};
// Rules which will be saved
- couponManager.rulesToSave = couponManager.initRules();
+ $.couponManager.rulesToSave = $.couponManager.initRules();
$('#constraint-save-btn').hide();
diff --git a/templates/admin/default/coupon/form.html b/templates/admin/default/coupon/form.html
index 68c74bee2..299c6598b 100644
--- a/templates/admin/default/coupon/form.html
+++ b/templates/admin/default/coupon/form.html
@@ -11,7 +11,7 @@
{/form_field}
{form_field form=$form field='success_url'}
-
+
{/form_field}
@@ -104,10 +104,10 @@
{form_field form=$form field='type'}
- | |