tabexseriescomponents 0.2.1343 → 0.2.1344

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
@@ -11128,15 +11128,27 @@ var Productinfo = function Productinfo(props) {
11128
11128
  }
11129
11129
  }));
11130
11130
  var getprice_discountpriceprops_for_extras = function getprice_discountpriceprops_for_extras(productobj, quantity) {
11131
+ var variantid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
11131
11132
  var price = 0;
11132
- price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
11133
- // if (type == 'defaultprice') {
11134
- // price = productobj?.defaultprice;
11135
-
11136
- // } else if (type == 'defaultsaleprice') {
11137
- // price = productobj?.defaultsaleprice;
11138
-
11139
- // }
11133
+ console.log(variantid);
11134
+ console.log(productobj);
11135
+ if (productobj.hasvariants == 1) {
11136
+ if (variantid != null) {
11137
+ var _productobj$variants;
11138
+ if ((productobj === null || productobj === void 0 ? void 0 : productobj.variants) != undefined && (productobj === null || productobj === void 0 ? void 0 : productobj.variants) != null && Array.isArray(productobj === null || productobj === void 0 ? void 0 : productobj.variants) && (productobj === null || productobj === void 0 || (_productobj$variants = productobj.variants) === null || _productobj$variants === void 0 ? void 0 : _productobj$variants.length) != 0) {
11139
+ var _productobj$variants2;
11140
+ productobj === null || productobj === void 0 || (_productobj$variants2 = productobj.variants) === null || _productobj$variants2 === void 0 || _productobj$variants2.forEach(function (item, index) {
11141
+ if (item.variantid == variantid) {
11142
+ price = item.variantprice;
11143
+ }
11144
+ });
11145
+ }
11146
+ } else {
11147
+ price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
11148
+ }
11149
+ } else {
11150
+ price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
11151
+ }
11140
11152
  {
11141
11153
  if (price != undefined) {
11142
11154
  price = price * quantity;
@@ -11154,6 +11166,36 @@ var Productinfo = function Productinfo(props) {
11154
11166
  return 0;
11155
11167
  }
11156
11168
  };
11169
+
11170
+ // const getprice_discountpriceprops_for_extras = (productobj, quantity) => {
11171
+ // var price = 0;
11172
+
11173
+ // var withtotal = true;
11174
+ // price = productobj?.defaultprice;
11175
+ // // if (type == 'defaultprice') {
11176
+ // // price = productobj?.defaultprice;
11177
+
11178
+ // // } else if (type == 'defaultsaleprice') {
11179
+ // // price = productobj?.defaultsaleprice;
11180
+
11181
+ // // }
11182
+ // if (withtotal == true) {
11183
+ // if (price != undefined) {
11184
+ // price = price * quantity;
11185
+ // }
11186
+ // }
11187
+ // if (price != undefined) {
11188
+ // if (sectionproperties.removedecimals == 'Without Decimals') {
11189
+ // return parseFloat(Number(price).toFixed(2));
11190
+ // } else if (sectionproperties.removedecimals == 'Without Decimals and Separated With Comma') {
11191
+ // return Math.floor(price).toLocaleString();
11192
+ // } else {
11193
+ // return parseFloat(price);
11194
+ // }
11195
+ // } else {
11196
+ // return 0;
11197
+ // }
11198
+ // };
11157
11199
  var get_product_extras_price = function get_product_extras_price() {
11158
11200
  var _fetchProductInfoQuer63, _fetchProductInfoQuer64, _fetchcustomercartQue, _fetchcustomercartQue2, _fetchcustomercartQue3;
11159
11201
  var totalprice_extras_price = 0;
@@ -11170,7 +11212,7 @@ var Productinfo = function Productinfo(props) {
11170
11212
  }
11171
11213
  });
11172
11214
  extras_for_product === null || extras_for_product === void 0 || extras_for_product.forEach(function (cartitem_in, cartindex_in) {
11173
- var singleextraprice = getprice_discountpriceprops_for_extras(cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.productinfo, cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.quantity) * addtocardpayloadobj.quantity;
11215
+ var singleextraprice = getprice_discountpriceprops_for_extras(cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.productinfo, cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.quantity, cartitem_in.variantid) * addtocardpayloadobj.quantity;
11174
11216
  totalprice_extras_price = totalprice_extras_price + singleextraprice;
11175
11217
  });
11176
11218
  }
