tabexseriescomponents 0.0.474 → 0.0.475
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 +128 -85
- package/dist/index.esm.js +128 -85
- package/dist/index.umd.js +128 -85
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -48543,25 +48543,8 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48543
48543
|
_useState10 = _slicedToArray__default["default"](_useState9, 2),
|
|
48544
48544
|
ProductsFetchingTypeSectionObj = _useState10[0],
|
|
48545
48545
|
setProductsFetchingTypeSectionObj = _useState10[1];
|
|
48546
|
-
var
|
|
48547
|
-
_useState12 = _slicedToArray__default["default"](_useState11, 2);
|
|
48548
|
-
_useState12[0];
|
|
48549
|
-
var setmaincontainerarrayofobjs = _useState12[1];
|
|
48550
|
-
// React.useEffect(() => {
|
|
48551
|
-
// if (inView) {
|
|
48552
|
-
// fetchProductsQuery.fetchNextPage();
|
|
48553
|
-
// }
|
|
48554
|
-
// }, [inView]);
|
|
48546
|
+
var fetchCategoriesQueryContext = props.actions.fetchCategoriesQueryContext;
|
|
48555
48547
|
React.useEffect(function () {
|
|
48556
|
-
var productfilerobjtemp = ProductFilterObjContext;
|
|
48557
|
-
if (props.filterparamsprops != undefined) {
|
|
48558
|
-
var filterpar = decodeURIComponent(props.filterparamsprops);
|
|
48559
|
-
var filterparsed = JSON.parse(filterpar);
|
|
48560
|
-
if (filterparsed != undefined) {
|
|
48561
|
-
productfilerobjtemp = filterparsed;
|
|
48562
|
-
setProductFilterObjContext(filterparsed);
|
|
48563
|
-
}
|
|
48564
|
-
}
|
|
48565
48548
|
StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
|
|
48566
48549
|
if (sectionitem.sectionid == props.sectionidprops) {
|
|
48567
48550
|
var secpropobj = {};
|
|
@@ -48584,6 +48567,8 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48584
48567
|
});
|
|
48585
48568
|
} else if (props.srcfromprops == 'InnerGroups' || props.srcfromprops == 'InnerCategory' || props.srcfromprops == 'InnerParentCollection') {
|
|
48586
48569
|
setfetchingtype(props.grouptypeprops);
|
|
48570
|
+
} else if (props.srcfromprops == 'Innervendor') {
|
|
48571
|
+
setfetchingtype('vendors');
|
|
48587
48572
|
} else {
|
|
48588
48573
|
setfetchingtype(sectionitem.fetchingtype);
|
|
48589
48574
|
setProductsFetchingTypeSectionObj({
|
|
@@ -48607,11 +48592,6 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48607
48592
|
if (fetchProductsQuery.isSuccess) {
|
|
48608
48593
|
var _fetchProductsQuery$d;
|
|
48609
48594
|
var allpagesarr = [];
|
|
48610
|
-
// fetchProductsQuery.data.pages.forEach((page) => {
|
|
48611
|
-
// page.data.products.forEach((productobj) => {
|
|
48612
|
-
// allpagesarr.push(productobj);
|
|
48613
|
-
// });
|
|
48614
|
-
// });
|
|
48615
48595
|
fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 || (_fetchProductsQuery$d = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d === void 0 || (_fetchProductsQuery$d = _fetchProductsQuery$d.products) === null || _fetchProductsQuery$d === void 0 || _fetchProductsQuery$d.forEach(function (item) {
|
|
48616
48596
|
allpagesarr.push(item);
|
|
48617
48597
|
});
|
|
@@ -48648,35 +48628,49 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48648
48628
|
tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
|
|
48649
48629
|
setProductFilterObjContext(_objectSpread$1k({}, tempfetchproductsfilerobjcontext));
|
|
48650
48630
|
}
|
|
48631
|
+
setFetchQueriesEngineContext(_objectSpread$1k({}, tempFetchQueriesEngineContext));
|
|
48632
|
+
}
|
|
48633
|
+
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
48634
|
+
React.useEffect(function () {
|
|
48635
|
+
if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
|
|
48651
48636
|
if (fetchingtype == 'categories') {
|
|
48652
|
-
|
|
48653
|
-
|
|
48654
|
-
|
|
48637
|
+
var categories = [];
|
|
48638
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48639
|
+
var _fetchCategoriesQuery;
|
|
48640
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery === void 0 || (_fetchCategoriesQuery = _fetchCategoriesQuery.data) === null || _fetchCategoriesQuery === void 0 ? void 0 : _fetchCategoriesQuery.categories;
|
|
48655
48641
|
}
|
|
48642
|
+
cardobjassigner(categories);
|
|
48656
48643
|
}
|
|
48657
48644
|
if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
|
|
48658
|
-
|
|
48659
|
-
|
|
48660
|
-
|
|
48661
|
-
var
|
|
48662
|
-
(
|
|
48663
|
-
|
|
48645
|
+
var _categories;
|
|
48646
|
+
var categories = [];
|
|
48647
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48648
|
+
var _fetchCategoriesQuery2;
|
|
48649
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery2 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery2 === void 0 || (_fetchCategoriesQuery2 = _fetchCategoriesQuery2.data) === null || _fetchCategoriesQuery2 === void 0 ? void 0 : _fetchCategoriesQuery2.categories;
|
|
48650
|
+
}
|
|
48651
|
+
// if (fetchAuthorizationQueryContext?.isSuccess) {
|
|
48652
|
+
// var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
|
|
48653
|
+
// alert(JSON.stringify(categories));
|
|
48654
|
+
var parentcollections = [];
|
|
48655
|
+
(_categories = categories) === null || _categories === void 0 || _categories.forEach(function (catitem, catindex) {
|
|
48656
|
+
catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
|
|
48657
|
+
if (parentcolitem.isshowntocustomers == 1) {
|
|
48664
48658
|
parentcolitem.categoryid = catitem.categoryid;
|
|
48665
48659
|
parentcollections.push(parentcolitem);
|
|
48666
|
-
});
|
|
48667
|
-
});
|
|
48668
|
-
if (fetchingtype == 'parentcollections') {
|
|
48669
|
-
if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
|
|
48670
|
-
var arrafterfilter = [];
|
|
48671
|
-
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48672
|
-
if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
|
|
48673
|
-
arrafterfilter.push(parentcolitem);
|
|
48674
|
-
}
|
|
48675
|
-
});
|
|
48676
|
-
parentcollections = arrafterfilter;
|
|
48677
48660
|
}
|
|
48661
|
+
});
|
|
48662
|
+
});
|
|
48663
|
+
if (fetchingtype == 'parentcollections') {
|
|
48664
|
+
if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
|
|
48665
|
+
var arrafterfilter = [];
|
|
48666
|
+
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48667
|
+
if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
|
|
48668
|
+
arrafterfilter.push(parentcolitem);
|
|
48669
|
+
}
|
|
48670
|
+
});
|
|
48671
|
+
parentcollections = arrafterfilter;
|
|
48678
48672
|
}
|
|
48679
|
-
if (
|
|
48673
|
+
if (props.collectionidprops != null && props.collectionidprops != undefined && props.collectionidprops != 'all') {
|
|
48680
48674
|
var arrafterfilter = [];
|
|
48681
48675
|
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48682
48676
|
if (parentcolitem.categoryid == props.collectionidprops) {
|
|
@@ -48685,46 +48679,62 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48685
48679
|
});
|
|
48686
48680
|
parentcollections = arrafterfilter;
|
|
48687
48681
|
}
|
|
48688
|
-
cardobjassigner(parentcollections);
|
|
48689
48682
|
}
|
|
48683
|
+
if (fetchingtype == 'innercategories') {
|
|
48684
|
+
var arrafterfilter = [];
|
|
48685
|
+
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48686
|
+
if (parentcolitem.categoryid == props.collectionidprops) {
|
|
48687
|
+
arrafterfilter.push(parentcolitem);
|
|
48688
|
+
}
|
|
48689
|
+
});
|
|
48690
|
+
parentcollections = arrafterfilter;
|
|
48691
|
+
}
|
|
48692
|
+
cardobjassigner(parentcollections);
|
|
48693
|
+
// }
|
|
48690
48694
|
} else if (fetchingtype == 'innerparentcollections') {
|
|
48691
|
-
|
|
48692
|
-
|
|
48693
|
-
|
|
48694
|
-
var
|
|
48695
|
-
(
|
|
48696
|
-
|
|
48697
|
-
|
|
48698
|
-
|
|
48699
|
-
|
|
48695
|
+
var _categories2;
|
|
48696
|
+
var categories = [];
|
|
48697
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48698
|
+
var _fetchCategoriesQuery3;
|
|
48699
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery3 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery3 === void 0 || (_fetchCategoriesQuery3 = _fetchCategoriesQuery3.data) === null || _fetchCategoriesQuery3 === void 0 ? void 0 : _fetchCategoriesQuery3.categories;
|
|
48700
|
+
}
|
|
48701
|
+
// if (fetchAuthorizationQueryContext?.isSuccess) {
|
|
48702
|
+
// var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
|
|
48703
|
+
var collections = [];
|
|
48704
|
+
(_categories2 = categories) === null || _categories2 === void 0 || _categories2.forEach(function (catitem, catindex) {
|
|
48705
|
+
catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
|
|
48706
|
+
var _parentcolitem$collec;
|
|
48707
|
+
parentcolitem.categoryid = catitem.categoryid;
|
|
48708
|
+
parentcolitem === null || parentcolitem === void 0 || (_parentcolitem$collec = parentcolitem.collections) === null || _parentcolitem$collec === void 0 || _parentcolitem$collec.forEach(function (collitem, colindex) {
|
|
48709
|
+
if (collitem.isshowntocustomers == 1) {
|
|
48700
48710
|
collitem.parentcollectionid = parentcolitem.parentcollectionid;
|
|
48701
48711
|
collections.push(collitem);
|
|
48702
|
-
}
|
|
48712
|
+
}
|
|
48703
48713
|
});
|
|
48704
48714
|
});
|
|
48705
|
-
|
|
48706
|
-
|
|
48707
|
-
|
|
48708
|
-
|
|
48709
|
-
|
|
48710
|
-
|
|
48711
|
-
|
|
48712
|
-
|
|
48713
|
-
|
|
48714
|
-
});
|
|
48715
|
-
if (iscollexists == false) {
|
|
48716
|
-
collectionsafterfilter.push(colitem);
|
|
48715
|
+
});
|
|
48716
|
+
if (fetchingtype == 'innerparentcollections') {
|
|
48717
|
+
var collectionsafterfilter = [];
|
|
48718
|
+
collections.forEach(function (colitem, colindex) {
|
|
48719
|
+
if (colitem.parentcollectionid == props.collectionidprops) {
|
|
48720
|
+
var iscollexists = false;
|
|
48721
|
+
collectionsafterfilter.forEach(function (existcolitem) {
|
|
48722
|
+
if (colitem.collectionid == existcolitem.collectionid) {
|
|
48723
|
+
iscollexists = true;
|
|
48717
48724
|
}
|
|
48725
|
+
});
|
|
48726
|
+
if (iscollexists == false) {
|
|
48727
|
+
collectionsafterfilter.push(colitem);
|
|
48718
48728
|
}
|
|
48719
|
-
}
|
|
48720
|
-
|
|
48721
|
-
|
|
48722
|
-
cardobjassigner(collections);
|
|
48729
|
+
}
|
|
48730
|
+
});
|
|
48731
|
+
collections = collectionsafterfilter;
|
|
48723
48732
|
}
|
|
48733
|
+
cardobjassigner(collections);
|
|
48734
|
+
// }
|
|
48724
48735
|
}
|
|
48725
|
-
setFetchQueriesEngineContext(_objectSpread$1k({}, tempFetchQueriesEngineContext));
|
|
48726
48736
|
}
|
|
48727
|
-
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
48737
|
+
}, [fetchingtype, ProductsFetchingTypeSectionObj, fetchCategoriesQueryContext.isSuccess]);
|
|
48728
48738
|
React.useEffect(function () {
|
|
48729
48739
|
if (fetchingtype == 'products') {
|
|
48730
48740
|
if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
|
|
@@ -48743,7 +48753,7 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48743
48753
|
cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
|
|
48744
48754
|
}
|
|
48745
48755
|
}
|
|
48746
|
-
}, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess]);
|
|
48756
|
+
}, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess, fetchcollectionsQueryContext.data]);
|
|
48747
48757
|
React.useEffect(function () {
|
|
48748
48758
|
if (fetchingtype == 'vendors') {
|
|
48749
48759
|
if (FetchVendorsQuery.isSuccess) {
|
|
@@ -48757,14 +48767,6 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48757
48767
|
React.useEffect(function () {
|
|
48758
48768
|
favassigner();
|
|
48759
48769
|
}, [favoriteprojectscountContext]);
|
|
48760
|
-
React.useEffect(function () {
|
|
48761
|
-
if (sectionproperties.length != 0 && sectionproperties.maincontainerarrayofobjs != undefined) {
|
|
48762
|
-
var maincontainerarrayofobjsparsed = JSON.parse(sectionproperties.maincontainerarrayofobjs);
|
|
48763
|
-
if (Array.isArray(maincontainerarrayofobjsparsed)) {
|
|
48764
|
-
setmaincontainerarrayofobjs(_toConsumableArray__default["default"](maincontainerarrayofobjsparsed));
|
|
48765
|
-
}
|
|
48766
|
-
}
|
|
48767
|
-
}, [sectionproperties]);
|
|
48768
48770
|
var favassigner = function favassigner() {
|
|
48769
48771
|
if (fetchingtype == 'products') {
|
|
48770
48772
|
if (cardsarray.length != 0) {
|
|
@@ -48793,6 +48795,7 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48793
48795
|
image: ''
|
|
48794
48796
|
};
|
|
48795
48797
|
if (fetchingtype == 'products') {
|
|
48798
|
+
var _arrayItem$features3;
|
|
48796
48799
|
var itemquantity = 0;
|
|
48797
48800
|
if (langdetect == 'en') {
|
|
48798
48801
|
cardobj.name = arrayItem.productinfo.name_en;
|
|
@@ -48804,6 +48807,11 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48804
48807
|
} else {
|
|
48805
48808
|
cardobj.description = arrayItem.productinfo.description_ar;
|
|
48806
48809
|
}
|
|
48810
|
+
if (langdetect == 'en') {
|
|
48811
|
+
cardobj.shortdescription = arrayItem.short_description_en;
|
|
48812
|
+
} else {
|
|
48813
|
+
cardobj.shortdescription = arrayItem.short_description_ar;
|
|
48814
|
+
}
|
|
48807
48815
|
if (arrayItem.productinfo.hasvariants == 0) {
|
|
48808
48816
|
fetchcustomercartQueryContext.data.data.customercart.cartitems.forEach(function (cartitem, cartindex) {
|
|
48809
48817
|
if (cartitem.productid == arrayItem.productinfo.productid) {
|
|
@@ -48812,6 +48820,16 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48812
48820
|
});
|
|
48813
48821
|
}
|
|
48814
48822
|
cardobj.image = arrayItem.productinfo.productmainimage;
|
|
48823
|
+
cardobj.producttags = arrayItem.tags;
|
|
48824
|
+
if (langdetect == 'en') {
|
|
48825
|
+
var _arrayItem$features;
|
|
48826
|
+
cardobj.productfeature = arrayItem === null || arrayItem === void 0 || (_arrayItem$features = arrayItem.features) === null || _arrayItem$features === void 0 ? void 0 : _arrayItem$features.value_en;
|
|
48827
|
+
} else {
|
|
48828
|
+
var _arrayItem$features2;
|
|
48829
|
+
cardobj.productfeature = arrayItem === null || arrayItem === void 0 || (_arrayItem$features2 = arrayItem.features) === null || _arrayItem$features2 === void 0 ? void 0 : _arrayItem$features2.value_ar;
|
|
48830
|
+
}
|
|
48831
|
+
cardobj.productfeatureid = arrayItem === null || arrayItem === void 0 || (_arrayItem$features3 = arrayItem.features) === null || _arrayItem$features3 === void 0 ? void 0 : _arrayItem$features3.featureid;
|
|
48832
|
+
cardobj.productendpointurl = arrayItem.productinfo.productendpointurl;
|
|
48815
48833
|
cardobj.hassale = arrayItem.productinfo.hassale;
|
|
48816
48834
|
cardobj.productid = arrayItem.productinfo.productid;
|
|
48817
48835
|
cardobj.hasvariants = arrayItem.productinfo.hasvariants;
|
|
@@ -48821,13 +48839,24 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48821
48839
|
cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
|
|
48822
48840
|
cardobj.productimages = arrayItem.productinfo.productimages;
|
|
48823
48841
|
cardobj.quantity = itemquantity;
|
|
48842
|
+
// cardobj.currentquantity = currentquantity;
|
|
48824
48843
|
cardobj.timestamp = arrayItem.productinfo.timestamp;
|
|
48825
48844
|
cardobj.productquantity = arrayItem.productinfo.productquantity;
|
|
48845
|
+
cardobj.currentquantity = arrayItem.productinfo.currentquantity;
|
|
48826
48846
|
cardobj.quantavailtype = arrayItem.productinfo.quantavailtype;
|
|
48847
|
+
cardobj.isproducttobesold = arrayItem.productinfo.isproducttobesold;
|
|
48848
|
+
cardobj.measurmentunit = arrayItem.productinfo.measurmentunit;
|
|
48849
|
+
cardobj.prodaffpercentprofit = arrayItem.productinfo.prodaffpercentprofit;
|
|
48850
|
+
cardobj.productcashbackvalue = arrayItem.productinfo.productcashbackvalue;
|
|
48851
|
+
cardobj.product_phonenumber = arrayItem.productinfo.product_phonenumber;
|
|
48852
|
+
cardobj.productcanrate = arrayItem.productinfo.productcanrate;
|
|
48853
|
+
cardobj.sku = arrayItem.productinfo.sku;
|
|
48827
48854
|
if (langdetect == 'en') {
|
|
48828
|
-
|
|
48855
|
+
var _fetchAuthorizationQu;
|
|
48856
|
+
cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
|
|
48829
48857
|
} else {
|
|
48830
|
-
|
|
48858
|
+
var _fetchAuthorizationQu2;
|
|
48859
|
+
cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
|
|
48831
48860
|
}
|
|
48832
48861
|
if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
|
|
48833
48862
|
favoriteprojectscountContext.forEach(function (favitem, favindex) {
|
|
@@ -48838,6 +48867,7 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48838
48867
|
}
|
|
48839
48868
|
} else if (fetchingtype == 'collections' || fetchingtype == 'innerparentcollections') {
|
|
48840
48869
|
cardobj.collectionid = arrayItem.collectionid;
|
|
48870
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48841
48871
|
if (langdetect == 'en') {
|
|
48842
48872
|
cardobj.name = arrayItem.title_en;
|
|
48843
48873
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48846,8 +48876,11 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48846
48876
|
cardobj.description = arrayItem.description_ar;
|
|
48847
48877
|
}
|
|
48848
48878
|
cardobj.image = arrayItem.collectionlogo;
|
|
48879
|
+
cardobj.producttags = [];
|
|
48880
|
+
cardobj.productfeatures = [];
|
|
48849
48881
|
} else if (fetchingtype == 'categories') {
|
|
48850
48882
|
cardobj.collectionid = arrayItem.categoryid;
|
|
48883
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48851
48884
|
if (langdetect == 'en') {
|
|
48852
48885
|
cardobj.name = arrayItem.title_en;
|
|
48853
48886
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48856,8 +48889,11 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48856
48889
|
cardobj.description = arrayItem.description_ar;
|
|
48857
48890
|
}
|
|
48858
48891
|
cardobj.image = arrayItem.categorylogo;
|
|
48892
|
+
cardobj.producttags = [];
|
|
48893
|
+
cardobj.productfeatures = [];
|
|
48859
48894
|
} else if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
|
|
48860
48895
|
cardobj.collectionid = arrayItem.parentcollectionid;
|
|
48896
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48861
48897
|
if (langdetect == 'en') {
|
|
48862
48898
|
cardobj.name = arrayItem.title_en;
|
|
48863
48899
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48866,10 +48902,17 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48866
48902
|
cardobj.description = arrayItem.description_ar;
|
|
48867
48903
|
}
|
|
48868
48904
|
cardobj.image = arrayItem.parentcollectionlogo;
|
|
48869
|
-
|
|
48905
|
+
cardobj.producttags = [];
|
|
48906
|
+
cardobj.productfeatures = [];
|
|
48907
|
+
} else if (fetchingtype == 'custom') {
|
|
48908
|
+
cardobj.producttags = [];
|
|
48909
|
+
cardobj.productfeatures = [];
|
|
48910
|
+
} else if (fetchingtype == 'vendors') {
|
|
48870
48911
|
cardobj.name = arrayItem.vendorname;
|
|
48871
48912
|
cardobj.collectionid = arrayItem.vendorid;
|
|
48872
48913
|
cardobj.image = arrayItem.vendorlogourl;
|
|
48914
|
+
cardobj.producttags = [];
|
|
48915
|
+
cardobj.productfeatures = [];
|
|
48873
48916
|
}
|
|
48874
48917
|
temparray.push(cardobj);
|
|
48875
48918
|
});
|
package/dist/index.esm.js
CHANGED
|
@@ -48494,25 +48494,8 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48494
48494
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
48495
48495
|
ProductsFetchingTypeSectionObj = _useState10[0],
|
|
48496
48496
|
setProductsFetchingTypeSectionObj = _useState10[1];
|
|
48497
|
-
var
|
|
48498
|
-
_useState12 = _slicedToArray(_useState11, 2);
|
|
48499
|
-
_useState12[0];
|
|
48500
|
-
var setmaincontainerarrayofobjs = _useState12[1];
|
|
48501
|
-
// React.useEffect(() => {
|
|
48502
|
-
// if (inView) {
|
|
48503
|
-
// fetchProductsQuery.fetchNextPage();
|
|
48504
|
-
// }
|
|
48505
|
-
// }, [inView]);
|
|
48497
|
+
var fetchCategoriesQueryContext = props.actions.fetchCategoriesQueryContext;
|
|
48506
48498
|
useEffect(function () {
|
|
48507
|
-
var productfilerobjtemp = ProductFilterObjContext;
|
|
48508
|
-
if (props.filterparamsprops != undefined) {
|
|
48509
|
-
var filterpar = decodeURIComponent(props.filterparamsprops);
|
|
48510
|
-
var filterparsed = JSON.parse(filterpar);
|
|
48511
|
-
if (filterparsed != undefined) {
|
|
48512
|
-
productfilerobjtemp = filterparsed;
|
|
48513
|
-
setProductFilterObjContext(filterparsed);
|
|
48514
|
-
}
|
|
48515
|
-
}
|
|
48516
48499
|
StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
|
|
48517
48500
|
if (sectionitem.sectionid == props.sectionidprops) {
|
|
48518
48501
|
var secpropobj = {};
|
|
@@ -48535,6 +48518,8 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48535
48518
|
});
|
|
48536
48519
|
} else if (props.srcfromprops == 'InnerGroups' || props.srcfromprops == 'InnerCategory' || props.srcfromprops == 'InnerParentCollection') {
|
|
48537
48520
|
setfetchingtype(props.grouptypeprops);
|
|
48521
|
+
} else if (props.srcfromprops == 'Innervendor') {
|
|
48522
|
+
setfetchingtype('vendors');
|
|
48538
48523
|
} else {
|
|
48539
48524
|
setfetchingtype(sectionitem.fetchingtype);
|
|
48540
48525
|
setProductsFetchingTypeSectionObj({
|
|
@@ -48558,11 +48543,6 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48558
48543
|
if (fetchProductsQuery.isSuccess) {
|
|
48559
48544
|
var _fetchProductsQuery$d;
|
|
48560
48545
|
var allpagesarr = [];
|
|
48561
|
-
// fetchProductsQuery.data.pages.forEach((page) => {
|
|
48562
|
-
// page.data.products.forEach((productobj) => {
|
|
48563
|
-
// allpagesarr.push(productobj);
|
|
48564
|
-
// });
|
|
48565
|
-
// });
|
|
48566
48546
|
fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 || (_fetchProductsQuery$d = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d === void 0 || (_fetchProductsQuery$d = _fetchProductsQuery$d.products) === null || _fetchProductsQuery$d === void 0 || _fetchProductsQuery$d.forEach(function (item) {
|
|
48567
48547
|
allpagesarr.push(item);
|
|
48568
48548
|
});
|
|
@@ -48599,35 +48579,49 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48599
48579
|
tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
|
|
48600
48580
|
setProductFilterObjContext(_objectSpread$1k({}, tempfetchproductsfilerobjcontext));
|
|
48601
48581
|
}
|
|
48582
|
+
setFetchQueriesEngineContext(_objectSpread$1k({}, tempFetchQueriesEngineContext));
|
|
48583
|
+
}
|
|
48584
|
+
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
48585
|
+
useEffect(function () {
|
|
48586
|
+
if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
|
|
48602
48587
|
if (fetchingtype == 'categories') {
|
|
48603
|
-
|
|
48604
|
-
|
|
48605
|
-
|
|
48588
|
+
var categories = [];
|
|
48589
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48590
|
+
var _fetchCategoriesQuery;
|
|
48591
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery === void 0 || (_fetchCategoriesQuery = _fetchCategoriesQuery.data) === null || _fetchCategoriesQuery === void 0 ? void 0 : _fetchCategoriesQuery.categories;
|
|
48606
48592
|
}
|
|
48593
|
+
cardobjassigner(categories);
|
|
48607
48594
|
}
|
|
48608
48595
|
if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
|
|
48609
|
-
|
|
48610
|
-
|
|
48611
|
-
|
|
48612
|
-
var
|
|
48613
|
-
(
|
|
48614
|
-
|
|
48596
|
+
var _categories;
|
|
48597
|
+
var categories = [];
|
|
48598
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48599
|
+
var _fetchCategoriesQuery2;
|
|
48600
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery2 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery2 === void 0 || (_fetchCategoriesQuery2 = _fetchCategoriesQuery2.data) === null || _fetchCategoriesQuery2 === void 0 ? void 0 : _fetchCategoriesQuery2.categories;
|
|
48601
|
+
}
|
|
48602
|
+
// if (fetchAuthorizationQueryContext?.isSuccess) {
|
|
48603
|
+
// var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
|
|
48604
|
+
// alert(JSON.stringify(categories));
|
|
48605
|
+
var parentcollections = [];
|
|
48606
|
+
(_categories = categories) === null || _categories === void 0 || _categories.forEach(function (catitem, catindex) {
|
|
48607
|
+
catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
|
|
48608
|
+
if (parentcolitem.isshowntocustomers == 1) {
|
|
48615
48609
|
parentcolitem.categoryid = catitem.categoryid;
|
|
48616
48610
|
parentcollections.push(parentcolitem);
|
|
48617
|
-
});
|
|
48618
|
-
});
|
|
48619
|
-
if (fetchingtype == 'parentcollections') {
|
|
48620
|
-
if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
|
|
48621
|
-
var arrafterfilter = [];
|
|
48622
|
-
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48623
|
-
if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
|
|
48624
|
-
arrafterfilter.push(parentcolitem);
|
|
48625
|
-
}
|
|
48626
|
-
});
|
|
48627
|
-
parentcollections = arrafterfilter;
|
|
48628
48611
|
}
|
|
48612
|
+
});
|
|
48613
|
+
});
|
|
48614
|
+
if (fetchingtype == 'parentcollections') {
|
|
48615
|
+
if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
|
|
48616
|
+
var arrafterfilter = [];
|
|
48617
|
+
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48618
|
+
if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
|
|
48619
|
+
arrafterfilter.push(parentcolitem);
|
|
48620
|
+
}
|
|
48621
|
+
});
|
|
48622
|
+
parentcollections = arrafterfilter;
|
|
48629
48623
|
}
|
|
48630
|
-
if (
|
|
48624
|
+
if (props.collectionidprops != null && props.collectionidprops != undefined && props.collectionidprops != 'all') {
|
|
48631
48625
|
var arrafterfilter = [];
|
|
48632
48626
|
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48633
48627
|
if (parentcolitem.categoryid == props.collectionidprops) {
|
|
@@ -48636,46 +48630,62 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48636
48630
|
});
|
|
48637
48631
|
parentcollections = arrafterfilter;
|
|
48638
48632
|
}
|
|
48639
|
-
cardobjassigner(parentcollections);
|
|
48640
48633
|
}
|
|
48634
|
+
if (fetchingtype == 'innercategories') {
|
|
48635
|
+
var arrafterfilter = [];
|
|
48636
|
+
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48637
|
+
if (parentcolitem.categoryid == props.collectionidprops) {
|
|
48638
|
+
arrafterfilter.push(parentcolitem);
|
|
48639
|
+
}
|
|
48640
|
+
});
|
|
48641
|
+
parentcollections = arrafterfilter;
|
|
48642
|
+
}
|
|
48643
|
+
cardobjassigner(parentcollections);
|
|
48644
|
+
// }
|
|
48641
48645
|
} else if (fetchingtype == 'innerparentcollections') {
|
|
48642
|
-
|
|
48643
|
-
|
|
48644
|
-
|
|
48645
|
-
var
|
|
48646
|
-
(
|
|
48647
|
-
|
|
48648
|
-
|
|
48649
|
-
|
|
48650
|
-
|
|
48646
|
+
var _categories2;
|
|
48647
|
+
var categories = [];
|
|
48648
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48649
|
+
var _fetchCategoriesQuery3;
|
|
48650
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery3 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery3 === void 0 || (_fetchCategoriesQuery3 = _fetchCategoriesQuery3.data) === null || _fetchCategoriesQuery3 === void 0 ? void 0 : _fetchCategoriesQuery3.categories;
|
|
48651
|
+
}
|
|
48652
|
+
// if (fetchAuthorizationQueryContext?.isSuccess) {
|
|
48653
|
+
// var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
|
|
48654
|
+
var collections = [];
|
|
48655
|
+
(_categories2 = categories) === null || _categories2 === void 0 || _categories2.forEach(function (catitem, catindex) {
|
|
48656
|
+
catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
|
|
48657
|
+
var _parentcolitem$collec;
|
|
48658
|
+
parentcolitem.categoryid = catitem.categoryid;
|
|
48659
|
+
parentcolitem === null || parentcolitem === void 0 || (_parentcolitem$collec = parentcolitem.collections) === null || _parentcolitem$collec === void 0 || _parentcolitem$collec.forEach(function (collitem, colindex) {
|
|
48660
|
+
if (collitem.isshowntocustomers == 1) {
|
|
48651
48661
|
collitem.parentcollectionid = parentcolitem.parentcollectionid;
|
|
48652
48662
|
collections.push(collitem);
|
|
48653
|
-
}
|
|
48663
|
+
}
|
|
48654
48664
|
});
|
|
48655
48665
|
});
|
|
48656
|
-
|
|
48657
|
-
|
|
48658
|
-
|
|
48659
|
-
|
|
48660
|
-
|
|
48661
|
-
|
|
48662
|
-
|
|
48663
|
-
|
|
48664
|
-
|
|
48665
|
-
});
|
|
48666
|
-
if (iscollexists == false) {
|
|
48667
|
-
collectionsafterfilter.push(colitem);
|
|
48666
|
+
});
|
|
48667
|
+
if (fetchingtype == 'innerparentcollections') {
|
|
48668
|
+
var collectionsafterfilter = [];
|
|
48669
|
+
collections.forEach(function (colitem, colindex) {
|
|
48670
|
+
if (colitem.parentcollectionid == props.collectionidprops) {
|
|
48671
|
+
var iscollexists = false;
|
|
48672
|
+
collectionsafterfilter.forEach(function (existcolitem) {
|
|
48673
|
+
if (colitem.collectionid == existcolitem.collectionid) {
|
|
48674
|
+
iscollexists = true;
|
|
48668
48675
|
}
|
|
48676
|
+
});
|
|
48677
|
+
if (iscollexists == false) {
|
|
48678
|
+
collectionsafterfilter.push(colitem);
|
|
48669
48679
|
}
|
|
48670
|
-
}
|
|
48671
|
-
|
|
48672
|
-
|
|
48673
|
-
cardobjassigner(collections);
|
|
48680
|
+
}
|
|
48681
|
+
});
|
|
48682
|
+
collections = collectionsafterfilter;
|
|
48674
48683
|
}
|
|
48684
|
+
cardobjassigner(collections);
|
|
48685
|
+
// }
|
|
48675
48686
|
}
|
|
48676
|
-
setFetchQueriesEngineContext(_objectSpread$1k({}, tempFetchQueriesEngineContext));
|
|
48677
48687
|
}
|
|
48678
|
-
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
48688
|
+
}, [fetchingtype, ProductsFetchingTypeSectionObj, fetchCategoriesQueryContext.isSuccess]);
|
|
48679
48689
|
useEffect(function () {
|
|
48680
48690
|
if (fetchingtype == 'products') {
|
|
48681
48691
|
if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
|
|
@@ -48694,7 +48704,7 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48694
48704
|
cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
|
|
48695
48705
|
}
|
|
48696
48706
|
}
|
|
48697
|
-
}, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess]);
|
|
48707
|
+
}, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess, fetchcollectionsQueryContext.data]);
|
|
48698
48708
|
useEffect(function () {
|
|
48699
48709
|
if (fetchingtype == 'vendors') {
|
|
48700
48710
|
if (FetchVendorsQuery.isSuccess) {
|
|
@@ -48708,14 +48718,6 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48708
48718
|
useEffect(function () {
|
|
48709
48719
|
favassigner();
|
|
48710
48720
|
}, [favoriteprojectscountContext]);
|
|
48711
|
-
useEffect(function () {
|
|
48712
|
-
if (sectionproperties.length != 0 && sectionproperties.maincontainerarrayofobjs != undefined) {
|
|
48713
|
-
var maincontainerarrayofobjsparsed = JSON.parse(sectionproperties.maincontainerarrayofobjs);
|
|
48714
|
-
if (Array.isArray(maincontainerarrayofobjsparsed)) {
|
|
48715
|
-
setmaincontainerarrayofobjs(_toConsumableArray(maincontainerarrayofobjsparsed));
|
|
48716
|
-
}
|
|
48717
|
-
}
|
|
48718
|
-
}, [sectionproperties]);
|
|
48719
48721
|
var favassigner = function favassigner() {
|
|
48720
48722
|
if (fetchingtype == 'products') {
|
|
48721
48723
|
if (cardsarray.length != 0) {
|
|
@@ -48744,6 +48746,7 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48744
48746
|
image: ''
|
|
48745
48747
|
};
|
|
48746
48748
|
if (fetchingtype == 'products') {
|
|
48749
|
+
var _arrayItem$features3;
|
|
48747
48750
|
var itemquantity = 0;
|
|
48748
48751
|
if (langdetect == 'en') {
|
|
48749
48752
|
cardobj.name = arrayItem.productinfo.name_en;
|
|
@@ -48755,6 +48758,11 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48755
48758
|
} else {
|
|
48756
48759
|
cardobj.description = arrayItem.productinfo.description_ar;
|
|
48757
48760
|
}
|
|
48761
|
+
if (langdetect == 'en') {
|
|
48762
|
+
cardobj.shortdescription = arrayItem.short_description_en;
|
|
48763
|
+
} else {
|
|
48764
|
+
cardobj.shortdescription = arrayItem.short_description_ar;
|
|
48765
|
+
}
|
|
48758
48766
|
if (arrayItem.productinfo.hasvariants == 0) {
|
|
48759
48767
|
fetchcustomercartQueryContext.data.data.customercart.cartitems.forEach(function (cartitem, cartindex) {
|
|
48760
48768
|
if (cartitem.productid == arrayItem.productinfo.productid) {
|
|
@@ -48763,6 +48771,16 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48763
48771
|
});
|
|
48764
48772
|
}
|
|
48765
48773
|
cardobj.image = arrayItem.productinfo.productmainimage;
|
|
48774
|
+
cardobj.producttags = arrayItem.tags;
|
|
48775
|
+
if (langdetect == 'en') {
|
|
48776
|
+
var _arrayItem$features;
|
|
48777
|
+
cardobj.productfeature = arrayItem === null || arrayItem === void 0 || (_arrayItem$features = arrayItem.features) === null || _arrayItem$features === void 0 ? void 0 : _arrayItem$features.value_en;
|
|
48778
|
+
} else {
|
|
48779
|
+
var _arrayItem$features2;
|
|
48780
|
+
cardobj.productfeature = arrayItem === null || arrayItem === void 0 || (_arrayItem$features2 = arrayItem.features) === null || _arrayItem$features2 === void 0 ? void 0 : _arrayItem$features2.value_ar;
|
|
48781
|
+
}
|
|
48782
|
+
cardobj.productfeatureid = arrayItem === null || arrayItem === void 0 || (_arrayItem$features3 = arrayItem.features) === null || _arrayItem$features3 === void 0 ? void 0 : _arrayItem$features3.featureid;
|
|
48783
|
+
cardobj.productendpointurl = arrayItem.productinfo.productendpointurl;
|
|
48766
48784
|
cardobj.hassale = arrayItem.productinfo.hassale;
|
|
48767
48785
|
cardobj.productid = arrayItem.productinfo.productid;
|
|
48768
48786
|
cardobj.hasvariants = arrayItem.productinfo.hasvariants;
|
|
@@ -48772,13 +48790,24 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48772
48790
|
cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
|
|
48773
48791
|
cardobj.productimages = arrayItem.productinfo.productimages;
|
|
48774
48792
|
cardobj.quantity = itemquantity;
|
|
48793
|
+
// cardobj.currentquantity = currentquantity;
|
|
48775
48794
|
cardobj.timestamp = arrayItem.productinfo.timestamp;
|
|
48776
48795
|
cardobj.productquantity = arrayItem.productinfo.productquantity;
|
|
48796
|
+
cardobj.currentquantity = arrayItem.productinfo.currentquantity;
|
|
48777
48797
|
cardobj.quantavailtype = arrayItem.productinfo.quantavailtype;
|
|
48798
|
+
cardobj.isproducttobesold = arrayItem.productinfo.isproducttobesold;
|
|
48799
|
+
cardobj.measurmentunit = arrayItem.productinfo.measurmentunit;
|
|
48800
|
+
cardobj.prodaffpercentprofit = arrayItem.productinfo.prodaffpercentprofit;
|
|
48801
|
+
cardobj.productcashbackvalue = arrayItem.productinfo.productcashbackvalue;
|
|
48802
|
+
cardobj.product_phonenumber = arrayItem.productinfo.product_phonenumber;
|
|
48803
|
+
cardobj.productcanrate = arrayItem.productinfo.productcanrate;
|
|
48804
|
+
cardobj.sku = arrayItem.productinfo.sku;
|
|
48778
48805
|
if (langdetect == 'en') {
|
|
48779
|
-
|
|
48806
|
+
var _fetchAuthorizationQu;
|
|
48807
|
+
cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
|
|
48780
48808
|
} else {
|
|
48781
|
-
|
|
48809
|
+
var _fetchAuthorizationQu2;
|
|
48810
|
+
cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
|
|
48782
48811
|
}
|
|
48783
48812
|
if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
|
|
48784
48813
|
favoriteprojectscountContext.forEach(function (favitem, favindex) {
|
|
@@ -48789,6 +48818,7 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48789
48818
|
}
|
|
48790
48819
|
} else if (fetchingtype == 'collections' || fetchingtype == 'innerparentcollections') {
|
|
48791
48820
|
cardobj.collectionid = arrayItem.collectionid;
|
|
48821
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48792
48822
|
if (langdetect == 'en') {
|
|
48793
48823
|
cardobj.name = arrayItem.title_en;
|
|
48794
48824
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48797,8 +48827,11 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48797
48827
|
cardobj.description = arrayItem.description_ar;
|
|
48798
48828
|
}
|
|
48799
48829
|
cardobj.image = arrayItem.collectionlogo;
|
|
48830
|
+
cardobj.producttags = [];
|
|
48831
|
+
cardobj.productfeatures = [];
|
|
48800
48832
|
} else if (fetchingtype == 'categories') {
|
|
48801
48833
|
cardobj.collectionid = arrayItem.categoryid;
|
|
48834
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48802
48835
|
if (langdetect == 'en') {
|
|
48803
48836
|
cardobj.name = arrayItem.title_en;
|
|
48804
48837
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48807,8 +48840,11 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48807
48840
|
cardobj.description = arrayItem.description_ar;
|
|
48808
48841
|
}
|
|
48809
48842
|
cardobj.image = arrayItem.categorylogo;
|
|
48843
|
+
cardobj.producttags = [];
|
|
48844
|
+
cardobj.productfeatures = [];
|
|
48810
48845
|
} else if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
|
|
48811
48846
|
cardobj.collectionid = arrayItem.parentcollectionid;
|
|
48847
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48812
48848
|
if (langdetect == 'en') {
|
|
48813
48849
|
cardobj.name = arrayItem.title_en;
|
|
48814
48850
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48817,10 +48853,17 @@ var RandomlyStructuredCollectionCards = function RandomlyStructuredCollectionCar
|
|
|
48817
48853
|
cardobj.description = arrayItem.description_ar;
|
|
48818
48854
|
}
|
|
48819
48855
|
cardobj.image = arrayItem.parentcollectionlogo;
|
|
48820
|
-
|
|
48856
|
+
cardobj.producttags = [];
|
|
48857
|
+
cardobj.productfeatures = [];
|
|
48858
|
+
} else if (fetchingtype == 'custom') {
|
|
48859
|
+
cardobj.producttags = [];
|
|
48860
|
+
cardobj.productfeatures = [];
|
|
48861
|
+
} else if (fetchingtype == 'vendors') {
|
|
48821
48862
|
cardobj.name = arrayItem.vendorname;
|
|
48822
48863
|
cardobj.collectionid = arrayItem.vendorid;
|
|
48823
48864
|
cardobj.image = arrayItem.vendorlogourl;
|
|
48865
|
+
cardobj.producttags = [];
|
|
48866
|
+
cardobj.productfeatures = [];
|
|
48824
48867
|
}
|
|
48825
48868
|
temparray.push(cardobj);
|
|
48826
48869
|
});
|
package/dist/index.umd.js
CHANGED
|
@@ -48369,25 +48369,8 @@
|
|
|
48369
48369
|
_useState10 = _slicedToArray__default["default"](_useState9, 2),
|
|
48370
48370
|
ProductsFetchingTypeSectionObj = _useState10[0],
|
|
48371
48371
|
setProductsFetchingTypeSectionObj = _useState10[1];
|
|
48372
|
-
var
|
|
48373
|
-
_useState12 = _slicedToArray__default["default"](_useState11, 2);
|
|
48374
|
-
_useState12[0];
|
|
48375
|
-
var setmaincontainerarrayofobjs = _useState12[1];
|
|
48376
|
-
// React.useEffect(() => {
|
|
48377
|
-
// if (inView) {
|
|
48378
|
-
// fetchProductsQuery.fetchNextPage();
|
|
48379
|
-
// }
|
|
48380
|
-
// }, [inView]);
|
|
48372
|
+
var fetchCategoriesQueryContext = props.actions.fetchCategoriesQueryContext;
|
|
48381
48373
|
React.useEffect(function () {
|
|
48382
|
-
var productfilerobjtemp = ProductFilterObjContext;
|
|
48383
|
-
if (props.filterparamsprops != undefined) {
|
|
48384
|
-
var filterpar = decodeURIComponent(props.filterparamsprops);
|
|
48385
|
-
var filterparsed = JSON.parse(filterpar);
|
|
48386
|
-
if (filterparsed != undefined) {
|
|
48387
|
-
productfilerobjtemp = filterparsed;
|
|
48388
|
-
setProductFilterObjContext(filterparsed);
|
|
48389
|
-
}
|
|
48390
|
-
}
|
|
48391
48374
|
StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
|
|
48392
48375
|
if (sectionitem.sectionid == props.sectionidprops) {
|
|
48393
48376
|
var secpropobj = {};
|
|
@@ -48410,6 +48393,8 @@
|
|
|
48410
48393
|
});
|
|
48411
48394
|
} else if (props.srcfromprops == 'InnerGroups' || props.srcfromprops == 'InnerCategory' || props.srcfromprops == 'InnerParentCollection') {
|
|
48412
48395
|
setfetchingtype(props.grouptypeprops);
|
|
48396
|
+
} else if (props.srcfromprops == 'Innervendor') {
|
|
48397
|
+
setfetchingtype('vendors');
|
|
48413
48398
|
} else {
|
|
48414
48399
|
setfetchingtype(sectionitem.fetchingtype);
|
|
48415
48400
|
setProductsFetchingTypeSectionObj({
|
|
@@ -48433,11 +48418,6 @@
|
|
|
48433
48418
|
if (fetchProductsQuery.isSuccess) {
|
|
48434
48419
|
var _fetchProductsQuery$d;
|
|
48435
48420
|
var allpagesarr = [];
|
|
48436
|
-
// fetchProductsQuery.data.pages.forEach((page) => {
|
|
48437
|
-
// page.data.products.forEach((productobj) => {
|
|
48438
|
-
// allpagesarr.push(productobj);
|
|
48439
|
-
// });
|
|
48440
|
-
// });
|
|
48441
48421
|
fetchProductsQuery === null || fetchProductsQuery === void 0 || (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 || (_fetchProductsQuery$d = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d === void 0 || (_fetchProductsQuery$d = _fetchProductsQuery$d.products) === null || _fetchProductsQuery$d === void 0 || _fetchProductsQuery$d.forEach(function (item) {
|
|
48442
48422
|
allpagesarr.push(item);
|
|
48443
48423
|
});
|
|
@@ -48474,35 +48454,49 @@
|
|
|
48474
48454
|
tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
|
|
48475
48455
|
setProductFilterObjContext(_objectSpread$1k({}, tempfetchproductsfilerobjcontext));
|
|
48476
48456
|
}
|
|
48457
|
+
setFetchQueriesEngineContext(_objectSpread$1k({}, tempFetchQueriesEngineContext));
|
|
48458
|
+
}
|
|
48459
|
+
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
48460
|
+
React.useEffect(function () {
|
|
48461
|
+
if ((fetchingtype === null || fetchingtype === void 0 ? void 0 : fetchingtype.length) != 0) {
|
|
48477
48462
|
if (fetchingtype == 'categories') {
|
|
48478
|
-
|
|
48479
|
-
|
|
48480
|
-
|
|
48463
|
+
var categories = [];
|
|
48464
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48465
|
+
var _fetchCategoriesQuery;
|
|
48466
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery === void 0 || (_fetchCategoriesQuery = _fetchCategoriesQuery.data) === null || _fetchCategoriesQuery === void 0 ? void 0 : _fetchCategoriesQuery.categories;
|
|
48481
48467
|
}
|
|
48468
|
+
cardobjassigner(categories);
|
|
48482
48469
|
}
|
|
48483
48470
|
if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
|
|
48484
|
-
|
|
48485
|
-
|
|
48486
|
-
|
|
48487
|
-
var
|
|
48488
|
-
(
|
|
48489
|
-
|
|
48471
|
+
var _categories;
|
|
48472
|
+
var categories = [];
|
|
48473
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48474
|
+
var _fetchCategoriesQuery2;
|
|
48475
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery2 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery2 === void 0 || (_fetchCategoriesQuery2 = _fetchCategoriesQuery2.data) === null || _fetchCategoriesQuery2 === void 0 ? void 0 : _fetchCategoriesQuery2.categories;
|
|
48476
|
+
}
|
|
48477
|
+
// if (fetchAuthorizationQueryContext?.isSuccess) {
|
|
48478
|
+
// var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
|
|
48479
|
+
// alert(JSON.stringify(categories));
|
|
48480
|
+
var parentcollections = [];
|
|
48481
|
+
(_categories = categories) === null || _categories === void 0 || _categories.forEach(function (catitem, catindex) {
|
|
48482
|
+
catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
|
|
48483
|
+
if (parentcolitem.isshowntocustomers == 1) {
|
|
48490
48484
|
parentcolitem.categoryid = catitem.categoryid;
|
|
48491
48485
|
parentcollections.push(parentcolitem);
|
|
48492
|
-
});
|
|
48493
|
-
});
|
|
48494
|
-
if (fetchingtype == 'parentcollections') {
|
|
48495
|
-
if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
|
|
48496
|
-
var arrafterfilter = [];
|
|
48497
|
-
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48498
|
-
if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
|
|
48499
|
-
arrafterfilter.push(parentcolitem);
|
|
48500
|
-
}
|
|
48501
|
-
});
|
|
48502
|
-
parentcollections = arrafterfilter;
|
|
48503
48486
|
}
|
|
48487
|
+
});
|
|
48488
|
+
});
|
|
48489
|
+
if (fetchingtype == 'parentcollections') {
|
|
48490
|
+
if ((sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != null && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != undefined && (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid) != 'all') {
|
|
48491
|
+
var arrafterfilter = [];
|
|
48492
|
+
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48493
|
+
if (parentcolitem.categoryid == (sectionitem === null || sectionitem === void 0 ? void 0 : sectionitem.productsfetchingtypeparentcollectioncategoryid)) {
|
|
48494
|
+
arrafterfilter.push(parentcolitem);
|
|
48495
|
+
}
|
|
48496
|
+
});
|
|
48497
|
+
parentcollections = arrafterfilter;
|
|
48504
48498
|
}
|
|
48505
|
-
if (
|
|
48499
|
+
if (props.collectionidprops != null && props.collectionidprops != undefined && props.collectionidprops != 'all') {
|
|
48506
48500
|
var arrafterfilter = [];
|
|
48507
48501
|
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48508
48502
|
if (parentcolitem.categoryid == props.collectionidprops) {
|
|
@@ -48511,46 +48505,62 @@
|
|
|
48511
48505
|
});
|
|
48512
48506
|
parentcollections = arrafterfilter;
|
|
48513
48507
|
}
|
|
48514
|
-
cardobjassigner(parentcollections);
|
|
48515
48508
|
}
|
|
48509
|
+
if (fetchingtype == 'innercategories') {
|
|
48510
|
+
var arrafterfilter = [];
|
|
48511
|
+
parentcollections.forEach(function (parentcolitem, parcolindex) {
|
|
48512
|
+
if (parentcolitem.categoryid == props.collectionidprops) {
|
|
48513
|
+
arrafterfilter.push(parentcolitem);
|
|
48514
|
+
}
|
|
48515
|
+
});
|
|
48516
|
+
parentcollections = arrafterfilter;
|
|
48517
|
+
}
|
|
48518
|
+
cardobjassigner(parentcollections);
|
|
48519
|
+
// }
|
|
48516
48520
|
} else if (fetchingtype == 'innerparentcollections') {
|
|
48517
|
-
|
|
48518
|
-
|
|
48519
|
-
|
|
48520
|
-
var
|
|
48521
|
-
(
|
|
48522
|
-
|
|
48523
|
-
|
|
48524
|
-
|
|
48525
|
-
|
|
48521
|
+
var _categories2;
|
|
48522
|
+
var categories = [];
|
|
48523
|
+
if (fetchCategoriesQueryContext !== null && fetchCategoriesQueryContext !== void 0 && fetchCategoriesQueryContext.isSuccess) {
|
|
48524
|
+
var _fetchCategoriesQuery3;
|
|
48525
|
+
categories = fetchCategoriesQueryContext === null || fetchCategoriesQueryContext === void 0 || (_fetchCategoriesQuery3 = fetchCategoriesQueryContext.data) === null || _fetchCategoriesQuery3 === void 0 || (_fetchCategoriesQuery3 = _fetchCategoriesQuery3.data) === null || _fetchCategoriesQuery3 === void 0 ? void 0 : _fetchCategoriesQuery3.categories;
|
|
48526
|
+
}
|
|
48527
|
+
// if (fetchAuthorizationQueryContext?.isSuccess) {
|
|
48528
|
+
// var categories = fetchAuthorizationQueryContext.data.data.instinfo.instcategories;
|
|
48529
|
+
var collections = [];
|
|
48530
|
+
(_categories2 = categories) === null || _categories2 === void 0 || _categories2.forEach(function (catitem, catindex) {
|
|
48531
|
+
catitem === null || catitem === void 0 || catitem.parentcolletions.forEach(function (parentcolitem) {
|
|
48532
|
+
var _parentcolitem$collec;
|
|
48533
|
+
parentcolitem.categoryid = catitem.categoryid;
|
|
48534
|
+
parentcolitem === null || parentcolitem === void 0 || (_parentcolitem$collec = parentcolitem.collections) === null || _parentcolitem$collec === void 0 || _parentcolitem$collec.forEach(function (collitem, colindex) {
|
|
48535
|
+
if (collitem.isshowntocustomers == 1) {
|
|
48526
48536
|
collitem.parentcollectionid = parentcolitem.parentcollectionid;
|
|
48527
48537
|
collections.push(collitem);
|
|
48528
|
-
}
|
|
48538
|
+
}
|
|
48529
48539
|
});
|
|
48530
48540
|
});
|
|
48531
|
-
|
|
48532
|
-
|
|
48533
|
-
|
|
48534
|
-
|
|
48535
|
-
|
|
48536
|
-
|
|
48537
|
-
|
|
48538
|
-
|
|
48539
|
-
|
|
48540
|
-
});
|
|
48541
|
-
if (iscollexists == false) {
|
|
48542
|
-
collectionsafterfilter.push(colitem);
|
|
48541
|
+
});
|
|
48542
|
+
if (fetchingtype == 'innerparentcollections') {
|
|
48543
|
+
var collectionsafterfilter = [];
|
|
48544
|
+
collections.forEach(function (colitem, colindex) {
|
|
48545
|
+
if (colitem.parentcollectionid == props.collectionidprops) {
|
|
48546
|
+
var iscollexists = false;
|
|
48547
|
+
collectionsafterfilter.forEach(function (existcolitem) {
|
|
48548
|
+
if (colitem.collectionid == existcolitem.collectionid) {
|
|
48549
|
+
iscollexists = true;
|
|
48543
48550
|
}
|
|
48551
|
+
});
|
|
48552
|
+
if (iscollexists == false) {
|
|
48553
|
+
collectionsafterfilter.push(colitem);
|
|
48544
48554
|
}
|
|
48545
|
-
}
|
|
48546
|
-
|
|
48547
|
-
|
|
48548
|
-
cardobjassigner(collections);
|
|
48555
|
+
}
|
|
48556
|
+
});
|
|
48557
|
+
collections = collectionsafterfilter;
|
|
48549
48558
|
}
|
|
48559
|
+
cardobjassigner(collections);
|
|
48560
|
+
// }
|
|
48550
48561
|
}
|
|
48551
|
-
setFetchQueriesEngineContext(_objectSpread$1k({}, tempFetchQueriesEngineContext));
|
|
48552
48562
|
}
|
|
48553
|
-
}, [fetchingtype, ProductsFetchingTypeSectionObj]);
|
|
48563
|
+
}, [fetchingtype, ProductsFetchingTypeSectionObj, fetchCategoriesQueryContext.isSuccess]);
|
|
48554
48564
|
React.useEffect(function () {
|
|
48555
48565
|
if (fetchingtype == 'products') {
|
|
48556
48566
|
if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
|
|
@@ -48569,7 +48579,7 @@
|
|
|
48569
48579
|
cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
|
|
48570
48580
|
}
|
|
48571
48581
|
}
|
|
48572
|
-
}, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess]);
|
|
48582
|
+
}, [fetchcollectionsQueryContext === null || fetchcollectionsQueryContext === void 0 ? void 0 : fetchcollectionsQueryContext.isSuccess, fetchcollectionsQueryContext.data]);
|
|
48573
48583
|
React.useEffect(function () {
|
|
48574
48584
|
if (fetchingtype == 'vendors') {
|
|
48575
48585
|
if (FetchVendorsQuery.isSuccess) {
|
|
@@ -48583,14 +48593,6 @@
|
|
|
48583
48593
|
React.useEffect(function () {
|
|
48584
48594
|
favassigner();
|
|
48585
48595
|
}, [favoriteprojectscountContext]);
|
|
48586
|
-
React.useEffect(function () {
|
|
48587
|
-
if (sectionproperties.length != 0 && sectionproperties.maincontainerarrayofobjs != undefined) {
|
|
48588
|
-
var maincontainerarrayofobjsparsed = JSON.parse(sectionproperties.maincontainerarrayofobjs);
|
|
48589
|
-
if (Array.isArray(maincontainerarrayofobjsparsed)) {
|
|
48590
|
-
setmaincontainerarrayofobjs(_toConsumableArray__default["default"](maincontainerarrayofobjsparsed));
|
|
48591
|
-
}
|
|
48592
|
-
}
|
|
48593
|
-
}, [sectionproperties]);
|
|
48594
48596
|
var favassigner = function favassigner() {
|
|
48595
48597
|
if (fetchingtype == 'products') {
|
|
48596
48598
|
if (cardsarray.length != 0) {
|
|
@@ -48619,6 +48621,7 @@
|
|
|
48619
48621
|
image: ''
|
|
48620
48622
|
};
|
|
48621
48623
|
if (fetchingtype == 'products') {
|
|
48624
|
+
var _arrayItem$features3;
|
|
48622
48625
|
var itemquantity = 0;
|
|
48623
48626
|
if (langdetect == 'en') {
|
|
48624
48627
|
cardobj.name = arrayItem.productinfo.name_en;
|
|
@@ -48630,6 +48633,11 @@
|
|
|
48630
48633
|
} else {
|
|
48631
48634
|
cardobj.description = arrayItem.productinfo.description_ar;
|
|
48632
48635
|
}
|
|
48636
|
+
if (langdetect == 'en') {
|
|
48637
|
+
cardobj.shortdescription = arrayItem.short_description_en;
|
|
48638
|
+
} else {
|
|
48639
|
+
cardobj.shortdescription = arrayItem.short_description_ar;
|
|
48640
|
+
}
|
|
48633
48641
|
if (arrayItem.productinfo.hasvariants == 0) {
|
|
48634
48642
|
fetchcustomercartQueryContext.data.data.customercart.cartitems.forEach(function (cartitem, cartindex) {
|
|
48635
48643
|
if (cartitem.productid == arrayItem.productinfo.productid) {
|
|
@@ -48638,6 +48646,16 @@
|
|
|
48638
48646
|
});
|
|
48639
48647
|
}
|
|
48640
48648
|
cardobj.image = arrayItem.productinfo.productmainimage;
|
|
48649
|
+
cardobj.producttags = arrayItem.tags;
|
|
48650
|
+
if (langdetect == 'en') {
|
|
48651
|
+
var _arrayItem$features;
|
|
48652
|
+
cardobj.productfeature = arrayItem === null || arrayItem === void 0 || (_arrayItem$features = arrayItem.features) === null || _arrayItem$features === void 0 ? void 0 : _arrayItem$features.value_en;
|
|
48653
|
+
} else {
|
|
48654
|
+
var _arrayItem$features2;
|
|
48655
|
+
cardobj.productfeature = arrayItem === null || arrayItem === void 0 || (_arrayItem$features2 = arrayItem.features) === null || _arrayItem$features2 === void 0 ? void 0 : _arrayItem$features2.value_ar;
|
|
48656
|
+
}
|
|
48657
|
+
cardobj.productfeatureid = arrayItem === null || arrayItem === void 0 || (_arrayItem$features3 = arrayItem.features) === null || _arrayItem$features3 === void 0 ? void 0 : _arrayItem$features3.featureid;
|
|
48658
|
+
cardobj.productendpointurl = arrayItem.productinfo.productendpointurl;
|
|
48641
48659
|
cardobj.hassale = arrayItem.productinfo.hassale;
|
|
48642
48660
|
cardobj.productid = arrayItem.productinfo.productid;
|
|
48643
48661
|
cardobj.hasvariants = arrayItem.productinfo.hasvariants;
|
|
@@ -48647,13 +48665,24 @@
|
|
|
48647
48665
|
cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
|
|
48648
48666
|
cardobj.productimages = arrayItem.productinfo.productimages;
|
|
48649
48667
|
cardobj.quantity = itemquantity;
|
|
48668
|
+
// cardobj.currentquantity = currentquantity;
|
|
48650
48669
|
cardobj.timestamp = arrayItem.productinfo.timestamp;
|
|
48651
48670
|
cardobj.productquantity = arrayItem.productinfo.productquantity;
|
|
48671
|
+
cardobj.currentquantity = arrayItem.productinfo.currentquantity;
|
|
48652
48672
|
cardobj.quantavailtype = arrayItem.productinfo.quantavailtype;
|
|
48673
|
+
cardobj.isproducttobesold = arrayItem.productinfo.isproducttobesold;
|
|
48674
|
+
cardobj.measurmentunit = arrayItem.productinfo.measurmentunit;
|
|
48675
|
+
cardobj.prodaffpercentprofit = arrayItem.productinfo.prodaffpercentprofit;
|
|
48676
|
+
cardobj.productcashbackvalue = arrayItem.productinfo.productcashbackvalue;
|
|
48677
|
+
cardobj.product_phonenumber = arrayItem.productinfo.product_phonenumber;
|
|
48678
|
+
cardobj.productcanrate = arrayItem.productinfo.productcanrate;
|
|
48679
|
+
cardobj.sku = arrayItem.productinfo.sku;
|
|
48653
48680
|
if (langdetect == 'en') {
|
|
48654
|
-
|
|
48681
|
+
var _fetchAuthorizationQu;
|
|
48682
|
+
cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu === void 0 || (_fetchAuthorizationQu = _fetchAuthorizationQu.data) === null || _fetchAuthorizationQu === void 0 ? void 0 : _fetchAuthorizationQu.currencyname_en;
|
|
48655
48683
|
} else {
|
|
48656
|
-
|
|
48684
|
+
var _fetchAuthorizationQu2;
|
|
48685
|
+
cardobj.currencyname = fetchAuthorizationQueryContext === null || fetchAuthorizationQueryContext === void 0 || (_fetchAuthorizationQu2 = fetchAuthorizationQueryContext.data) === null || _fetchAuthorizationQu2 === void 0 || (_fetchAuthorizationQu2 = _fetchAuthorizationQu2.data) === null || _fetchAuthorizationQu2 === void 0 ? void 0 : _fetchAuthorizationQu2.currencyname_ar;
|
|
48657
48686
|
}
|
|
48658
48687
|
if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
|
|
48659
48688
|
favoriteprojectscountContext.forEach(function (favitem, favindex) {
|
|
@@ -48664,6 +48693,7 @@
|
|
|
48664
48693
|
}
|
|
48665
48694
|
} else if (fetchingtype == 'collections' || fetchingtype == 'innerparentcollections') {
|
|
48666
48695
|
cardobj.collectionid = arrayItem.collectionid;
|
|
48696
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48667
48697
|
if (langdetect == 'en') {
|
|
48668
48698
|
cardobj.name = arrayItem.title_en;
|
|
48669
48699
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48672,8 +48702,11 @@
|
|
|
48672
48702
|
cardobj.description = arrayItem.description_ar;
|
|
48673
48703
|
}
|
|
48674
48704
|
cardobj.image = arrayItem.collectionlogo;
|
|
48705
|
+
cardobj.producttags = [];
|
|
48706
|
+
cardobj.productfeatures = [];
|
|
48675
48707
|
} else if (fetchingtype == 'categories') {
|
|
48676
48708
|
cardobj.collectionid = arrayItem.categoryid;
|
|
48709
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48677
48710
|
if (langdetect == 'en') {
|
|
48678
48711
|
cardobj.name = arrayItem.title_en;
|
|
48679
48712
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48682,8 +48715,11 @@
|
|
|
48682
48715
|
cardobj.description = arrayItem.description_ar;
|
|
48683
48716
|
}
|
|
48684
48717
|
cardobj.image = arrayItem.categorylogo;
|
|
48718
|
+
cardobj.producttags = [];
|
|
48719
|
+
cardobj.productfeatures = [];
|
|
48685
48720
|
} else if (fetchingtype == 'parentcollections' || fetchingtype == 'innercategories') {
|
|
48686
48721
|
cardobj.collectionid = arrayItem.parentcollectionid;
|
|
48722
|
+
cardobj.skiplayeronclick = arrayItem === null || arrayItem === void 0 ? void 0 : arrayItem.skiplayeronclick;
|
|
48687
48723
|
if (langdetect == 'en') {
|
|
48688
48724
|
cardobj.name = arrayItem.title_en;
|
|
48689
48725
|
cardobj.description = arrayItem.description_en;
|
|
@@ -48692,10 +48728,17 @@
|
|
|
48692
48728
|
cardobj.description = arrayItem.description_ar;
|
|
48693
48729
|
}
|
|
48694
48730
|
cardobj.image = arrayItem.parentcollectionlogo;
|
|
48695
|
-
|
|
48731
|
+
cardobj.producttags = [];
|
|
48732
|
+
cardobj.productfeatures = [];
|
|
48733
|
+
} else if (fetchingtype == 'custom') {
|
|
48734
|
+
cardobj.producttags = [];
|
|
48735
|
+
cardobj.productfeatures = [];
|
|
48736
|
+
} else if (fetchingtype == 'vendors') {
|
|
48696
48737
|
cardobj.name = arrayItem.vendorname;
|
|
48697
48738
|
cardobj.collectionid = arrayItem.vendorid;
|
|
48698
48739
|
cardobj.image = arrayItem.vendorlogourl;
|
|
48740
|
+
cardobj.producttags = [];
|
|
48741
|
+
cardobj.productfeatures = [];
|
|
48699
48742
|
}
|
|
48700
48743
|
temparray.push(cardobj);
|
|
48701
48744
|
});
|