tabexseriescomponents 0.2.992 → 0.2.993

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
@@ -91773,11 +91773,23 @@ var Simpleproductcard = function Simpleproductcard(props) {
91773
91773
  _useState0 = _slicedToArray__default["default"](_useState9, 2),
91774
91774
  Variant_Color_ImageObj = _useState0[0],
91775
91775
  setVariant_Color_ImageObj = _useState0[1];
91776
- var authdetailsContext = props.actions.authdetailsContext;
91777
- var _useState1 = React.useState(false),
91776
+ var _useState1 = React.useState(0),
91778
91777
  _useState10 = _slicedToArray__default["default"](_useState1, 2),
91779
- showquantity = _useState10[0],
91780
- setshowquantity = _useState10[1];
91778
+ price = _useState10[0],
91779
+ setprice = _useState10[1];
91780
+ var _useState11 = React.useState(0),
91781
+ _useState12 = _slicedToArray__default["default"](_useState11, 2),
91782
+ sale_price = _useState12[0],
91783
+ setsale_price = _useState12[1];
91784
+ var _useState13 = React.useState(0),
91785
+ _useState14 = _slicedToArray__default["default"](_useState13, 2),
91786
+ has_sale = _useState14[0],
91787
+ sethas_sale = _useState14[1];
91788
+ var authdetailsContext = props.actions.authdetailsContext;
91789
+ var _useState15 = React.useState(false),
91790
+ _useState16 = _slicedToArray__default["default"](_useState15, 2),
91791
+ showquantity = _useState16[0],
91792
+ setshowquantity = _useState16[1];
91781
91793
  var plainString = function plainString(html) {
91782
91794
  var divContainer = document.createElement('div');
91783
91795
  divContainer.innerHTML = html;
@@ -91795,8 +91807,13 @@ var Simpleproductcard = function Simpleproductcard(props) {
91795
91807
  setsectionproperties(_objectSpread$6({}, secpropobj));
91796
91808
  }, [StatePagePropertiesContext]);
91797
91809
  React.useEffect(function () {
91810
+ var _props$cardinfoitempr, _props$cardinfoitempr2, _props$cardinfoitempr3;
91798
91811
  setitem(props.cardinfoitemprops);
91812
+ setprice(props === null || props === void 0 || (_props$cardinfoitempr = props.cardinfoitemprops) === null || _props$cardinfoitempr === void 0 ? void 0 : _props$cardinfoitempr.defaultprice);
91813
+ setsale_price(props === null || props === void 0 || (_props$cardinfoitempr2 = props.cardinfoitemprops) === null || _props$cardinfoitempr2 === void 0 ? void 0 : _props$cardinfoitempr2.defaultsaleprice);
91814
+ sethas_sale(props === null || props === void 0 || (_props$cardinfoitempr3 = props.cardinfoitemprops) === null || _props$cardinfoitempr3 === void 0 ? void 0 : _props$cardinfoitempr3.hassale);
91799
91815
  }, [props.cardinfoitemprops]);
91816
+
91800
91817
  // useEffect(() => {
91801
91818
  // if (item.quantity == 0) {
91802
91819
  // setshowquantity(false);
@@ -92062,32 +92079,32 @@ var Simpleproductcard = function Simpleproductcard(props) {
92062
92079
  }
92063
92080
  })
92064
92081
  };
92065
- var _useState11 = React.useState(''),
92066
- _useState12 = _slicedToArray__default["default"](_useState11, 2),
92067
- secondimage = _useState12[0],
92068
- setsecondimage = _useState12[1];
92082
+ var _useState17 = React.useState(''),
92083
+ _useState18 = _slicedToArray__default["default"](_useState17, 2),
92084
+ secondimage = _useState18[0],
92085
+ setsecondimage = _useState18[1];
92069
92086
  React.useEffect(function () {
92070
- var _props$cardinfoitempr;
92087
+ var _props$cardinfoitempr4;
92071
92088
  setitem(props.cardinfoitemprops);
92072
- if ((props === null || props === void 0 || (_props$cardinfoitempr = props.cardinfoitemprops) === null || _props$cardinfoitempr === void 0 || (_props$cardinfoitempr = _props$cardinfoitempr.productimages) === null || _props$cardinfoitempr === void 0 ? void 0 : _props$cardinfoitempr.length) == 1) {
92073
- var _props$cardinfoitempr2;
92074
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr2 = props.cardinfoitemprops) === null || _props$cardinfoitempr2 === void 0 ? void 0 : _props$cardinfoitempr2.image);
92089
+ if ((props === null || props === void 0 || (_props$cardinfoitempr4 = props.cardinfoitemprops) === null || _props$cardinfoitempr4 === void 0 || (_props$cardinfoitempr4 = _props$cardinfoitempr4.productimages) === null || _props$cardinfoitempr4 === void 0 ? void 0 : _props$cardinfoitempr4.length) == 1) {
92090
+ var _props$cardinfoitempr5;
92091
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr5 = props.cardinfoitemprops) === null || _props$cardinfoitempr5 === void 0 ? void 0 : _props$cardinfoitempr5.image);
92075
92092
  } else {
92076
- var _props$cardinfoitempr3, _props$cardinfoitempr4;
92077
- if ((props === null || props === void 0 ? void 0 : props.cardinfoitemprops) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr3 = props.cardinfoitemprops) === null || _props$cardinfoitempr3 === void 0 ? void 0 : _props$cardinfoitempr3.productimages) != undefined && Array.isArray(props === null || props === void 0 || (_props$cardinfoitempr4 = props.cardinfoitemprops) === null || _props$cardinfoitempr4 === void 0 ? void 0 : _props$cardinfoitempr4.productimages)) {
92078
- var _props$cardinfoitempr5, _props$cardinfoitempr6, _props$cardinfoitempr7;
92079
- if ((props === null || props === void 0 || (_props$cardinfoitempr5 = props.cardinfoitemprops) === null || _props$cardinfoitempr5 === void 0 ? void 0 : _props$cardinfoitempr5.productimages[0]) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr6 = props.cardinfoitemprops) === null || _props$cardinfoitempr6 === void 0 || (_props$cardinfoitempr6 = _props$cardinfoitempr6.productimages[0]) === null || _props$cardinfoitempr6 === void 0 ? void 0 : _props$cardinfoitempr6.path) == (props === null || props === void 0 || (_props$cardinfoitempr7 = props.cardinfoitemprops) === null || _props$cardinfoitempr7 === void 0 ? void 0 : _props$cardinfoitempr7.image)) {
92080
- var _props$cardinfoitempr8;
92081
- if ((props === null || props === void 0 || (_props$cardinfoitempr8 = props.cardinfoitemprops) === null || _props$cardinfoitempr8 === void 0 || (_props$cardinfoitempr8 = _props$cardinfoitempr8.productimages[1]) === null || _props$cardinfoitempr8 === void 0 ? void 0 : _props$cardinfoitempr8.length) != 0) {
92082
- var _props$cardinfoitempr9;
92083
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr9 = props.cardinfoitemprops) === null || _props$cardinfoitempr9 === void 0 || (_props$cardinfoitempr9 = _props$cardinfoitempr9.productimages[1]) === null || _props$cardinfoitempr9 === void 0 ? void 0 : _props$cardinfoitempr9.path);
92093
+ var _props$cardinfoitempr6, _props$cardinfoitempr7;
92094
+ if ((props === null || props === void 0 ? void 0 : props.cardinfoitemprops) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr6 = props.cardinfoitemprops) === null || _props$cardinfoitempr6 === void 0 ? void 0 : _props$cardinfoitempr6.productimages) != undefined && Array.isArray(props === null || props === void 0 || (_props$cardinfoitempr7 = props.cardinfoitemprops) === null || _props$cardinfoitempr7 === void 0 ? void 0 : _props$cardinfoitempr7.productimages)) {
92095
+ var _props$cardinfoitempr8, _props$cardinfoitempr9, _props$cardinfoitempr0;
92096
+ if ((props === null || props === void 0 || (_props$cardinfoitempr8 = props.cardinfoitemprops) === null || _props$cardinfoitempr8 === void 0 ? void 0 : _props$cardinfoitempr8.productimages[0]) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr9 = props.cardinfoitemprops) === null || _props$cardinfoitempr9 === void 0 || (_props$cardinfoitempr9 = _props$cardinfoitempr9.productimages[0]) === null || _props$cardinfoitempr9 === void 0 ? void 0 : _props$cardinfoitempr9.path) == (props === null || props === void 0 || (_props$cardinfoitempr0 = props.cardinfoitemprops) === null || _props$cardinfoitempr0 === void 0 ? void 0 : _props$cardinfoitempr0.image)) {
92097
+ var _props$cardinfoitempr1;
92098
+ if ((props === null || props === void 0 || (_props$cardinfoitempr1 = props.cardinfoitemprops) === null || _props$cardinfoitempr1 === void 0 || (_props$cardinfoitempr1 = _props$cardinfoitempr1.productimages[1]) === null || _props$cardinfoitempr1 === void 0 ? void 0 : _props$cardinfoitempr1.length) != 0) {
92099
+ var _props$cardinfoitempr10;
92100
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr10 = props.cardinfoitemprops) === null || _props$cardinfoitempr10 === void 0 || (_props$cardinfoitempr10 = _props$cardinfoitempr10.productimages[1]) === null || _props$cardinfoitempr10 === void 0 ? void 0 : _props$cardinfoitempr10.path);
92084
92101
  } else {
92085
- var _props$cardinfoitempr0;
92086
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr0 = props.cardinfoitemprops) === null || _props$cardinfoitempr0 === void 0 ? void 0 : _props$cardinfoitempr0.image);
92102
+ var _props$cardinfoitempr11;
92103
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr11 = props.cardinfoitemprops) === null || _props$cardinfoitempr11 === void 0 ? void 0 : _props$cardinfoitempr11.image);
92087
92104
  }
