@gem-sdk/core 1.47.0-staging.0 → 1.47.0-staging.2
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.
|
@@ -9,6 +9,7 @@ var PageContext = require('../contexts/PageContext.js');
|
|
|
9
9
|
require('@gem-sdk/adapter-shopify');
|
|
10
10
|
require('swr/mutation');
|
|
11
11
|
require('swr/infinite');
|
|
12
|
+
var useFormatMoney = require('./useFormatMoney.js');
|
|
12
13
|
require('vanilla-lazyload');
|
|
13
14
|
require('./useCartUI.js');
|
|
14
15
|
var variant = require('../helpers/variant.js');
|
|
@@ -205,7 +206,7 @@ const useProductOfferDiscount = ()=>{
|
|
|
205
206
|
const price = currentVariant?.price || 0;
|
|
206
207
|
currentDiscount = currentDiscount * price / 100;
|
|
207
208
|
}
|
|
208
|
-
return currentDiscount
|
|
209
|
+
return currentDiscount ? parseFloat(useFormatMoney.shopifyPriceRounding(currentDiscount, 2)) : 0;
|
|
209
210
|
};
|
|
210
211
|
|
|
211
212
|
exports.useCheckAvailableVariantInStock = useCheckAvailableVariantInStock;
|
|
@@ -7,6 +7,7 @@ import { usePageStore } from '../contexts/PageContext.js';
|
|
|
7
7
|
import '@gem-sdk/adapter-shopify';
|
|
8
8
|
import 'swr/mutation';
|
|
9
9
|
import 'swr/infinite';
|
|
10
|
+
import { shopifyPriceRounding } from './useFormatMoney.js';
|
|
10
11
|
import 'vanilla-lazyload';
|
|
11
12
|
import './useCartUI.js';
|
|
12
13
|
import { checkInStock } from '../helpers/variant.js';
|
|
@@ -203,7 +204,7 @@ const useProductOfferDiscount = ()=>{
|
|
|
203
204
|
const price = currentVariant?.price || 0;
|
|
204
205
|
currentDiscount = currentDiscount * price / 100;
|
|
205
206
|
}
|
|
206
|
-
return currentDiscount
|
|
207
|
+
return currentDiscount ? parseFloat(shopifyPriceRounding(currentDiscount, 2)) : 0;
|
|
207
208
|
};
|
|
208
209
|
|
|
209
210
|
export { useCheckAvailableVariantInStock, useCurrentVariant, useCurrentVariantInStock, useFeaturedImageGlobal, useIsSyncProduct, useProduct, useProductOfferDiscount, useProductProperties, useQuantity, useSelectedOption, useUniqProductID, useVariant, useVariantOutStock, useVariants };
|