|
@@ -110,6 +110,19 @@ function startDetails(){
|
110
|
110
|
});
|
111
|
111
|
}
|
112
|
112
|
|
|
113
|
+ function updateDetailsByObj(obj){
|
|
114
|
+ $('.productname').html(obj.itemname)
|
|
115
|
+ $('.price').html(obj.pricelist);
|
|
116
|
+ appendSpecs(obj.itemid)
|
|
117
|
+ $('#skudetailitem').val(obj.sku)
|
|
118
|
+ $('.des_productdes').html(obj.itemdescription);
|
|
119
|
+
|
|
120
|
+ let defaultImg = obj.itemimageurl ? obj.itemimageurl: `./dist/assets/imgs/nophoto.png`;
|
|
121
|
+console.log(obj.itemimageurl,'obj.itemimageurlobj.itemimageurlobj.itemimageurl');
|
|
122
|
+ $('.productDetailsMain > img').attr('src',defaultImg);
|
|
123
|
+
|
|
124
|
+ }
|
|
125
|
+
|
113
|
126
|
function searchComb(){
|
114
|
127
|
let valuesSelected = [];
|
115
|
128
|
|
|
@@ -155,20 +168,15 @@ function startDetails(){
|
155
|
168
|
const {quantity} = itemtagscombinationRes[i];
|
156
|
169
|
if(quantity>=$('#quantity').val() && quantity>=1){
|
157
|
170
|
currentComb = itemtagscombinationRes[i];
|
158
|
|
- $('.productname').html(itemtagscombinationRes[i].itemname)
|
159
|
|
- $('.price').html(itemtagscombinationRes[i].pricelist);
|
|
171
|
+ // $('.productname').html(itemtagscombinationRes[i].itemname)
|
|
172
|
+ // $('.price').html(itemtagscombinationRes[i].pricelist);
|
160
|
173
|
// location.hash = itemtagscombinationRes[i].itemname.trim();
|
161
|
|
- appendSpecs(itemtagscombinationRes[i].itemid)
|
|
174
|
+ // appendSpecs(itemtagscombinationRes[i].itemid)
|
162
|
175
|
history.replaceState(null, null, `#itemid=${itemtagscombinationRes[i].itemid}#${itemtagscombinationRes[i].itemname.trim()}`);
|
163
|
|
- let searchparms = location.search;
|
164
|
|
- debugger;
|
165
|
|
-
|
166
|
|
-
|
167
|
|
-
|
168
|
|
-// const regex = /sku="(\w+)"/g;
|
169
|
|
-// const newParams = searchparms.replace("sku", `$1${itemtagscombinationRes[i].sku}$2`);
|
170
|
|
-// location.search = newParams;
|
171
|
|
- $('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
|
176
|
+
|
|
177
|
+ // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
|
178
|
+ // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
|
|
179
|
+ updateDetailsByObj(itemtagscombinationRes[i]);
|
172
|
180
|
}else{
|
173
|
181
|
debugger;
|
174
|
182
|
let name = itemtagscombinationRes[i].itemname.split('-')[0];
|
|
@@ -184,6 +192,7 @@ function startDetails(){
|
184
|
192
|
history.replaceState(null, null, `#`);
|
185
|
193
|
|
186
|
194
|
$('.msgErrorDetailsItem').removeClass('d-none');
|
|
195
|
+ $('.des_productdes').html('');
|
187
|
196
|
$('.price').html('');
|
188
|
197
|
}
|
189
|
198
|
|
|
@@ -252,7 +261,7 @@ function startDetails(){
|
252
|
261
|
|
253
|
262
|
async function getProductDetails(id){
|
254
|
263
|
|
255
|
|
-
|
|
264
|
+ debugger
|
256
|
265
|
|
257
|
266
|
// let res = await getStatAPIService(`${SERVERNAME}/apis/v4/bizgaze/integrations/products/productattributelist/productid/${id}`);
|
258
|
267
|
|
|
@@ -358,12 +367,22 @@ function startDetails(){
|
358
|
367
|
if(isTrue){
|
359
|
368
|
debugger;
|
360
|
369
|
console.log(itemtagscombinationRes[i],'itemtagscombinationRes[i]');
|
|
370
|
+
|
|
371
|
+
|
361
|
372
|
currentComb = itemtagscombinationRes[i];
|
362
|
|
- $('.productname').html(itemtagscombinationRes[i].itemname);
|
363
|
373
|
location.hash = itemtagscombinationRes[i].itemname.trim();
|
364
|
|
- $('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
365
|
|
- $('.price').html(itemtagscombinationRes[i].pricelist)
|
366
|
|
- appendSpecs(itemtagscombinationRes[i].itemid)
|
|
374
|
+
|
|
375
|
+ // $('.productname').html(itemtagscombinationRes[i].itemname);
|
|
376
|
+ // $('#skudetailitem').val(itemtagscombinationRes[i].sku)
|
|
377
|
+ // $('.price').html(itemtagscombinationRes[i].pricelist)
|
|
378
|
+ // debugger;
|
|
379
|
+ // appendSpecs(itemtagscombinationRes[i].itemid);
|
|
380
|
+ // $('.des_productdes').html(itemtagscombinationRes[i].itemdescription);
|
|
381
|
+
|
|
382
|
+ updateDetailsByObj(itemtagscombinationRes[i]);
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
367
|
386
|
isGo = false;
|
368
|
387
|
let {tagnames,tagids,pricelist} = itemtagscombinationRes[i];
|
369
|
388
|
tagids = tagids.split('|');
|
|
@@ -387,12 +406,18 @@ function startDetails(){
|
387
|
406
|
tagnames = tagnames.split('|');
|
388
|
407
|
$('.optiontaganwi').removeClass('borderselector');
|
389
|
408
|
currentComb = itemtagscombinationRes[0];
|
|
409
|
+
|
|
410
|
+
|
390
|
411
|
for(let i=0;i<tagids.length;i++){
|
391
|
412
|
|
392
|
413
|
$(`[data-type="${tagids[i]}-${tagnames[i]}"]`).addClass('borderselector');
|
393
|
414
|
}
|
394
|
415
|
|
395
|
|
- $('.price').html(pricelist);
|
|
416
|
+ // $('.price').html(pricelist);
|
|
417
|
+ // $('.des_productdes').html(itemtagscombinationRes[0].itemdescription);
|
|
418
|
+ // appendSpecs(itemtagscombinationRes[0].itemid);
|
|
419
|
+
|
|
420
|
+ updateDetailsByObj(itemtagscombinationRes[0]);
|
396
|
421
|
//console.log(childIds);
|
397
|
422
|
//
|
398
|
423
|
|