92088
92105
  } else {
92089
- var _props$cardinfoitempr1;
92090
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr1 = props.cardinfoitemprops) === null || _props$cardinfoitempr1 === void 0 || (_props$cardinfoitempr1 = _props$cardinfoitempr1.productimages[0]) === null || _props$cardinfoitempr1 === void 0 ? void 0 : _props$cardinfoitempr1.path);
92106
+ var _props$cardinfoitempr12;
92107
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr12 = props.cardinfoitemprops) === null || _props$cardinfoitempr12 === void 0 || (_props$cardinfoitempr12 = _props$cardinfoitempr12.productimages[0]) === null || _props$cardinfoitempr12 === void 0 ? void 0 : _props$cardinfoitempr12.path);
92091
92108
  }
92092
92109
  }
92093
92110
  }
@@ -92273,10 +92290,10 @@ var Simpleproductcard = function Simpleproductcard(props) {
92273
92290
  }
92274
92291
  }));
92275
92292
  };
92276
- var _useState13 = React.useState(0),
92277
- _useState14 = _slicedToArray__default["default"](_useState13, 2),
92278
- clickCount = _useState14[0],
92279
- setClickCount = _useState14[1];
92293
+ var _useState19 = React.useState(0),
92294
+ _useState20 = _slicedToArray__default["default"](_useState19, 2),
92295
+ clickCount = _useState20[0],
92296
+ setClickCount = _useState20[1];
92280
92297
  var handleClick = function handleClick() {
92281
92298
  // Increase the click count by 1
92282
92299
  setClickCount(function (prevCount) {
@@ -92319,14 +92336,14 @@ var Simpleproductcard = function Simpleproductcard(props) {
92319
92336
  fontSize: sectionproperties.pillfontSize + 'px',
92320
92337
  direction: 'ltr'
92321
92338
  }
92322
- }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%'), sectionproperties.countertype == 'Value' && /*#__PURE__*/React__default["default"].createElement("p", {
92339
+ }, '-' + parseFloat(Math.round(10.0 * ((parseInt(price) - parseInt(sale_price)) / parseInt(price)) * 100) / 10.0).toFixed(0) + '%'), sectionproperties.countertype == 'Value' && /*#__PURE__*/React__default["default"].createElement("p", {
92323
92340
  "class": "m-0 p-0 text-uppercase",
92324
92341
  style: {
92325
92342
  color: sectionproperties.pillcolor,
92326
92343
  fontSize: sectionproperties.pillfontSize + 'px',
92327
92344
  direction: 'ltr'
92328
92345
  }
92329
- }, langdetect == 'en' ? 'Save' : 'وفر', " ", langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(item.defaultprice) - parseInt(item.defaultsaleprice))).toFixed(0), " ", langdetect == 'en' ? '' : item.currencyname));
92346
+ }, langdetect == 'en' ? 'Save' : 'وفر', " ", langdetect == 'en' ? item.currencyname : '', " ", parseFloat(Math.round(parseInt(price) - parseInt(sale_price))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname));
92330
92347
  };
