@ikas/storefront 0.0.23 → 0.0.24

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.
package/build/index.es.js CHANGED
@@ -13006,6 +13006,24 @@ var IkasProductPrice = /** @class */ (function () {
13006
13006
  enumerable: false,
13007
13007
  configurable: true
13008
13008
  });
13009
+ Object.defineProperty(IkasProductPrice.prototype, "discountAmount", {
13010
+ get: function () {
13011
+ if (this.hasDiscount)
13012
+ return this.sellPrice - this.discountPrice;
13013
+ return 0;
13014
+ },
13015
+ enumerable: false,
13016
+ configurable: true
13017
+ });
13018
+ Object.defineProperty(IkasProductPrice.prototype, "discountPercentage", {
13019
+ get: function () {
13020
+ if (this.hasDiscount)
13021
+ return (100 - (this.finalPrice * 100) / this.sellPrice).toFixed(0);
13022
+ return 0;
13023
+ },
13024
+ enumerable: false,
13025
+ configurable: true
13026
+ });
13009
13027
  return IkasProductPrice;
13010
13028
  }());
13011
13029
 
package/build/index.js CHANGED
@@ -13003,6 +13003,24 @@ var IkasProductPrice = /** @class */ (function () {
13003
13003
  enumerable: false,
13004
13004
  configurable: true
13005
13005
  });
13006
+ Object.defineProperty(IkasProductPrice.prototype, "discountAmount", {
13007
+ get: function () {
13008
+ if (this.hasDiscount)
13009
+ return this.sellPrice - this.discountPrice;
13010
+ return 0;
13011
+ },
13012
+ enumerable: false,
13013
+ configurable: true
13014
+ });
13015
+ Object.defineProperty(IkasProductPrice.prototype, "discountPercentage", {
13016
+ get: function () {
13017
+ if (this.hasDiscount)
13018
+ return (100 - (this.finalPrice * 100) / this.sellPrice).toFixed(0);
13019
+ return 0;
13020
+ },
13021
+ enumerable: false,
13022
+ configurable: true
13023
+ });
13006
13024
  return IkasProductPrice;
13007
13025
  }());
13008
13026
 
@@ -5,4 +5,6 @@ export declare class IkasProductPrice {
5
5
  constructor(data?: Partial<IkasProductPrice>);
6
6
  get finalPrice(): number;
7
7
  get hasDiscount(): boolean;
8
+ get discountAmount(): number;
9
+ get discountPercentage(): string | 0;
8
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/storefront",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "main": "./build/index.js",
5
5
  "module": "./build/index.es.js",
6
6
  "author": "Umut Ozan Yıldırım",