package/dist/index.esm.js CHANGED
@@ -11077,15 +11077,27 @@ var Productinfo = function Productinfo(props) {
11077
11077
  }
11078
11078
  }));
11079
11079
  var getprice_discountpriceprops_for_extras = function getprice_discountpriceprops_for_extras(productobj, quantity) {
11080
+ var variantid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
11080
11081
  var price = 0;
11081
- price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
11082
- // if (type == 'defaultprice') {
11083
- // price = productobj?.defaultprice;
11084
-
11085
- // } else if (type == 'defaultsaleprice') {
11086
- // price = productobj?.defaultsaleprice;
11087
-
11088
- // }
11082
+ console.log(variantid);
11083
+ console.log(productobj);
11084
+ if (productobj.hasvariants == 1) {
11085
+ if (variantid != null) {
11086
+ var _productobj$variants;
11087
+ if ((productobj === null || productobj === void 0 ? void 0 : productobj.variants) != undefined && (productobj === null || productobj === void 0 ? void 0 : productobj.variants) != null && Array.isArray(productobj === null || productobj === void 0 ? void 0 : productobj.variants) && (productobj === null || productobj === void 0 || (_productobj$variants = productobj.variants) === null || _productobj$variants === void 0 ? void 0 : _productobj$variants.length) != 0) {
11088
+ var _productobj$variants2;
11089
+ productobj === null || productobj === void 0 || (_productobj$variants2 = productobj.variants) === null || _productobj$variants2 === void 0 || _productobj$variants2.forEach(function (item, index) {
11090
+ if (item.variantid == variantid) {
11091
+ price = item.variantprice;
11092
+ }
11093
+ });
11094
+ }
11095
+ } else {
11096
+ price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
11097
+ }
11098
+ } else {
11099
+ price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
11100
+ }
11089
11101
  {
11090
11102
  if (price != undefined) {
11091
11103
  price = price * quantity;
@@ -11103,6 +11115,36 @@ var Productinfo = function Productinfo(props) {
11103
11115
  return 0;
11104
11116
  }
11105
11117
  };
11118
+
11119
+ // const getprice_discountpriceprops_for_extras = (productobj, quantity) => {
11120
+ // var price = 0;
11121
+
11122
+ // var withtotal = true;
11123
+ // price = productobj?.defaultprice;
11124
+ // // if (type == 'defaultprice') {
11125
+ // // price = productobj?.defaultprice;
11126
+
11127
+ // // } else if (type == 'defaultsaleprice') {
11128
+ // // price = productobj?.defaultsaleprice;
11129
+
11130
+ // // }
11131
+ // if (withtotal == true) {
11132
+ // if (price != undefined) {
11133
+ // price = price * quantity;
11134
+ // }
11135
+ // }
11136
+ // if (price != undefined) {
11137
+ // if (sectionproperties.removedecimals == 'Without Decimals') {
11138
+ // return parseFloat(Number(price).toFixed(2));
11139
+ // } else if (sectionproperties.removedecimals == 'Without Decimals and Separated With Comma') {
11140
+ // return Math.floor(price).toLocaleString();
11141
+ // } else {
11142
+ // return parseFloat(price);
11143
+ // }
11144
+ // } else {
11145
+ // return 0;
11146
+ // }
11147
+ // };
11106
11148
  var get_product_extras_price = function get_product_extras_price() {
11107
11149
  var _fetchProductInfoQuer63, _fetchProductInfoQuer64, _fetchcustomercartQue, _fetchcustomercartQue2, _fetchcustomercartQue3;
11108
11150
  var totalprice_extras_price = 0;
@@ -11119,7 +11161,7 @@ var Productinfo = function Productinfo(props) {
11119
11161
  }
11120
11162
  });
11121
11163
  extras_for_product === null || extras_for_product === void 0 || extras_for_product.forEach(function (cartitem_in, cartindex_in) {
11122
- var singleextraprice = getprice_discountpriceprops_for_extras(cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.productinfo, cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.quantity) * addtocardpayloadobj.quantity;
11164
+ var singleextraprice = getprice_discountpriceprops_for_extras(cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.productinfo, cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.quantity, cartitem_in.variantid) * addtocardpayloadobj.quantity;
11123
11165
  totalprice_extras_price = totalprice_extras_price + singleextraprice;
11124
11166
  });
11125
11167
  }
package/dist/index.umd.js CHANGED
@@ -10934,15 +10934,27 @@
10934
10934
  }
10935
10935
  }));