92331
92348
  return /*#__PURE__*/React__default["default"].createElement("div", {
92332
92349
  "class": props.sectiontypeprops2 == 'vertical' ? sectionproperties.card_marginLeft == 0 && sectionproperties.card_marginRight == 0 ? "".concat(card_cssstyles.productcard) + ' w-100 ' : "".concat(card_cssstyles.productcard) + ' w-100 px-md-1 ' : " ".concat(card_cssstyles.productcard),
@@ -92431,7 +92448,7 @@ var Simpleproductcard = function Simpleproductcard(props) {
92431
92448
  color: sectionproperties.badge_color,
92432
92449
  fontSize: sectionproperties.badge_fontsize + 'px'
92433
92450
  }
92434
- }, langdetect == 'en' ? sectionproperties.badgeContentEn : sectionproperties.badgeContentAr)), sectionproperties.showpill == 'Show' && item.hassale == 1 && sectionproperties.counterposition == 'Top' && /*#__PURE__*/React__default["default"].createElement("div", {
92451
+ }, langdetect == 'en' ? sectionproperties.badgeContentEn : sectionproperties.badgeContentAr)), sectionproperties.showpill == 'Show' && has_sale == 1 && sectionproperties.counterposition == 'Top' && /*#__PURE__*/React__default["default"].createElement("div", {
92435
92452
  style: {
92436
92453
  position: 'absolute',
92437
92454
  top: sectionproperties.pillpositionfromtop + 'px',
@@ -92646,11 +92663,11 @@ var Simpleproductcard = function Simpleproductcard(props) {
92646
92663
  }
92647
92664
  }, sectionproperties.prodPriceShow == 'Show' && /*#__PURE__*/React__default["default"].createElement("p", {
92648
92665
  "class": sectionproperties.priceDirection == 'Horizontal Direction' ? "".concat(card_cssstyles.productPricestyles) + ' m-0 ' : "".concat(card_cssstyles.productPricestyles) + ' m-0 '
92649
- }, langdetect == 'en' ? item.currencyname : '', " ", item.hassale == 1 ? item.defaultsaleprice : item.defaultprice, ' ', langdetect == 'en' ? '' : item.currencyname), sectionproperties.prodsalePriceshow == 'Show' && item.hassale == 1 && /*#__PURE__*/React__default["default"].createElement("div", {
92666
+ }, langdetect == 'en' ? item.currencyname : '', " ", has_sale == 1 ? sale_price : price, " ", langdetect == 'en' ? '' : item.currencyname), sectionproperties.prodsalePriceshow == 'Show' && has_sale == 1 && /*#__PURE__*/React__default["default"].createElement("div", {
92650
92667
  "class": sectionproperties.priceDirection == 'Horizontal' ? ' d-flex align-items-center p-0 mb-0 ' : ' d-flex align-items-center p-0 mb-0'
92651
92668
  }, /*#__PURE__*/React__default["default"].createElement("p", {
92652
92669
  "class": "".concat(card_cssstyles.productSalePricestyles) + ' linethrough m-0 mr-2 ml-2 '
92653
- }, langdetect == 'en' ? item.currencyname : '', " ", item.defaultprice, " ", langdetect == 'en' ? '' : item.currencyname)), sectionproperties.showpill == 'Show' && item.hassale == 1 && sectionproperties.counterposition == 'Besides Sale Price' && /*#__PURE__*/React__default["default"].createElement("div", {
92670
+ }, langdetect == 'en' ? item.currencyname : '', " ", price, " ", langdetect == 'en' ? '' : item.currencyname)), sectionproperties.showpill == 'Show' && has_sale == 1 && sectionproperties.counterposition == 'Besides Sale Price' && /*#__PURE__*/React__default["default"].createElement("div", {
92654
92671
  style: {}
92655
92672
  }, PillContainer()))), sectionproperties.showvariantscont == 'Show' && /*#__PURE__*/React__default["default"].createElement("div", {
92656
92673
  "class": "col-12 p-0"
@@ -92662,7 +92679,37 @@ var Simpleproductcard = function Simpleproductcard(props) {
92662
92679
  fetchingtypeprops: props.fetchingtypeprops
92663
92680
  },
92664
92681
  foundMatchedVariantFunc: function foundMatchedVariantFunc(variantCompletedObj) {
92682
+ // alert(JSON.stringify(variantCompletedObj));
92683
+ // console.log(variantCompletedObj);
92665
92684
  setvariantObj(variantCompletedObj);
92685
+ var variant_price = 0;
92686
+ var variant_saleprice = 0;
92687
+ var variant_hassale = 0;
92688
+ var is_found = false;
92689
+ if (variantCompletedObj != null && variantCompletedObj != undefined) {
92690
+ var _variantCompletedObj$;
92691
+ if (variantCompletedObj.variant_prices != undefined && variantCompletedObj != null && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$ = variantCompletedObj.variant_prices) === null || _variantCompletedObj$ === void 0 ? void 0 : _variantCompletedObj$.length) != 0) {
92692
+ var _variantCompletedObj$2, _variantCompletedObj$3, _variantCompletedObj$5, _variantCompletedObj$6, _variantCompletedObj$8, _variantCompletedObj$9;
92693
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$2 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$2 === void 0 ? void 0 : _variantCompletedObj$2.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$3 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$3 === void 0 ? void 0 : _variantCompletedObj$3.price) != null) {
92694
+ var _variantCompletedObj$4;
92695
+ variant_price = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$4 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$4 === void 0 ? void 0 : _variantCompletedObj$4.price;
92696
+ is_found = true;
92697
+ }
92698
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$5 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$5 === void 0 ? void 0 : _variantCompletedObj$5.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$6 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$6 === void 0 ? void 0 : _variantCompletedObj$6.price) != null) {
92699
+ var _variantCompletedObj$7;
92700
+ variant_saleprice = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$7 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$7 === void 0 ? void 0 : _variantCompletedObj$7.saleprice;
92701
+ }
92702
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$8 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$8 === void 0 ? void 0 : _variantCompletedObj$8.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$9 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$9 === void 0 ? void 0 : _variantCompletedObj$9.price) != null) {
92703
+ var _variantCompletedObj$0;
92704
+ variant_hassale = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$0 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$0 === void 0 ? void 0 : _variantCompletedObj$0.hassale;
92705
+ }
92706
+ }
92707
+ }
92708
+ if (is_found) {
92709
+ setprice(variant_price);
92710
+ setsale_price(variant_saleprice);
92711
+ sethas_sale(variant_hassale);
92712
+ }
92666
92713
  },
92667
92714
  foundImageColorMatchingFunc: function foundImageColorMatchingFunc(variantIMAGECompletedObj) {
92668
92715
  setVariant_Color_ImageObj(variantIMAGECompletedObj);
@@ -92691,7 +92738,7 @@ var Simpleproductcard = function Simpleproductcard(props) {
92691
92738
  style: {
92692
92739
  fontWeight: sectionproperties.profitcontainersecondaryfontweight
92693
92740
  }
92694
- }, langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(item.hassale == 1 ? item.defaultsaleprice : item.defaultprice) * (item.prodaffpercentprofit / 100))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname)))), sectionproperties.quantityshow == 'Show' && item.currentquantity > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
92741
+ }, langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(has_sale == 1 ? sale_price : price) * (item.prodaffpercentprofit / 100))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname)))), sectionproperties.quantityshow == 'Show' && item.currentquantity > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
92695
92742
  "class": "col-lg-12 p-0 d-flex align-items-center",
92696
92743
  style: {
92697
92744
  justifyContent: sectionproperties.productnamecentered == 'Centered' ? 'center' : 'start'
package/dist/index.esm.js CHANGED
@@ -91722,11 +91722,23 @@ var Simpleproductcard = function Simpleproductcard(props) {
91722
91722
  _useState0 = _slicedToArray(_useState9, 2),
91723
91723
  Variant_Color_ImageObj = _useState0[0],
91724
91724
  setVariant_Color_ImageObj = _useState0[1];
91725
- var authdetailsContext = props.actions.authdetailsContext;
91726
- var _useState1 = useState(false),
91725
+ var _useState1 = useState(0),
91727
91726
  _useState10 = _slicedToArray(_useState1, 2),
91728
- showquantity = _useState10[0],
91729
- setshowquantity = _useState10[1];
91727
+ price = _useState10[0],
91728
+ setprice = _useState10[1];
91729
+ var _useState11 = useState(0),
91730
+ _useState12 = _slicedToArray(_useState11, 2),
91731
+ sale_price = _useState12[0],
91732
+ setsale_price = _useState12[1];
91733
+ var _useState13 = useState(0),
91734
+ _useState14 = _slicedToArray(_useState13, 2),
91735
+ has_sale = _useState14[0],
91736
+ sethas_sale = _useState14[1];
91737
+ var authdetailsContext = props.actions.authdetailsContext;
91738
+ var _useState15 = useState(false),
91739
+ _useState16 = _slicedToArray(_useState15, 2),
91740
+ showquantity = _useState16[0],
91741
+ setshowquantity = _useState16[1];
91730
91742
  var plainString = function plainString(html) {
91731
91743
  var divContainer = document.createElement('div');
91732
91744
  divContainer.innerHTML = html;
@@ -91744,8 +91756,13 @@ var Simpleproductcard = function Simpleproductcard(props) {
91744
91756
  setsectionproperties(_objectSpread$6({}, secpropobj));
91745
91757
  }, [StatePagePropertiesContext]);
91746
91758
  useEffect(function () {
91759
+ var _props$cardinfoitempr, _props$cardinfoitempr2, _props$cardinfoitempr3;
91747
91760
  setitem(props.cardinfoitemprops);
91761
+ setprice(props === null || props === void 0 || (_props$cardinfoitempr = props.cardinfoitemprops) === null || _props$cardinfoitempr === void 0 ? void 0 : _props$cardinfoitempr.defaultprice);
91762
+ setsale_price(props === null || props === void 0 || (_props$cardinfoitempr2 = props.cardinfoitemprops) === null || _props$cardinfoitempr2 === void 0 ? void 0 : _props$cardinfoitempr2.defaultsaleprice);
91763
+ sethas_sale(props === null || props === void 0 || (_props$cardinfoitempr3 = props.cardinfoitemprops) === null || _props$cardinfoitempr3 === void 0 ? void 0 : _props$cardinfoitempr3.hassale);
91748
91764
  }, [props.cardinfoitemprops]);
91765
+
91749
91766
  // useEffect(() => {
91750
91767
  // if (item.quantity == 0) {
91751
91768
  // setshowquantity(false);
@@ -92011,32 +92028,32 @@ var Simpleproductcard = function Simpleproductcard(props) {
92011
92028
  }
92012
92029
  })
