@osovitny/anatoly 3.19.25 → 3.19.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4344,6 +4344,9 @@ class PaymentsService {
4344
4344
  }
4345
4345
  resetState() {
4346
4346
  this.subtotal = 0;
4347
+ this.discountCode = null;
4348
+ this.discountPercentage = null;
4349
+ this.discountAmount = null;
4347
4350
  this.total = 0;
4348
4351
  }
4349
4352
  getTotal() {
@@ -4358,11 +4361,11 @@ class PaymentsService {
4358
4361
  return subtotal > 0 ? subtotal : 0;
4359
4362
  }
4360
4363
  //DiscountCode
4361
- applyDiscountCode(discountCode, data) {
4364
+ applyDiscountCode(data) {
4362
4365
  if (!data) {
4363
4366
  return;
4364
4367
  }
4365
- this.discountCode = discountCode;
4368
+ this.discountCode = data.code;
4366
4369
  if (data.amount) {
4367
4370
  this.discountPercentage = 0;
4368
4371
  this.discountAmount = parseInt(data.amount);
@@ -4544,7 +4547,7 @@ class OrderSummaryComponent extends ComponentBase {
4544
4547
  }
4545
4548
  switch (data.status) {
4546
4549
  case DiscountCodeStatus.Exist:
4547
- this.ps.applyDiscountCode(this.promoCode, data.code);
4550
+ this.ps.applyDiscountCode(data);
4548
4551
  this.discount = this.ps.getDiscountCodeAsString();
4549
4552
  this.ns.success("Discount applied successfully");
4550
4553
  break;