Smile-SA / magento2-module-multi-coupon

Multi Coupon module for Magento2
Open Software License 3.0
8 stars 6 forks source link

Sales rule applied several times #1

Open PierreLeMaguer opened 5 years ago

PierreLeMaguer commented 5 years ago

Hi,

The issue is reproduced on Magento CE 2.3.1. To reproduce, we need two rules with coupon applied and another without coupon. because of the Smile\MultiCoupon\Model\Quote\Discount, the rule without coupon is applied twice. Two solutions I see : Either we change the way to apply several coupons. Or we check when applying a rule that the rule is not already applied. I coded the second solution because faster, but not sure that it is the best solution. `<?php namespace Smile\MultiCoupon\Plugin\Model;

use Magento\Quote\Model\Quote\Address; use Magento\SalesRule\Model\Rule; use Magento\SalesRule\Model\Utility as Subject;

class Utility { /**

KhaledBinAmir commented 3 years ago

Hi @romainruaud , Any update on this?