92013
92030
  };
92014
- var _useState11 = useState(''),
92015
- _useState12 = _slicedToArray(_useState11, 2),
92016
- secondimage = _useState12[0],
92017
- setsecondimage = _useState12[1];
92031
+ var _useState17 = useState(''),
92032
+ _useState18 = _slicedToArray(_useState17, 2),
92033
+ secondimage = _useState18[0],
92034
+ setsecondimage = _useState18[1];
92018
92035
  useEffect(function () {
92019
- var _props$cardinfoitempr;
92036
+ var _props$cardinfoitempr4;
92020
92037
  setitem(props.cardinfoitemprops);
92021
- if ((props === null || props === void 0 || (_props$cardinfoitempr = props.cardinfoitemprops) === null || _props$cardinfoitempr === void 0 || (_props$cardinfoitempr = _props$cardinfoitempr.productimages) === null || _props$cardinfoitempr === void 0 ? void 0 : _props$cardinfoitempr.length) == 1) {
92022
- var _props$cardinfoitempr2;
92023
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr2 = props.cardinfoitemprops) === null || _props$cardinfoitempr2 === void 0 ? void 0 : _props$cardinfoitempr2.image);
92038
+ if ((props === null || props === void 0 || (_props$cardinfoitempr4 = props.cardinfoitemprops) === null || _props$cardinfoitempr4 === void 0 || (_props$cardinfoitempr4 = _props$cardinfoitempr4.productimages) === null || _props$cardinfoitempr4 === void 0 ? void 0 : _props$cardinfoitempr4.length) == 1) {
92039
+ var _props$cardinfoitempr5;
92040
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr5 = props.cardinfoitemprops) === null || _props$cardinfoitempr5 === void 0 ? void 0 : _props$cardinfoitempr5.image);
92024
92041
  } else {
92025
- var _props$cardinfoitempr3, _props$cardinfoitempr4;
92026
- if ((props === null || props === void 0 ? void 0 : props.cardinfoitemprops) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr3 = props.cardinfoitemprops) === null || _props$cardinfoitempr3 === void 0 ? void 0 : _props$cardinfoitempr3.productimages) != undefined && Array.isArray(props === null || props === void 0 || (_props$cardinfoitempr4 = props.cardinfoitemprops) === null || _props$cardinfoitempr4 === void 0 ? void 0 : _props$cardinfoitempr4.productimages)) {
92027
- var _props$cardinfoitempr5, _props$cardinfoitempr6, _props$cardinfoitempr7;
92028
- if ((props === null || props === void 0 || (_props$cardinfoitempr5 = props.cardinfoitemprops) === null || _props$cardinfoitempr5 === void 0 ? void 0 : _props$cardinfoitempr5.productimages[0]) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr6 = props.cardinfoitemprops) === null || _props$cardinfoitempr6 === void 0 || (_props$cardinfoitempr6 = _props$cardinfoitempr6.productimages[0]) === null || _props$cardinfoitempr6 === void 0 ? void 0 : _props$cardinfoitempr6.path) == (props === null || props === void 0 || (_props$cardinfoitempr7 = props.cardinfoitemprops) === null || _props$cardinfoitempr7 === void 0 ? void 0 : _props$cardinfoitempr7.image)) {
92029
- var _props$cardinfoitempr8;
92030
- if ((props === null || props === void 0 || (_props$cardinfoitempr8 = props.cardinfoitemprops) === null || _props$cardinfoitempr8 === void 0 || (_props$cardinfoitempr8 = _props$cardinfoitempr8.productimages[1]) === null || _props$cardinfoitempr8 === void 0 ? void 0 : _props$cardinfoitempr8.length) != 0) {
92031
- var _props$cardinfoitempr9;
92032
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr9 = props.cardinfoitemprops) === null || _props$cardinfoitempr9 === void 0 || (_props$cardinfoitempr9 = _props$cardinfoitempr9.productimages[1]) === null || _props$cardinfoitempr9 === void 0 ? void 0 : _props$cardinfoitempr9.path);
92042
+ var _props$cardinfoitempr6, _props$cardinfoitempr7;
92043
+ if ((props === null || props === void 0 ? void 0 : props.cardinfoitemprops) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr6 = props.cardinfoitemprops) === null || _props$cardinfoitempr6 === void 0 ? void 0 : _props$cardinfoitempr6.productimages) != undefined && Array.isArray(props === null || props === void 0 || (_props$cardinfoitempr7 = props.cardinfoitemprops) === null || _props$cardinfoitempr7 === void 0 ? void 0 : _props$cardinfoitempr7.productimages)) {
92044
+ var _props$cardinfoitempr8, _props$cardinfoitempr9, _props$cardinfoitempr0;
92045
+ if ((props === null || props === void 0 || (_props$cardinfoitempr8 = props.cardinfoitemprops) === null || _props$cardinfoitempr8 === void 0 ? void 0 : _props$cardinfoitempr8.productimages[0]) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr9 = props.cardinfoitemprops) === null || _props$cardinfoitempr9 === void 0 || (_props$cardinfoitempr9 = _props$cardinfoitempr9.productimages[0]) === null || _props$cardinfoitempr9 === void 0 ? void 0 : _props$cardinfoitempr9.path) == (props === null || props === void 0 || (_props$cardinfoitempr0 = props.cardinfoitemprops) === null || _props$cardinfoitempr0 === void 0 ? void 0 : _props$cardinfoitempr0.image)) {
92046
+ var _props$cardinfoitempr1;
92047
+ if ((props === null || props === void 0 || (_props$cardinfoitempr1 = props.cardinfoitemprops) === null || _props$cardinfoitempr1 === void 0 || (_props$cardinfoitempr1 = _props$cardinfoitempr1.productimages[1]) === null || _props$cardinfoitempr1 === void 0 ? void 0 : _props$cardinfoitempr1.length) != 0) {
92048
+ var _props$cardinfoitempr10;
92049
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr10 = props.cardinfoitemprops) === null || _props$cardinfoitempr10 === void 0 || (_props$cardinfoitempr10 = _props$cardinfoitempr10.productimages[1]) === null || _props$cardinfoitempr10 === void 0 ? void 0 : _props$cardinfoitempr10.path);
92033
92050
  } else {
92034
- var _props$cardinfoitempr0;
92035
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr0 = props.cardinfoitemprops) === null || _props$cardinfoitempr0 === void 0 ? void 0 : _props$cardinfoitempr0.image);
92051
+ var _props$cardinfoitempr11;
92052
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr11 = props.cardinfoitemprops) === null || _props$cardinfoitempr11 === void 0 ? void 0 : _props$cardinfoitempr11.image);
92036
92053
  }
92037
92054
  } else {
92038
- var _props$cardinfoitempr1;
92039
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr1 = props.cardinfoitemprops) === null || _props$cardinfoitempr1 === void 0 || (_props$cardinfoitempr1 = _props$cardinfoitempr1.productimages[0]) === null || _props$cardinfoitempr1 === void 0 ? void 0 : _props$cardinfoitempr1.path);
92055
+ var _props$cardinfoitempr12;
92056
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr12 = props.cardinfoitemprops) === null || _props$cardinfoitempr12 === void 0 || (_props$cardinfoitempr12 = _props$cardinfoitempr12.productimages[0]) === null || _props$cardinfoitempr12 === void 0 ? void 0 : _props$cardinfoitempr12.path);
92040
92057
  }