10936
10936
  var getprice_discountpriceprops_for_extras = function getprice_discountpriceprops_for_extras(productobj, quantity) {
10937
+ var variantid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
10937
10938
  var price = 0;
10938
- price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
10939
- // if (type == 'defaultprice') {
10940
- // price = productobj?.defaultprice;
10941
-
10942
- // } else if (type == 'defaultsaleprice') {
10943
- // price = productobj?.defaultsaleprice;
10944
-
10945
- // }
10939
+ console.log(variantid);
10940
+ console.log(productobj);
10941
+ if (productobj.hasvariants == 1) {
10942
+ if (variantid != null) {
10943
+ var _productobj$variants;
10944
+ if ((productobj === null || productobj === void 0 ? void 0 : productobj.variants) != undefined && (productobj === null || productobj === void 0 ? void 0 : productobj.variants) != null && Array.isArray(productobj === null || productobj === void 0 ? void 0 : productobj.variants) && (productobj === null || productobj === void 0 || (_productobj$variants = productobj.variants) === null || _productobj$variants === void 0 ? void 0 : _productobj$variants.length) != 0) {
10945
+ var _productobj$variants2;
10946
+ productobj === null || productobj === void 0 || (_productobj$variants2 = productobj.variants) === null || _productobj$variants2 === void 0 || _productobj$variants2.forEach(function (item, index) {
10947
+ if (item.variantid == variantid) {
10948
+ price = item.variantprice;
10949
+ }
10950
+ });
10951
+ }
10952
+ } else {
10953
+ price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
10954
+ }
10955
+ } else {
10956
+ price = productobj === null || productobj === void 0 ? void 0 : productobj.defaultprice;
10957
+ }
10946
10958
  {
10947
10959
  if (price != undefined) {
10948
10960
  price = price * quantity;
@@ -10960,6 +10972,36 @@
10960
10972
  return 0;
10961
10973
  }
10962
10974
  };
10975
+
10976
+ // const getprice_discountpriceprops_for_extras = (productobj, quantity) => {
10977
+ // var price = 0;
10978
+
10979
+ // var withtotal = true;
10980
+ // price = productobj?.defaultprice;
10981
+ // // if (type == 'defaultprice') {
10982
+ // // price = productobj?.defaultprice;
10983
+
10984
+ // // } else if (type == 'defaultsaleprice') {
10985
+ // // price = productobj?.defaultsaleprice;
10986
+
10987
+ // // }
10988
+ // if (withtotal == true) {
10989
+ // if (price != undefined) {
10990
+ // price = price * quantity;
10991
+ // }
10992
+ // }
10993
+ // if (price != undefined) {
10994
+ // if (sectionproperties.removedecimals == 'Without Decimals') {
10995
+ // return parseFloat(Number(price).toFixed(2));
10996
+ // } else if (sectionproperties.removedecimals == 'Without Decimals and Separated With Comma') {
10997
+ // return Math.floor(price).toLocaleString();
10998
+ // } else {
10999
+ // return parseFloat(price);
11000
+ // }
11001
+ // } else {
11002
+ // return 0;
11003
+ // }
11004
+ // };
10963
11005
  var get_product_extras_price = function get_product_extras_price() {
10964
11006
  var _fetchProductInfoQuer63, _fetchProductInfoQuer64, _fetchcustomercartQue, _fetchcustomercartQue2, _fetchcustomercartQue3;
10965
11007
  var totalprice_extras_price = 0;
@@ -10976,7 +11018,7 @@
10976
11018
  }
10977
11019
  });
10978
11020
  extras_for_product === null || extras_for_product === void 0 || extras_for_product.forEach(function (cartitem_in, cartindex_in) {
10979
- var singleextraprice = getprice_discountpriceprops_for_extras(cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.productinfo, cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.quantity) * addtocardpayloadobj.quantity;
11021
+ var singleextraprice = getprice_discountpriceprops_for_extras(cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.productinfo, cartitem_in === null || cartitem_in === void 0 ? void 0 : cartitem_in.quantity, cartitem_in.variantid) * addtocardpayloadobj.quantity;
10980
11022
  totalprice_extras_price = totalprice_extras_price + singleextraprice;
10981
11023
  });
10982
11024
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabexseriescomponents",
3
- "version": "0.2.1343",
3
+ "version": "0.2.1344",
4
4
  "type": "module",
5
5
  "description": "your description",
6
6
  "main": "dist/index.cjs.js",