From 99e89e42497845cc684ef60599a7e77581348e23 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 10 Feb 2014 13:03:07 +0100 Subject: [PATCH] allow intl in coupon edition --- .../Thelia/Controller/Admin/CouponController.php | 5 ++++- templates/backOffice/default/coupon/form.html | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/CouponController.php b/core/lib/Thelia/Controller/Admin/CouponController.php index b5f303ff6..b0fa48569 100644 --- a/core/lib/Thelia/Controller/Admin/CouponController.php +++ b/core/lib/Thelia/Controller/Admin/CouponController.php @@ -187,6 +187,9 @@ class CouponController extends BaseAdminController return $this->pageNotFound(); } + + $coupon->setLocale($this->getCurrentEditionLocale()); + /** @var CouponFactory $couponFactory */ $couponFactory = $this->container->get('thelia.coupon.factory'); $couponManager = $couponFactory->buildCouponFromModel($coupon); @@ -232,7 +235,7 @@ class CouponController extends BaseAdminController 'isRemovingPostage' => $coupon->getIsRemovingPostage(), 'maxUsage' => $coupon->getMaxUsage(), 'conditions' => $conditions, - 'locale' => $coupon->getLocale(), + 'locale' => $this->getCurrentEditionLocale(), ); $args['conditions'] = $this->cleanConditionForTemplate($conditions); diff --git a/templates/backOffice/default/coupon/form.html b/templates/backOffice/default/coupon/form.html index be00100b1..2deadde4a 100644 --- a/templates/backOffice/default/coupon/form.html +++ b/templates/backOffice/default/coupon/form.html @@ -3,6 +3,7 @@
+
{form_hidden_fields form=$form} @@ -17,6 +18,14 @@
+ {if !$noConditions} + {include + file = "includes/inner-form-toolbar.html" + hide_submit_buttons = false + + page_url = "{url path="{$formAction}"}" + } + {/if}
{form_field form=$form field='code'}
@@ -146,7 +155,9 @@
{/form_field} - + {if $noConditions} + + {/if}