92041
92058
  }
92042
92059
  }
@@ -92222,10 +92239,10 @@ var Simpleproductcard = function Simpleproductcard(props) {
92222
92239
  }
92223
92240
  }));
92224
92241
  };
92225
- var _useState13 = useState(0),
92226
- _useState14 = _slicedToArray(_useState13, 2),
92227
- clickCount = _useState14[0],
92228
- setClickCount = _useState14[1];
92242
+ var _useState19 = useState(0),
92243
+ _useState20 = _slicedToArray(_useState19, 2),
92244
+ clickCount = _useState20[0],
92245
+ setClickCount = _useState20[1];
92229
92246
  var handleClick = function handleClick() {
92230
92247
  // Increase the click count by 1
92231
92248
  setClickCount(function (prevCount) {
@@ -92268,14 +92285,14 @@ var Simpleproductcard = function Simpleproductcard(props) {
92268
92285
  fontSize: sectionproperties.pillfontSize + 'px',
92269
92286
  direction: 'ltr'
92270
92287
  }
92271
- }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%'), sectionproperties.countertype == 'Value' && /*#__PURE__*/React.createElement("p", {
92288
+ }, '-' + parseFloat(Math.round(10.0 * ((parseInt(price) - parseInt(sale_price)) / parseInt(price)) * 100) / 10.0).toFixed(0) + '%'), sectionproperties.countertype == 'Value' && /*#__PURE__*/React.createElement("p", {
92272
92289
  "class": "m-0 p-0 text-uppercase",
92273
92290
  style: {
92274
92291
  color: sectionproperties.pillcolor,
92275
92292
  fontSize: sectionproperties.pillfontSize + 'px',
92276
92293
  direction: 'ltr'
92277
92294
  }
92278
- }, langdetect == 'en' ? 'Save' : 'وفر', " ", langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(item.defaultprice) - parseInt(item.defaultsaleprice))).toFixed(0), " ", langdetect == 'en' ? '' : item.currencyname));
92295
+ }, langdetect == 'en' ? 'Save' : 'وفر', " ", langdetect == 'en' ? item.currencyname : '', " ", parseFloat(Math.round(parseInt(price) - parseInt(sale_price))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname));
92279
92296
  };
92280
92297
  return /*#__PURE__*/React.createElement("div", {
92281
92298
  "class": props.sectiontypeprops2 == 'vertical' ? sectionproperties.card_marginLeft == 0 && sectionproperties.card_marginRight == 0 ? "".concat(card_cssstyles.productcard) + ' w-100 ' : "".concat(card_cssstyles.productcard) + ' w-100 px-md-1 ' : " ".concat(card_cssstyles.productcard),
@@ -92380,7 +92397,7 @@ var Simpleproductcard = function Simpleproductcard(props) {
92380
92397
  color: sectionproperties.badge_color,
92381
92398
  fontSize: sectionproperties.badge_fontsize + 'px'
92382
92399
  }
92383
- }, langdetect == 'en' ? sectionproperties.badgeContentEn : sectionproperties.badgeContentAr)), sectionproperties.showpill == 'Show' && item.hassale == 1 && sectionproperties.counterposition == 'Top' && /*#__PURE__*/React.createElement("div", {
92400
+ }, langdetect == 'en' ? sectionproperties.badgeContentEn : sectionproperties.badgeContentAr)), sectionproperties.showpill == 'Show' && has_sale == 1 && sectionproperties.counterposition == 'Top' && /*#__PURE__*/React.createElement("div", {
92384
92401
  style: {
92385
92402
  position: 'absolute',
92386
92403
  top: sectionproperties.pillpositionfromtop + 'px',
@@ -92595,11 +92612,11 @@ var Simpleproductcard = function Simpleproductcard(props) {
92595
92612
  }
92596
92613
  }, sectionproperties.prodPriceShow == 'Show' && /*#__PURE__*/React.createElement("p", {
92597
92614
  "class": sectionproperties.priceDirection == 'Horizontal Direction' ? "".concat(card_cssstyles.productPricestyles) + ' m-0 ' : "".concat(card_cssstyles.productPricestyles) + ' m-0 '
92598
- }, langdetect == 'en' ? item.currencyname : '', " ", item.hassale == 1 ? item.defaultsaleprice : item.defaultprice, ' ', langdetect == 'en' ? '' : item.currencyname), sectionproperties.prodsalePriceshow == 'Show' && item.hassale == 1 && /*#__PURE__*/React.createElement("div", {
92615
+ }, langdetect == 'en' ? item.currencyname : '', " ", has_sale == 1 ? sale_price : price, " ", langdetect == 'en' ? '' : item.currencyname), sectionproperties.prodsalePriceshow == 'Show' && has_sale == 1 && /*#__PURE__*/React.createElement("div", {
92599
92616
  "class": sectionproperties.priceDirection == 'Horizontal' ? ' d-flex align-items-center p-0 mb-0 ' : ' d-flex align-items-center p-0 mb-0'
92600
92617
  }, /*#__PURE__*/React.createElement("p", {
92601
92618
  "class": "".concat(card_cssstyles.productSalePricestyles) + ' linethrough m-0 mr-2 ml-2 '
92602
- }, langdetect == 'en' ? item.currencyname : '', " ", item.defaultprice, " ", langdetect == 'en' ? '' : item.currencyname)), sectionproperties.showpill == 'Show' && item.hassale == 1 && sectionproperties.counterposition == 'Besides Sale Price' && /*#__PURE__*/React.createElement("div", {
92619
+ }, langdetect == 'en' ? item.currencyname : '', " ", price, " ", langdetect == 'en' ? '' : item.currencyname)), sectionproperties.showpill == 'Show' && has_sale == 1 && sectionproperties.counterposition == 'Besides Sale Price' && /*#__PURE__*/React.createElement("div", {
92603
92620
  style: {}
92604
92621
  }, PillContainer()))), sectionproperties.showvariantscont == 'Show' && /*#__PURE__*/React.createElement("div", {
92605
92622
  "class": "col-12 p-0"
@@ -92611,7 +92628,37 @@ var Simpleproductcard = function Simpleproductcard(props) {
92611
92628
  fetchingtypeprops: props.fetchingtypeprops
92612
92629
  },
92613
92630
  foundMatchedVariantFunc: function foundMatchedVariantFunc(variantCompletedObj) {
92631
+ // alert(JSON.stringify(variantCompletedObj));
92632
+ // console.log(variantCompletedObj);
92614
92633
  setvariantObj(variantCompletedObj);
92634
+ var variant_price = 0;
92635
+ var variant_saleprice = 0;
92636
+ var variant_hassale = 0;
92637
+ var is_found = false;
92638
+ if (variantCompletedObj != null && variantCompletedObj != undefined) {
92639
+ var _variantCompletedObj$;
92640
+ if (variantCompletedObj.variant_prices != undefined && variantCompletedObj != null && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$ = variantCompletedObj.variant_prices) === null || _variantCompletedObj$ === void 0 ? void 0 : _variantCompletedObj$.length) != 0) {
92641
+ var _variantCompletedObj$2, _variantCompletedObj$3, _variantCompletedObj$5, _variantCompletedObj$6, _variantCompletedObj$8, _variantCompletedObj$9;
92642
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$2 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$2 === void 0 ? void 0 : _variantCompletedObj$2.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$3 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$3 === void 0 ? void 0 : _variantCompletedObj$3.price) != null) {
92643
+ var _variantCompletedObj$4;
92644
+ variant_price = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$4 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$4 === void 0 ? void 0 : _variantCompletedObj$4.price;
92645
+ is_found = true;
92646
+ }
92647
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$5 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$5 === void 0 ? void 0 : _variantCompletedObj$5.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$6 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$6 === void 0 ? void 0 : _variantCompletedObj$6.price) != null) {
92648
+ var _variantCompletedObj$7;
92649
+ variant_saleprice = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$7 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$7 === void 0 ? void 0 : _variantCompletedObj$7.saleprice;
92650
+ }
92651
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$8 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$8 === void 0 ? void 0 : _variantCompletedObj$8.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$9 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$9 === void 0 ? void 0 : _variantCompletedObj$9.price) != null) {
92652
+ var _variantCompletedObj$0;
92653
+ variant_hassale = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$0 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$0 === void 0 ? void 0 : _variantCompletedObj$0.hassale;
92654
+ }
92655
+ }
92656
+ }
92657
+ if (is_found) {
92658
+ setprice(variant_price);
92659
+ setsale_price(variant_saleprice);
92660
+ sethas_sale(variant_hassale);
92661
+ }
92615
92662
  },
