@pelcro/react-pelcro-js 3.9.0 → 3.9.1-beta.1

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/dist/index.cjs.js CHANGED
@@ -17193,7 +17193,7 @@ const CheckoutForm = () => {
17193
17193
  };
17194
17194
 
17195
17195
  const DiscountedPrice = props => {
17196
- var _order$currency, _order$, _plan$quantity;
17196
+ var _window$Pelcro$site, _window$Pelcro$site$r, _order$currency, _order$, _plan$quantity;
17197
17197
 
17198
17198
  const {
17199
17199
  t
@@ -17210,9 +17210,10 @@ const DiscountedPrice = props => {
17210
17210
  order,
17211
17211
  plan
17212
17212
  } = usePelcro();
17213
+ const isTaxInclusive = (_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tax_inclusive;
17213
17214
  const ecommOrderCurrency = (_order$currency = order === null || order === void 0 ? void 0 : order.currency) !== null && _order$currency !== void 0 ? _order$currency : order === null || order === void 0 ? void 0 : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
17214
17215
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
17215
- const discountedPriceWithoutTax = updatedPrice - taxAmount;
17216
+ const discountedPriceWithoutTax = isTaxInclusive ? updatedPrice : updatedPrice - taxAmount;
17216
17217
  const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
17217
17218
 
17218
17219
  const onCouponRemove = () => {
package/dist/index.esm.js CHANGED
@@ -17163,7 +17163,7 @@ const CheckoutForm = () => {
17163
17163
  };
17164
17164
 
17165
17165
  const DiscountedPrice = props => {
17166
- var _order$currency, _order$, _plan$quantity;
17166
+ var _window$Pelcro$site, _window$Pelcro$site$r, _order$currency, _order$, _plan$quantity;
17167
17167
 
17168
17168
  const {
17169
17169
  t
@@ -17180,9 +17180,10 @@ const DiscountedPrice = props => {
17180
17180
  order,
17181
17181
  plan
17182
17182
  } = usePelcro();
17183
+ const isTaxInclusive = (_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tax_inclusive;
17183
17184
  const ecommOrderCurrency = (_order$currency = order === null || order === void 0 ? void 0 : order.currency) !== null && _order$currency !== void 0 ? _order$currency : order === null || order === void 0 ? void 0 : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
17184
17185
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
17185
- const discountedPriceWithoutTax = updatedPrice - taxAmount;
17186
+ const discountedPriceWithoutTax = isTaxInclusive ? updatedPrice : updatedPrice - taxAmount;
17186
17187
  const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
17187
17188
 
17188
17189
  const onCouponRemove = () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.9.0",
4
+ "version": "3.9.1-beta.1",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",