diff --git a/core/lib/Thelia/Coupon/Type/RemoveXAmount.php b/core/lib/Thelia/Coupon/Type/RemoveXAmount.php index 5ee212b27..c644706a2 100644 --- a/core/lib/Thelia/Coupon/Type/RemoveXAmount.php +++ b/core/lib/Thelia/Coupon/Type/RemoveXAmount.php @@ -65,4 +65,13 @@ class RemoveXAmount extends CouponAbstract return $toolTip; } + + public function drawBackOfficeInputs() + { + return $this->facade->getParser()->render('coupon/type-fragments/remove-x-amount.html', [ + 'label' => $this->getInputName(), + 'fieldName' => self::INPUT_AMOUNT_NAME, + 'value' => $this->amount + ]); + } } diff --git a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php index db0a011ea..83c625d9c 100644 --- a/core/lib/Thelia/Coupon/Type/RemoveXPercent.php +++ b/core/lib/Thelia/Coupon/Type/RemoveXPercent.php @@ -145,17 +145,12 @@ class RemoveXPercent extends CouponAbstract */ public function drawBackOfficeInputs() { - $labelPercentage = $this->getInputName(); - - $html = ' - -
- - -
- '; - - return $html; + return $this->facade->getParser()->render('coupon/type-fragments/remove-x-percent.html', [ + 'label' => $this->getInputName(), + 'typeKey' => self::INPUT_AMOUNT_NAME, + 'fieldId' => self::INPUT_PERCENTAGE_NAME, + 'fieldName' => self::INPUT_EXTENDED__NAME, + 'value' => $this->percentage + ]); } - } diff --git a/templates/backOffice/default/coupon/type-fragments/remove-x-amount.html b/templates/backOffice/default/coupon/type-fragments/remove-x-amount.html new file mode 100644 index 000000000..6159af73f --- /dev/null +++ b/templates/backOffice/default/coupon/type-fragments/remove-x-amount.html @@ -0,0 +1,9 @@ +
+ +
+ + {loop type="currency" name="get-symbol" default_only="true"} +
{$SYMBOL}
+ {/loop} +
+
diff --git a/templates/backOffice/default/coupon/type-fragments/remove-x-percent.html b/templates/backOffice/default/coupon/type-fragments/remove-x-percent.html new file mode 100644 index 000000000..7cd461a48 --- /dev/null +++ b/templates/backOffice/default/coupon/type-fragments/remove-x-percent.html @@ -0,0 +1,8 @@ + +
+ +
+ +
%
+
+