92616
92663
  foundImageColorMatchingFunc: function foundImageColorMatchingFunc(variantIMAGECompletedObj) {
92617
92664
  setVariant_Color_ImageObj(variantIMAGECompletedObj);
@@ -92640,7 +92687,7 @@ var Simpleproductcard = function Simpleproductcard(props) {
92640
92687
  style: {
92641
92688
  fontWeight: sectionproperties.profitcontainersecondaryfontweight
92642
92689
  }
92643
- }, langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(item.hassale == 1 ? item.defaultsaleprice : item.defaultprice) * (item.prodaffpercentprofit / 100))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname)))), sectionproperties.quantityshow == 'Show' && item.currentquantity > 0 && /*#__PURE__*/React.createElement("div", {
92690
+ }, langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(has_sale == 1 ? sale_price : price) * (item.prodaffpercentprofit / 100))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname)))), sectionproperties.quantityshow == 'Show' && item.currentquantity > 0 && /*#__PURE__*/React.createElement("div", {
92644
92691
  "class": "col-lg-12 p-0 d-flex align-items-center",
92645
92692
  style: {
92646
92693
  justifyContent: sectionproperties.productnamecentered == 'Centered' ? 'center' : 'start'
package/dist/index.umd.js CHANGED
@@ -91582,11 +91582,23 @@
91582
91582
  _useState0 = _slicedToArray__default["default"](_useState9, 2),
91583
91583
  Variant_Color_ImageObj = _useState0[0],
91584
91584
  setVariant_Color_ImageObj = _useState0[1];
91585
- var authdetailsContext = props.actions.authdetailsContext;
91586
- var _useState1 = React.useState(false),
91585
+ var _useState1 = React.useState(0),
91587
91586
  _useState10 = _slicedToArray__default["default"](_useState1, 2),
91588
- showquantity = _useState10[0],
91589
- setshowquantity = _useState10[1];
91587
+ price = _useState10[0],
91588
+ setprice = _useState10[1];
91589
+ var _useState11 = React.useState(0),
91590
+ _useState12 = _slicedToArray__default["default"](_useState11, 2),
91591
+ sale_price = _useState12[0],
91592
+ setsale_price = _useState12[1];
91593
+ var _useState13 = React.useState(0),
91594
+ _useState14 = _slicedToArray__default["default"](_useState13, 2),
91595
+ has_sale = _useState14[0],
91596
+ sethas_sale = _useState14[1];
91597
+ var authdetailsContext = props.actions.authdetailsContext;
91598
+ var _useState15 = React.useState(false),
91599
+ _useState16 = _slicedToArray__default["default"](_useState15, 2),
91600
+ showquantity = _useState16[0],
91601
+ setshowquantity = _useState16[1];
91590
91602
  var plainString = function plainString(html) {
91591
91603
  var divContainer = document.createElement('div');
91592
91604
  divContainer.innerHTML = html;
@@ -91604,8 +91616,13 @@
91604
91616
  setsectionproperties(_objectSpread$6({}, secpropobj));
91605
91617
  }, [StatePagePropertiesContext]);
91606
91618
  React.useEffect(function () {
91619
+ var _props$cardinfoitempr, _props$cardinfoitempr2, _props$cardinfoitempr3;
91607
91620
  setitem(props.cardinfoitemprops);
91621
+ setprice(props === null || props === void 0 || (_props$cardinfoitempr = props.cardinfoitemprops) === null || _props$cardinfoitempr === void 0 ? void 0 : _props$cardinfoitempr.defaultprice);
91622
+ setsale_price(props === null || props === void 0 || (_props$cardinfoitempr2 = props.cardinfoitemprops) === null || _props$cardinfoitempr2 === void 0 ? void 0 : _props$cardinfoitempr2.defaultsaleprice);
91623
+ sethas_sale(props === null || props === void 0 || (_props$cardinfoitempr3 = props.cardinfoitemprops) === null || _props$cardinfoitempr3 === void 0 ? void 0 : _props$cardinfoitempr3.hassale);
91608
91624
  }, [props.cardinfoitemprops]);
91625
+
91609
91626
  // useEffect(() => {
91610
91627
  // if (item.quantity == 0) {
91611
91628
  // setshowquantity(false);
@@ -91871,32 +91888,32 @@
91871
91888
  }
91872
91889
  })
91873
91890
  };
91874
- var _useState11 = React.useState(''),
91875
- _useState12 = _slicedToArray__default["default"](_useState11, 2),
91876
- secondimage = _useState12[0],
91877
- setsecondimage = _useState12[1];
91891
+ var _useState17 = React.useState(''),
91892
+ _useState18 = _slicedToArray__default["default"](_useState17, 2),
91893
+ secondimage = _useState18[0],
91894
+ setsecondimage = _useState18[1];
91878
91895
  React.useEffect(function () {
91879
- var _props$cardinfoitempr;
91896
+ var _props$cardinfoitempr4;
91880
91897
  setitem(props.cardinfoitemprops);
91881
- if ((props === null || props === void 0 || (_props$cardinfoitempr = props.cardinfoitemprops) === null || _props$cardinfoitempr === void 0 || (_props$cardinfoitempr = _props$cardinfoitempr.productimages) === null || _props$cardinfoitempr === void 0 ? void 0 : _props$cardinfoitempr.length) == 1) {
91882
- var _props$cardinfoitempr2;
91883
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr2 = props.cardinfoitemprops) === null || _props$cardinfoitempr2 === void 0 ? void 0 : _props$cardinfoitempr2.image);
91898
+ if ((props === null || props === void 0 || (_props$cardinfoitempr4 = props.cardinfoitemprops) === null || _props$cardinfoitempr4 === void 0 || (_props$cardinfoitempr4 = _props$cardinfoitempr4.productimages) === null || _props$cardinfoitempr4 === void 0 ? void 0 : _props$cardinfoitempr4.length) == 1) {
91899
+ var _props$cardinfoitempr5;
91900
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr5 = props.cardinfoitemprops) === null || _props$cardinfoitempr5 === void 0 ? void 0 : _props$cardinfoitempr5.image);
91884
91901
  } else {
91885
- var _props$cardinfoitempr3, _props$cardinfoitempr4;
91886
- if ((props === null || props === void 0 ? void 0 : props.cardinfoitemprops) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr3 = props.cardinfoitemprops) === null || _props$cardinfoitempr3 === void 0 ? void 0 : _props$cardinfoitempr3.productimages) != undefined && Array.isArray(props === null || props === void 0 || (_props$cardinfoitempr4 = props.cardinfoitemprops) === null || _props$cardinfoitempr4 === void 0 ? void 0 : _props$cardinfoitempr4.productimages)) {
91887
- var _props$cardinfoitempr5, _props$cardinfoitempr6, _props$cardinfoitempr7;
91888
- if ((props === null || props === void 0 || (_props$cardinfoitempr5 = props.cardinfoitemprops) === null || _props$cardinfoitempr5 === void 0 ? void 0 : _props$cardinfoitempr5.productimages[0]) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr6 = props.cardinfoitemprops) === null || _props$cardinfoitempr6 === void 0 || (_props$cardinfoitempr6 = _props$cardinfoitempr6.productimages[0]) === null || _props$cardinfoitempr6 === void 0 ? void 0 : _props$cardinfoitempr6.path) == (props === null || props === void 0 || (_props$cardinfoitempr7 = props.cardinfoitemprops) === null || _props$cardinfoitempr7 === void 0 ? void 0 : _props$cardinfoitempr7.image)) {
91889
- var _props$cardinfoitempr8;
91890
- if ((props === null || props === void 0 || (_props$cardinfoitempr8 = props.cardinfoitemprops) === null || _props$cardinfoitempr8 === void 0 || (_props$cardinfoitempr8 = _props$cardinfoitempr8.productimages[1]) === null || _props$cardinfoitempr8 === void 0 ? void 0 : _props$cardinfoitempr8.length) != 0) {
91891
- var _props$cardinfoitempr9;
91892
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr9 = props.cardinfoitemprops) === null || _props$cardinfoitempr9 === void 0 || (_props$cardinfoitempr9 = _props$cardinfoitempr9.productimages[1]) === null || _props$cardinfoitempr9 === void 0 ? void 0 : _props$cardinfoitempr9.path);
91902
+ var _props$cardinfoitempr6, _props$cardinfoitempr7;
91903
+ if ((props === null || props === void 0 ? void 0 : props.cardinfoitemprops) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr6 = props.cardinfoitemprops) === null || _props$cardinfoitempr6 === void 0 ? void 0 : _props$cardinfoitempr6.productimages) != undefined && Array.isArray(props === null || props === void 0 || (_props$cardinfoitempr7 = props.cardinfoitemprops) === null || _props$cardinfoitempr7 === void 0 ? void 0 : _props$cardinfoitempr7.productimages)) {
91904
+ var _props$cardinfoitempr8, _props$cardinfoitempr9, _props$cardinfoitempr0;
91905
+ if ((props === null || props === void 0 || (_props$cardinfoitempr8 = props.cardinfoitemprops) === null || _props$cardinfoitempr8 === void 0 ? void 0 : _props$cardinfoitempr8.productimages[0]) != undefined && (props === null || props === void 0 || (_props$cardinfoitempr9 = props.cardinfoitemprops) === null || _props$cardinfoitempr9 === void 0 || (_props$cardinfoitempr9 = _props$cardinfoitempr9.productimages[0]) === null || _props$cardinfoitempr9 === void 0 ? void 0 : _props$cardinfoitempr9.path) == (props === null || props === void 0 || (_props$cardinfoitempr0 = props.cardinfoitemprops) === null || _props$cardinfoitempr0 === void 0 ? void 0 : _props$cardinfoitempr0.image)) {
91906
+ var _props$cardinfoitempr1;
91907
+ if ((props === null || props === void 0 || (_props$cardinfoitempr1 = props.cardinfoitemprops) === null || _props$cardinfoitempr1 === void 0 || (_props$cardinfoitempr1 = _props$cardinfoitempr1.productimages[1]) === null || _props$cardinfoitempr1 === void 0 ? void 0 : _props$cardinfoitempr1.length) != 0) {
91908
+ var _props$cardinfoitempr10;
91909
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr10 = props.cardinfoitemprops) === null || _props$cardinfoitempr10 === void 0 || (_props$cardinfoitempr10 = _props$cardinfoitempr10.productimages[1]) === null || _props$cardinfoitempr10 === void 0 ? void 0 : _props$cardinfoitempr10.path);
91893
91910
  } else {
91894
- var _props$cardinfoitempr0;
91895
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr0 = props.cardinfoitemprops) === null || _props$cardinfoitempr0 === void 0 ? void 0 : _props$cardinfoitempr0.image);
91911
+ var _props$cardinfoitempr11;
91912
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr11 = props.cardinfoitemprops) === null || _props$cardinfoitempr11 === void 0 ? void 0 : _props$cardinfoitempr11.image);
91896
91913
  }
91897
91914
  } else {
91898
- var _props$cardinfoitempr1;
91899
- setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr1 = props.cardinfoitemprops) === null || _props$cardinfoitempr1 === void 0 || (_props$cardinfoitempr1 = _props$cardinfoitempr1.productimages[0]) === null || _props$cardinfoitempr1 === void 0 ? void 0 : _props$cardinfoitempr1.path);
91915
+ var _props$cardinfoitempr12;
91916
+ setsecondimage(props === null || props === void 0 || (_props$cardinfoitempr12 = props.cardinfoitemprops) === null || _props$cardinfoitempr12 === void 0 || (_props$cardinfoitempr12 = _props$cardinfoitempr12.productimages[0]) === null || _props$cardinfoitempr12 === void 0 ? void 0 : _props$cardinfoitempr12.path);
91900
91917
  }
91901
91918
  }
91902
91919
  }
@@ -92082,10 +92099,10 @@
92082
92099
  }
92083
92100
  }));
92084
92101
  };
92085
- var _useState13 = React.useState(0),
92086
- _useState14 = _slicedToArray__default["default"](_useState13, 2),
92087
- clickCount = _useState14[0],
92088
- setClickCount = _useState14[1];
92102
+ var _useState19 = React.useState(0),
92103
+ _useState20 = _slicedToArray__default["default"](_useState19, 2),
92104
+ clickCount = _useState20[0],
92105
+ setClickCount = _useState20[1];
92089
92106
  var handleClick = function handleClick() {
92090
92107
  // Increase the click count by 1
92091
92108
  setClickCount(function (prevCount) {
@@ -92128,14 +92145,14 @@
92128
92145
  fontSize: sectionproperties.pillfontSize + 'px',
92129
92146
  direction: 'ltr'
92130
92147
  }
92131
- }, '-' + parseFloat(Math.round(10.0 * ((parseInt(item.defaultprice) - parseInt(item.defaultsaleprice)) / parseInt(item.defaultprice)) * 100) / 10.0).toFixed(0) + '%'), sectionproperties.countertype == 'Value' && /*#__PURE__*/React__default["default"].createElement("p", {
92148
+ }, '-' + parseFloat(Math.round(10.0 * ((parseInt(price) - parseInt(sale_price)) / parseInt(price)) * 100) / 10.0).toFixed(0) + '%'), sectionproperties.countertype == 'Value' && /*#__PURE__*/React__default["default"].createElement("p", {
92132
92149
  "class": "m-0 p-0 text-uppercase",
92133
92150
  style: {
92134
92151
  color: sectionproperties.pillcolor,
92135
92152
  fontSize: sectionproperties.pillfontSize + 'px',
92136
92153
  direction: 'ltr'
92137
92154
  }
92138
- }, langdetect == 'en' ? 'Save' : 'وفر', " ", langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(item.defaultprice) - parseInt(item.defaultsaleprice))).toFixed(0), " ", langdetect == 'en' ? '' : item.currencyname));
92155
+ }, langdetect == 'en' ? 'Save' : 'وفر', " ", langdetect == 'en' ? item.currencyname : '', " ", parseFloat(Math.round(parseInt(price) - parseInt(sale_price))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname));
92139
92156
  };
92140
92157
  return /*#__PURE__*/React__default["default"].createElement("div", {
92141
92158
  "class": props.sectiontypeprops2 == 'vertical' ? sectionproperties.card_marginLeft == 0 && sectionproperties.card_marginRight == 0 ? "".concat(card_cssstyles.productcard) + ' w-100 ' : "".concat(card_cssstyles.productcard) + ' w-100 px-md-1 ' : " ".concat(card_cssstyles.productcard),
@@ -92240,7 +92257,7 @@
92240
92257
  color: sectionproperties.badge_color,
92241
92258
  fontSize: sectionproperties.badge_fontsize + 'px'
92242
92259
  }
92243
- }, langdetect == 'en' ? sectionproperties.badgeContentEn : sectionproperties.badgeContentAr)), sectionproperties.showpill == 'Show' && item.hassale == 1 && sectionproperties.counterposition == 'Top' && /*#__PURE__*/React__default["default"].createElement("div", {
92260
+ }, langdetect == 'en' ? sectionproperties.badgeContentEn : sectionproperties.badgeContentAr)), sectionproperties.showpill == 'Show' && has_sale == 1 && sectionproperties.counterposition == 'Top' && /*#__PURE__*/React__default["default"].createElement("div", {
92244
92261
  style: {
92245
92262
  position: 'absolute',
92246
92263
  top: sectionproperties.pillpositionfromtop + 'px',
@@ -92455,11 +92472,11 @@
92455
92472
  }
92456
92473
  }, sectionproperties.prodPriceShow == 'Show' && /*#__PURE__*/React__default["default"].createElement("p", {
92457
92474
  "class": sectionproperties.priceDirection == 'Horizontal Direction' ? "".concat(card_cssstyles.productPricestyles) + ' m-0 ' : "".concat(card_cssstyles.productPricestyles) + ' m-0 '
92458
- }, langdetect == 'en' ? item.currencyname : '', " ", item.hassale == 1 ? item.defaultsaleprice : item.defaultprice, ' ', langdetect == 'en' ? '' : item.currencyname), sectionproperties.prodsalePriceshow == 'Show' && item.hassale == 1 && /*#__PURE__*/React__default["default"].createElement("div", {
92475
+ }, langdetect == 'en' ? item.currencyname : '', " ", has_sale == 1 ? sale_price : price, " ", langdetect == 'en' ? '' : item.currencyname), sectionproperties.prodsalePriceshow == 'Show' && has_sale == 1 && /*#__PURE__*/React__default["default"].createElement("div", {
92459
92476
  "class": sectionproperties.priceDirection == 'Horizontal' ? ' d-flex align-items-center p-0 mb-0 ' : ' d-flex align-items-center p-0 mb-0'
92460
92477
  }, /*#__PURE__*/React__default["default"].createElement("p", {
92461
92478
  "class": "".concat(card_cssstyles.productSalePricestyles) + ' linethrough m-0 mr-2 ml-2 '
92462
- }, langdetect == 'en' ? item.currencyname : '', " ", item.defaultprice, " ", langdetect == 'en' ? '' : item.currencyname)), sectionproperties.showpill == 'Show' && item.hassale == 1 && sectionproperties.counterposition == 'Besides Sale Price' && /*#__PURE__*/React__default["default"].createElement("div", {
92479
+ }, langdetect == 'en' ? item.currencyname : '', " ", price, " ", langdetect == 'en' ? '' : item.currencyname)), sectionproperties.showpill == 'Show' && has_sale == 1 && sectionproperties.counterposition == 'Besides Sale Price' && /*#__PURE__*/React__default["default"].createElement("div", {
92463
92480
  style: {}
92464
92481
  }, PillContainer()))), sectionproperties.showvariantscont == 'Show' && /*#__PURE__*/React__default["default"].createElement("div", {
92465
92482
  "class": "col-12 p-0"
@@ -92471,7 +92488,37 @@
92471
92488
  fetchingtypeprops: props.fetchingtypeprops
92472
92489
  },
92473
92490
  foundMatchedVariantFunc: function foundMatchedVariantFunc(variantCompletedObj) {
92491
+ // alert(JSON.stringify(variantCompletedObj));
92492
+ // console.log(variantCompletedObj);
92474
92493
  setvariantObj(variantCompletedObj);
92494
+ var variant_price = 0;
92495
+ var variant_saleprice = 0;
92496
+ var variant_hassale = 0;
92497
+ var is_found = false;
92498
+ if (variantCompletedObj != null && variantCompletedObj != undefined) {
92499
+ var _variantCompletedObj$;
92500
+ if (variantCompletedObj.variant_prices != undefined && variantCompletedObj != null && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$ = variantCompletedObj.variant_prices) === null || _variantCompletedObj$ === void 0 ? void 0 : _variantCompletedObj$.length) != 0) {
92501
+ var _variantCompletedObj$2, _variantCompletedObj$3, _variantCompletedObj$5, _variantCompletedObj$6, _variantCompletedObj$8, _variantCompletedObj$9;
92502
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$2 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$2 === void 0 ? void 0 : _variantCompletedObj$2.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$3 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$3 === void 0 ? void 0 : _variantCompletedObj$3.price) != null) {
92503
+ var _variantCompletedObj$4;
92504
+ variant_price = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$4 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$4 === void 0 ? void 0 : _variantCompletedObj$4.price;
92505
+ is_found = true;
92506
+ }
92507
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$5 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$5 === void 0 ? void 0 : _variantCompletedObj$5.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$6 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$6 === void 0 ? void 0 : _variantCompletedObj$6.price) != null) {
92508
+ var _variantCompletedObj$7;
92509
+ variant_saleprice = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$7 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$7 === void 0 ? void 0 : _variantCompletedObj$7.saleprice;
92510
+ }
92511
+ if ((variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$8 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$8 === void 0 ? void 0 : _variantCompletedObj$8.price) != undefined && (variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$9 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$9 === void 0 ? void 0 : _variantCompletedObj$9.price) != null) {
92512
+ var _variantCompletedObj$0;
92513
+ variant_hassale = variantCompletedObj === null || variantCompletedObj === void 0 || (_variantCompletedObj$0 = variantCompletedObj.variant_prices[0]) === null || _variantCompletedObj$0 === void 0 ? void 0 : _variantCompletedObj$0.hassale;
92514
+ }
92515
+ }
92516
+ }
92517
+ if (is_found) {
92518
+ setprice(variant_price);
92519
+ setsale_price(variant_saleprice);
92520
+ sethas_sale(variant_hassale);
92521
+ }
92475
92522
  },
92476
92523
  foundImageColorMatchingFunc: function foundImageColorMatchingFunc(variantIMAGECompletedObj) {
92477
92524
  setVariant_Color_ImageObj(variantIMAGECompletedObj);
@@ -92500,7 +92547,7 @@
92500
92547
  style: {
92501
92548
  fontWeight: sectionproperties.profitcontainersecondaryfontweight
92502
92549
  }
92503
- }, langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(item.hassale == 1 ? item.defaultsaleprice : item.defaultprice) * (item.prodaffpercentprofit / 100))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname)))), sectionproperties.quantityshow == 'Show' && item.currentquantity > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
92550
+ }, langdetect == 'en' ? item.currencyname : '', ' ', parseFloat(Math.round(parseInt(has_sale == 1 ? sale_price : price) * (item.prodaffpercentprofit / 100))).toFixed(0), ' ', langdetect == 'en' ? '' : item.currencyname)))), sectionproperties.quantityshow == 'Show' && item.currentquantity > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
92504
92551
  "class": "col-lg-12 p-0 d-flex align-items-center",
92505
92552
  style: {
92506
92553
  justifyContent: sectionproperties.productnamecentered == 'Centered' ? 'center' : 'start'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabexseriescomponents",
3
- "version": "0.2.992",
3
+ "version": "0.2.993",
4
4
  "type": "module",
5
5
  "description": "your description",
6
6
  "main": "dist/index.cjs.js",