PageSourceSearch

https://www.jindrafloraldesign.com/wp-content/themes/sandyflowershop/js/custom.js?ver=1731043272

js jindrafloraldesign.com collected 2026-09-26 19:53:36 UTC 39,259 bytes, 994 lines download raw bytes

1function startTimer(durations, display) {
2	var minutes, seconds, days, hours;
3	var duration_arr = JSON.parse(durations)
4	var timer = duration_arr['diffseconds'];
5	var durations = timer;
6	var timesign = duration_arr['sign'];
7	var difference_str;
8	var setintervals = localStorage.getItem("setintervals");
9	if (setintervals) {
10		clearInterval(setintervals);
11	}
12	var xinterval = setInterval(function () {
13
14		hours = parseInt(timer / 3600, 10);
15		if (hours > 24) {
16
17
18			var timeResult = SplitTime(timer);
19			days = timeResult.days;
20			hours_new = timeResult.hrs;
21			seconds = timeResult.seconds;
22			minutes = timeResult.mints;
23
24		} else {
25
26			var timeResult = SplitTime(timer);
27			days = timeResult.days;
28			hours_new = timeResult.hrs;
29			seconds = timeResult.seconds;
30			minutes = timeResult.mints;
31		}
32
33
34		seconds = seconds < 10 ? "0" + seconds : seconds;
35		if (timesign == 'negative') {
36			difference_str = '<span><b>-' + hours_new + '</b>hrs</span> : <span><b>' + minutes + '</b> mins</span> : <span><b>' + seconds + '</b>  secs</span> ';
37			display.innerHTML = difference_str;
38
39		} else {
40			if (hours > 24) {
41				difference_str = '<span><b>' + days + '</b>days</span> :<span><b>' + hours_new + '</b>hrs</span> : <span><b>' + minutes + '</b> mins</span> : <span><b>' + seconds + '</b>  secs</span> ';
42			} else {
43				difference_str = '<span><b>' + hours_new + '</b>hrs</span> : <span><b>' + minutes + '</b> mins</span> : <span><b>' + seconds + '</b>  secs</span> ';
44			}
45
46			display.innerHTML = difference_str;
47
48		}
49
50
51
52		if (--timer < 0) {
53			timer = duration;
54		}
55	}, 1000);
56
57	localStorage.setItem("setintervals", xinterval);
58}
59
60function SplitTime(seconds) {
61	var days = Math.floor(seconds / (3600 * 24));
62	seconds -= days * 3600 * 24;
63	var hrs = Math.floor(seconds / 3600);
64	seconds -= hrs * 3600;
65	var mnts = Math.floor(seconds / 60);
66	seconds -= mnts * 60;
67	return ({ "days": days, "hrs": hrs, "mints": mnts, "seconds": seconds });
68}
69
70
71function check_time_variations_new(currentdates, start_time, store_end_time, time_zone) {
72	var dates = currentdates.split(',');
73	year = dates[0];
74	month = dates[1];
75	date = dates[2];
76
77	var newdate = year + '-' + month + '-' + date;
78
79	const current_date = new Date().toLocaleString("en-US", { timeZone: time_zone });
80
81	var todayDate = formatDate(current_date, "YYYY-MM-DD");
82
83	if (newdate == todayDate) {
84		let options = {
85			month: 'short',
86			day: 'numeric',
87			year: 'numeric',
88			hour: 'numeric',
89			minute: 'numeric',
90			second: 'numeric',
91			hourCycle: 'h23',
92			timeZone: time_zone
93		},
94			curentTimeZoneDataTime = new Intl.DateTimeFormat('en-US', options).format(new Date());
95		var crr = curentTimeZoneDataTime.split(' ');
96		var crrs = crr[crr.length - 1].split(':');
97		var hours = crrs[0];
98		var mintss = crrs[1];
99		var currentTimeZoneTime = hours + '' + mintss;
100		if (parseInt(start_time) < parseInt(currentTimeZoneTime)) {
101
102			return false;
103		} else {
104			return true;
105		}
106	} else {
107		return true;
108	}
109
110}
111const formatDate = function (d, format) {
112	const date = new Date(d);
113	let month = date.getMonth() + 1;
114	let day = date.getDate();
115	let year = date.getFullYear();
116
117	if (day < 10) {
118		day = "0" + day;
119	}
120
121	if (month < 10) {
122		month = "0" + month;
123	}
124
125	if (format === "MM-DD-YYYY") {
126		return `${month}-${day}-${year}`;
127	}
128	if (format === "DD-MM-YYYY") {
129		return `${day}-${month}-${year}`;
130	}
131	if (format === "YYYY-MM-DD") {
132		return `${year}-${month}-${day}`;
133	}
134	if (format === "MM/DD/YYYY") {
135		return `${month}/${day}/${year}`;
136	}
137	if (format === "inputDate") {
138		return `${year}-${month}-${day}`;
139	}
140
141	return date;
142};
143function delivery_time_variation(post, currentdates, delivery_Type) {
144	var time_variation_str = '';
145
146	var k = 1;
147	timevariation = post['data']['delivery_charge'][0]['delivery_details'];
148
149	if (timevariation) {
150
151		jQuery('.order-card').show();
152
153		// console.log('timevariation_custom',timevariation_custom);
154		var date_hidden = jQuery('#get_dates_hidden').val();
155		var hrs_hidden = jQuery('#get_hrs_hidden').val();
156
157
158		time_variation_str = '<label for="select_1"><b>Select your time:</b><p class="d-msg"></p></label>';
159		time_variation_str += '<div class="control radio3 radio s-center">';
160		var time_zone = document.getElementById("timezone").value;
161		var store_end_time = document.getElementById("store_end_time").value;
162
163		var customTimeGrayedYes = [];
164		var deliveryTimeGrayedYes = [];
165
166		for (var keys in timevariation) {
167
168			var date_value = timevariation[keys];
169			var labels = date_value['start_time'] + '-' + date_value['end_time'];
170			var values = date_value['amount'];
171			var start_time = date_value['start_time'];
172			var end_time = date_value['end_time'];
173			var custom_type = date_value['custom_type'];
174			var custom_hrs = date_value['custom_hours'];
175			var product_has_delivery_schedule = date_value['product_has_delivery_schedule'];
176			var time_grayed = date_value['time_grayed'];
177			var get_total_hours = date_value['get_total_hours'];
178
179
180			if (date_value['custom_type'] == "custom") {
181				customTimeGrayedYes.push(date_value['time_grayed']);
182			} else {
183				deliveryTimeGrayedYes.push(date_value['custom_type']);
184			}
185
186			if (time_grayed == "yes") {
187
188				jQuery('#time_grayed_hidden_yes').val(1);
189			} else {
190
191				jQuery('#time_grayed_hidden_no').val(2);
192			}
193
194			var get_days = date_value['get_days'];
195			var get_hours = date_value['get_hours'];
196			jQuery('#get_dates_hidden').val(get_days);
197			jQuery('#get_hrs_hidden').val(get_hours);
198
199
200			var start_time_new = getRailwayTime(start_time);
201			var cut_off_time = getRailwayTime(date_value['cut_off_time_plain']);
202			var start_label = start_time_new.replace(":", "") + 'label';
203			var delivery_schedule_id = date_value['delivery_schedule_id'];
204
205			var check_status_str = check_time_variations_new(currentdates, cut_off_time, store_end_time, time_zone);
206
207
208			validate_time = '';
209			if (check_status_str == false) {
210				validate_time = "invalid_time";
211			}
212
213			if (custom_type === 'delivery') {
214
215
216				if (values == 'FREE') {
217					if (time_grayed == "yes") {
218						time_variation_str += '<div data-customtype="delivery" class="choice invalid_time ' + validate_time + " " + start_label + '"><input type="hidden" id="custom_type_hidden" value=""><input type="radio" name="time_variation" data-schedule_id ="' + delivery_schedule_id + '" id="timevariation' + k + '" class="pofw-option" value="free"><label for="timevariation' + k + '"><span class="purple">' + labels + '</span><span class="pofw-price">FREE</span></label><input type="hidden" name="time_variation_start" class="time_variation_start" value="' + start_time + '"><input type="hidden" name="delivery_schedule_id" class="delivery_schedule_id" value="' + delivery_schedule_id + '"><input type="hidden" name="cut_off_time" class="cut_off_time" value="' + cut_off_time + '"></div>';
219
220					} else {
221						time_variation_str += '<div data-customtype="delivery" class="choice ' + validate_time + " " + start_label + '"><input type="hidden" id="custom_type_hidden" value=""><input type="radio" name="time_variation" data-schedule_id ="' + delivery_schedule_id + '" id="timevariation' + k + '" class="pofw-option" value="free"><label for="timevariation' + k + '"><span class="purple">' + labels + '</span><span class="pofw-price">FREE</span></label><input type="hidden" name="time_variation_start" class="time_variation_start" value="' + start_time + '"><input type="hidden" name="delivery_schedule_id" class="delivery_schedule_id" value="' + delivery_schedule_id + '"><input type="hidden" name="cut_off_time" class="cut_off_time" value="' + cut_off_time + '"></div>';
222
223					}
224				} else {
225					if (time_grayed == "yes") {
226
227						time_variation_str += '<div data-customtype="delivery" class="choice invalid_time ' + validate_time + " " + start_label + '"><input type="hidden" id="custom_type_hidden" value=""><input type="radio" name="time_variation" id="timevariation' + k + '" data-schedule_id ="' + delivery_schedule_id + '" class="pofw-option" value="$' + values + '"><label for="timevariation' + k + '"><span class="purple">' + labels + '</span><span class="pofw-price">$' + values + '</span></label><input type="hidden" name="delivery_schedule_id" class="delivery_schedule_id" value="' + delivery_schedule_id + '"><input type="hidden" name="time_variation_start" class="time_variation_start" value="' + start_time + '"><input type="hidden" name="cut_off_time" class="cut_off_time" value="' + cut_off_time + '"></div>';
228
229					} else {
230
231						time_variation_str += '<div data-customtype="delivery" class="choice ' + validate_time + " " + start_label + '" ><input type="hidden" id="custom_type_hidden" value=""><input type="radio" name="time_variation" id="timevariation' + k + '" data-schedule_id ="' + delivery_schedule_id + '" class="pofw-option" value="$' + values + '"><label for="timevariation' + k + '"><span class="purple">' + labels + '</span><span class="pofw-price">$' + values + '</span></label><input type="hidden" name="delivery_schedule_id" class="delivery_schedule_id" value="' + delivery_schedule_id + '"><input type="hidden" name="time_variation_start" class="time_variation_start" value="' + start_time + '"><input type="hidden" name="cut_off_time" class="cut_off_time" value="' + cut_off_time + '"></div>';
232
233					}
234				}
235			} else if (custom_type === 'custom') {
236
237				if (values == 'FREE') {
238					if (time_grayed == "yes") {
239
240					} else {
241						time_variation_str += '<div data-customtype="custom" data_start_time = "' + start_time + '" data_end_time = "' + end_time + '" data-customhrs="' + custom_hrs + '" class="choice ' + validate_time + " " + start_label + '"><input type="hidden" id="custom_type_hidden" value=""><input type="radio" name="time_variation" id="timevariation' + k + '" data-schedule_id ="' + delivery_schedule_id + '" class="pofw-option" value="$' + values + '"><label for="timevariation' + k + '"><span class="custom-msg">Custom Delivery Timeframe</span><span class="purple">Custom Delivery Time</span><span class="pofw-price">' + values + '</span></label><input type="hidden" name="delivery_schedule_id" class="delivery_schedule_id" value="' + delivery_schedule_id + '"><input type="hidden" name="time_variation_start" class="time_variation_start" value="' + start_time + '"><input type="hidden" name="cut_off_time" class="cut_off_time" value="' + cut_off_time + '"><div class="toooltip"><i class="fa fa-info-circle" aria-hidden="true"></i><span class="toooltiptext">Order should be placed before 04 hrs 00 mins</span></div></div>';
242
243					}
244
245				} else {
246
247					if (time_grayed == "yes") {
248
249					} else {
250						time_variation_str += '<div data-customtype="custom" data_start_time = "' + start_time + '" data_end_time = "' + end_time + '" data-customhrs="' + custom_hrs + '" class="choice ' + validate_time + " " + start_label + '"><input type="hidden" id="custom_type_hidden" value=""><input type="radio" name="time_variation" id="timevariation' + k + '" data-schedule_id ="' + delivery_schedule_id + '" class="pofw-option" value="$' + values + '"><label for="timevariation' + k + '"><span class="custom-msg">
250Custom Delivery Timeframe</span><span class="purple">Custom Delivery Time</span><span class="pofw-price">$' + values + '</span></label><input type="hidden" name="delivery_schedule_id" class="delivery_schedule_id" value="' + delivery_schedule_id + '"><input type="hidden" name="time_variation_start" class="time_variation_start" value="' + start_time + '"><input type="hidden" name="cut_off_time" class="cut_off_time" value="' + cut_off_time + '"><div class="toooltip"><i class="fa fa-info-circle" aria-hidden="true"></i><span class="toooltiptext">Order should be placed before 04 hrs 00 mins</span></div></div>';
251
252					}
253
254				}
255
256
257
258			}
259
260
261			k++;
262		}
263
264
265
266		var TimeGrayedYes = [];
267		var TimeGrayedNo = [];
268
269		if (deliveryTimeGrayedYes.length == 0) {
270
271			jQuery.each(customTimeGrayedYes, function (key1, value1) {
272
273				if (value1 == "yes") {
274
275					TimeGrayedYes.push('yes');
276				} else {
277					TimeGrayedNo.push('no');
278
279				}
280			});
281		}
282
283		if (TimeGrayedNo.length == 0 && TimeGrayedYes == 0) {
284		} else if (TimeGrayedNo.length == 0) {
285			time_variation_str = '<p class="timemsg">No delivery times available for this date.</p> <p class="order-msg"></p> ';
286			return time_variation_str;
287		}
288
289		if (product_has_delivery_schedule == 'yes') {
290
291			if (get_days == "empty") {
292				time_variation_str += '</div><p class="timemsg"></p><p class="order_days">This product requires at least  ' + get_total_hours + ' hours before delivery time </p>';
293				return time_variation_str;
294			}
295			else {
296				time_variation_str += '</div><p class="timemsg"></p><p class="order_days">This product requires at least  ' + get_total_hours + ' hours before delivery time </p>';
297				return time_variation_str;
298
299			}
300		}
301		else {
302			time_variation_str += '</div><p class="timemsg"></p> <p class="order-msg"> </p>';
303			return time_variation_str;
304		}
305	} else {
306
307		time_variation_str = '<p class="timemsg">No delivery times available for this date.</p> <p class="order-msg"></p> ';
308		return time_variation_str;
309	}
310}
311
312
313function product_category_page_display_new(post, current_pages, categorypaginations, product_sort) {
314
315	var banner_image = localStorage.getItem("banner_image");
316	var banner_heading_color = localStorage.getItem("banner_heading_color");
317
318
319	jQuery('.product_category_contents').bind('DOMNodeInserted', function (oEvent) {
320		jQuery(".homebanner").css("background", "url('" + banner_image + "')");
321	});
322
323
324	jQuery('.product_category_contents').bind('DOMNodeInserted', function (oEvent) {
325		jQuery(".banner-caption h2").css("color", banner_heading_color + " !important");
326	});
327	jQuery('.product_category_contents').bind('DOMNodeInserted', function (oEvent) {
328		jQuery(".banner-caption p").css("color", banner_heading_color + " !important");
329	});
330
331	var category_name = '';
332	var category_descriptions = '';
333	var category_product_title = '';
334	var product_category_urls = '';
335	if (post.data && post.code == '200') {
336
337		product_category_results = post['data']['category_details'];
338		category_name = product_category_results['category_name'];
339
340		category_descriptions = product_category_results['description'];
341
342		category_product_title = "Our Best Selling Flowers & Gifts";
343
344		product_category_urls = category_name.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, '');
345
346	}
347
348	var product_category_str = '';
349
350	if (post.code == '200' && category_name && category_descriptions) {
351
352		var product_category_url = document.getElementById("product_category_url").value;
353		var api_url = document.getElementById("api_url").value;
354
355		product_category_str = '<div class="product_category"><div class="container"> <div class="row"> <div class="col-md-12 text-center"><h2>' + category_name + '</h2><img width="149" height="38" src="' + product_category_url + '/wp-content/uploads/2021/10/22-2.png" ><p>' + category_descriptions + '</p></div></div></div></div>';
356
357		if (post['data']['product_list'] && post['code'] == '200') {
358
359			product_category_str += '<div class="product_category_list pb-4"><div class="container"> <div class="row"> <div class="col-md-12 text-center"><h3>' + category_product_title + '</h3><img width="149" height="38" src="' + product_category_url + '/wp-content/uploads/2021/10/22-2.png" ></div>';
360
361
362			product_category_str += '<div class="col-md-12 catalog-ordering"> <div class="order-container text-right"><input type="hidden" name="category" class="categorypaginations" value="' + categorypaginations + '" ><select class="orderby order-dropdown">';
363			if (product_sort == 'high_to_low') {
364				product_category_str += '<option value="high_to_low" selected>Sort by high to low</option>';
365			} else {
366				product_category_str += '<option value="high_to_low">Sort by high to low</option>';
367			}
368
369			if (product_sort == 'low_to_high') {
370				product_category_str += '<option value="low_to_high" selected>Sort by low to high</option>';
371			} else {
372				product_category_str += '<option value="low_to_high">Sort by low to high</option>';
373			}
374
375			product_category_str += '</select></div></div>';
376
377			product_category_str += '<div class="col-md-12 text-center"><div class="row">';
378			product_data = post['data']['product_list'];
379			if (product_data) {
380				for (var key in product_data) {
381					var value = product_data[key];
382
383					var product_title = value[0]['product_name'];
384					var product_image = value[0]['product_image'];
385					var product_price = value[0]['price'];
386
387					var product_url = product_title.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, '');
388
389					var product_id = value[0]['Product Id'];
390					var product_status = value[0]['product_status'];
391					var best_seller = value[0]['best_seller'];
392
393					var product_status_str = '';
394
395
396					if (best_seller == "yes") {
397						if (product_status == "inactive") {
398							product_status_str = '<div class="outofstock"><p>Out of Stock</p></div>';
399						}
400						product_category_str += '<div class="products_widget col-md-3 col-6 best"><div class="relpos"><a href="' + product_category_url + '/product/' + product_url + '"><img src="' + product_image + '"></a>' + product_status_str + '</div><p class="bs"><span><i class="fas fa-heart" style="color: red !important;"></i> Best Seller</span></p><h6><a href="' + product_category_url + '/product/' + product_url + '">' + product_title + '</a></h6><p class="product_price">$' + product_price + '</p></div>';
401
402					} else {
403						if (product_status == "inactive") {
404							product_status_str = '<div class="outofstock"><p>Out of Stock</p></div>';
405						}
406						product_category_str += '<div class="products_widget col-md-3 col-6"><div class="relpos"><a href="' + product_category_url + '/product/' + product_url + '"><img src="' + product_image + '"></a>' + product_status_str + '</div><p class="bs"></p><h6><a href="' + product_category_url + '/product/' + product_url + '">' + product_title + '</a></h6><p class="product_price">$' + product_price + '</p></div>';
407
408					}
409
410
411				}
412
413			} else {
414
415				product_category_str += '<p>No Product data</p>';
416			}
417			var paginations_str = '';
418			var pagination_total = post['data']['total'];
419			if (pagination_total > 1) {
420
421				var sort_str = '';
422				if (product_sort == 'high_to_low') {
423					sort_str = '&sort=high_to_low';
424				} else if (product_sort == 'low_to_high') {
425					sort_str = '&sort=low_to_high';
426				}
427				paginations_str = '<div class="paginationsection container"><div class=" row"><div class="col-md-12 text-center">';
428
429				var pagination_prev_url = post['data']['prev_page_url'];
430				var pagination_next_url = post['data']['next_page_url'];
431				var page_active_str = '';
432				var page_active = post['active'];
433				if (page_active == true) {
434					page_active_str = 'active';
435				}
436				if (pagination_prev_url) {
437					pagination_prev_urls = pagination_prev_url.split("page=");
438					paginations_str += '<a data-category="' + categorypaginations + '" data-pages="' + pagination_prev_urls[1] + '" href="javascript:" data-paged="' + pagination_prev_url + '&' + categorypaginations + '=' + product_category_urls + sort_str + '" class="paginations page-prev"></a>';
439				}
440				for (var j = 1; j <= pagination_total; j++) {
441
442					if (j == current_pages) {
443
444						paginations_str += '<a data-pages="' + j + '" data-category="' + categorypaginations + '" data-paged="' + api_url + '/api/sorting_products?' + categorypaginations + '=' + product_category_urls + sort_str + '" class="active">' + j + '</a>';
445					} else {
446						paginations_str += '<a data-category="' + categorypaginations + '" data-pages="' + j + '" data-paged="' + api_url + '/api/sorting_products?' + categorypaginations + '=' + product_category_urls + '&page=' + j + sort_str + '" href="javascript:" class="paginations' + page_active_str + '">' + j + '</a>';
447					}
448
449				}
450				if (pagination_next_url) {
451					pagination_next_urls = pagination_next_url.split("page=");
452					paginations_str += '<a data-category="' + categorypaginations + '"data-
452pages="' + pagination_next_urls[1] + '" data-paged="' + pagination_next_url + '&' + categorypaginations + '=' + product_category_urls + sort_str + '" href="javascript:" class="paginations page-next"></a>';
453				}
454
455				paginations_str += '</div></div></div>';
456			}
457
458			product_category_str += '</div></div></div></div></div>' + paginations_str;
459
460		}
461
462	} else {
463		product_category_str += '<div class="product_category"><div class="container"><div class="row"> <div class="col-md-12 text-center"><p>No Product data</p></div></div></div></div>';
464	}
465	return product_category_str;
466
467}
468
469function product_detail_page_display_new(post, single_price) {
470
471
472	var product_name = '';
473	var product_descriptions = '';
474	var product_image = '';
475	var product_id = 0;
476	var product_status_str = '';
477
478	if (post['data'] && post['code'] == '200') {
479
480		if (post['data']) {
481
482			product_detail_results = post['data']['product'];
483			product_name = product_detail_results[0]['product_name'];
484			product_id = product_detail_results[0]['product_id'];
485			product_descriptions = product_detail_results[0]['description'];
486			product_image = product_detail_results[0]['product_image'][0];
487			product_comment = product_detail_results[0]['product_comment'];
488			product_status_str = product_detail_results[0]['product_status'];
489
490		}
491
492		var product_detail_str = '';
493		var price_variation_str = '';
494		var date_variation_str = '';
495		var time_variation_str = '';
496		var label_product_str = '';
497		var related_product_str = '';
498		var product_descriptions_str = '';
499		var store_end_time = 0;
500		var time_zone = '';
501		var store_time_zone = '';
502
503
504		if (post['code'] == '200' && product_name && product_descriptions) {
505
506			variation_product = post['data']['product'][0]['variant_details'];
507			var product_type = post['data']['product'][0]['product_type'];
508			var simple_product = post['data']['product'][0];
509			delivery_dates = post['data']['delivery_dates'];
510			storetime = post['data']['store_time'];
511			time_zone = post['data']['time_zone'];
512
513			if (storetime) {
514				store_out_times = storetime['cut_off_time'];
515				store_time_zone = storetime['time_zone'];
516				store_end_time = getRailwayTime(store_out_times);
517			}
518
519			if (variation_product) {
520				price_variation_str = '<div class="field"><label for="select_1"><span><b>Select your size:</b></span></label>';
521				price_variation_str += '<div class="control radio1 radio s-center">';
522				var k = 1;
523				for (var keys in variation_product) {
524					var values = variation_product[keys];
525					var labels = values['variant_name'];
526					var prices = values['price'];
527					var variant_id = values['variant_id'];
528					var active_class = '';
529					var active = '';
530					if (k == 1) {
531						active_class = 'active';
532						active = 'checked';
533					}
534					price_variation_str += '<div class="choice ' + active_class + '"><input data-variant_id="' + variant_id + '" type="radio" name="price_variation" id="pofw_option_value_' + k + '" class="pofw-option variant_price_' + variant_id + '" value="$' + prices + '" ' + active + '><label for="pofw_option_value_' + k + '"><span class="purple">' + labels + '</span><span class="pofw-price variant_price_' + variant_id + '">$' + prices + '</span></label></div>';
535					k++;
536				}
537				price_variation_str += '</div><p class="msg"></p></div>';
538			}
539
540			if (product_type == 'single') {
541
542				if (simple_product) {
543					var prices = simple_product['sale_price'];
544					var labels = 'Price';
545					price_variation_str = '<div class="field">';
546					price_variation_str += '<div class="control radio1 radio s-center">';
547					price_variation_str += '<div class="choice active"><input data-variant_id="' + variant_id + '" type="radio" name="price_variation" id="pofw_option_value_1" class="pofw-option single_price_1" value="$' + prices + '" checked><label for="pofw_option_value_1"><span class="purple">' + labels + '</span><span class="pofw-price single_price_1">$' + prices + '</span></label></div>';
548					price_variation_str += '</div><p class="msg"></p></div>';
549
550				}
551			}
552
553			label_product_str = '<div class="fieldlabel"><div class="pseperator"> </div></div>';
554
555			if (delivery_dates) {
556				date_variation_str = '<div class="field"><label for="select_1"> <span><b>Select your date:</b></span></label>';
557				date_variation_str += '<div class="msg-req"></div>';
558				date_variation_str += '<div class="fieldposition"><div class="control radio2 radio">';
559
560				var disabled_days_str = '';
561				disableddays = post['data']['restricted_dates'];
562
563				if (disableddays != 'NA') {
564					for (var days in disableddays) {
565						var day_value = disableddays[days];
566						var day_values = day_value;
567						if (disabled_days_str != '') {
568							disabled_days_str = disabled_days_str + ',' + day_values;
569						} else {
570							disabled_days_str = day_values;
571						}
572					}
573				}
574				var k = 1;
575
576				for (var keys in delivery_dates) {
577
578					var date_value = delivery_dates[keys];
579
580					options = {
581						timeZone: time_zone,
582						year: 'numeric',
583						month: 'numeric',
584						day: 'numeric',
585						hour: 'numeric',
586						minute: 'numeric',
587						second: 'numeric',
588					},
589						formatter = new Intl.DateTimeFormat([], options);
590
591					var values = date_value.split('-');
592					var dates = new Date();
593					dates.setFullYear(values[0]);
594					var months = 0;
595					if (values[1]) {
596						months = values[1] - 1;
597					}
598					dates.setMonth(months);
599					dates.setMonth(months);
600					dates.setDate(values[2]);
601
602					zone_date = formatter.format(dates);
603
604					var options = {
605						weekday: 'long'
606					};
607					options.timeZone = time_zone;
608
609					week_name = dates.toLocaleString('en-US', { weekday: 'long' });
610					var newoptions = {
611						month: 'short',
612						day: 'numeric',
613						hour12: false,
614					};
615					newoptions.timeZone = time_zone;
616
617					var day_name = dates.toLocaleString('en-US', { month: 'short', day: 'numeric' });
618					var date_label = "<span>" + week_name + "</span>" + "<span>" + day_name + "</span>";
619					var check_status_str = '';
620
621					if (check_status_str == 'dayend') {
622
623
624						year = values[0];
625						month = values[1];
626						date = values[2];
627						newdates = year + '/' + month + '/' + date;
628						if (disabled_days_str != '') {
629							disabled_days_str = disabled_days_str + ',' + newdates;
630						} else {
631							disabled_days_str = newdates;
632						}
633
634					}
635					k++;
636
637					date_variation_str += '<div class="choice ' + check_status_str + '"><input type="radio" name="custom_calendar" id="dates' + k + '" class="pofw-option" value="' + values + '"><label for="dates' + k + '"><span class="purple">' + date_label + '</span></label></div>';
638
639				}
640				var is_florist_check = post['data']['product'][0]['is_florist'];
641
642				if (is_florist_check == 'no' || is_florist_check == 'yes') {
643					date_variation_str += '<div class="moredates choice">More dates</div>';
644				}
645				date_variation_str += '</div><div class="more_calender"></div></div><input type="hidden" name="more_calendar" class="more_calendars"> <input type="hidden" name="holidays" class="more_holidays" value="' + disabled_days_str + '"><p class="datemsg"></p></div>';
646				date_variation_str += '<div class="field time_variations"> </div>';
647			}
648
649
650
651
652			var pageurl = window.location.href;
653			var product_detail_contents = pageurl.split("product/");
654			var product_category_url = '';
655			if (product_detail_contents[0]) {
656
657
658				product_category_url = product_detail_contents[0];
659			}
660
661			guarantee_str = '<div class="col-md-12 col-lg-5 d-none-desktop"></div><div class="order-img"><div class="row"><p class="color" style="text-align: center !Important"><img src="/wp-content/uploads/2021/10/111-1.png" alt="" width="200" height="300"></p></div>';
662			guarantee_str += '</div></div>';
663			product_descriptions_str = '<div class="col-md-12 product_descriptions"><div class="row"><div class="col-md-12">';
664			product_descriptions_str += '<h2>Description</h2>';
665			product_descriptions_str += '<p class="product-text">' + product_descriptions + '</p>';
666			product_descriptions_str += '</div>';
667			if (product_comment) {
668				product_descriptions_str += '<div class="col-md-12 product_comments">';
669				product_descriptions_str += '<h2>Comments</h2>';
670				product_descriptions_str += '<p>' + product_comment + '</p>';
671				product_descriptions_str += '</div>';
672			}
673			product_descriptions_str += '</div></div>';
674		}
675
676		var related_products = (post['data']['recommeded_products']) ? post['data']['recommeded_products'] : 'NA';
677		if (related_products != 'NA') {
678
679			related_product_str = '<div class="col-md-12 related_product"><h2>You May Also Like </h2><div class="row">';
680			for (var relkey in related_products) {
681				var relvalue = related_products[relkey];
682				var proimage = relvalue[0]['product_image'];
683				var proname = relvalue[0]['product_name'];
684				var proprice = relvalue[0]['price'];
685				var proid = relvalue[0]['product_id'];
686				var relpro_status = relvalue[0]['product_status'];
687				var best_seller = relvalue[0]['best_seller'];
688
689
690				relpro_status_str = '';
691				if (best_seller == "yes") {
692
693					if (relpro_status == "inactive") {
694						relpro_status_str = '<div class="outofstock"><p>Out of Stock</p></div>';
695					}
696					var product_url = proname.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, '');
697					related_product_str += '<div class="products_widget col-md-3 col-6 float-left best"><div class="relpos"><a href="' + product_category_url + 'product/' + product_url + '"><img src="' + proimage + '"></a>' + relpro_status_str + '</div><p class="bs"><span><i class="fas fa-heart" style="color: red !important;"></i> Best Seller</span></p><h6>';
698					related_product_str += '<a href="' + product_category_url + 'product/' + product_url + '">' + proname + '</a></h6><p class="product_price">$' + proprice + '</p></div>';
699
700				} else {
701					if (relpro_status == "inactive") {
702						relpro_status_str = '<div class="outofstock"><p>Out of Stock</p></div>';
703					}
704					var product_url = proname.toLowerCase().replace(/ /g, '-').replace(/[^\w-]+/g, '');
705					related_product_str += '<div class="products_widget col-md-3 col-6 float-left"><div class="relpos"><a href="' + product_category_url + 'product/' + product_url + '"><img src="' + proimage + '"></a>' + relpro_status_str + '</div><p class="bs"><h6>';
706					related_product_str += '<a href="' + product_category_url + 'product/' + product_url + '">' + proname + '</a></h6><p class="product_price">$' + proprice + '</p></div>';
707
708
709				}
710
711
712
713			}
714		}
715
716		related_product_str += '</div></div>';
717		var delivery_date_params_old = localStorage.getItem("delivery-date-params");
718		var delivery_date_params_exist = localStorage.getItem("delivery-date-params_exist");
719
720
721
722
723		if (delivery_date_params_exist) {
724
725			const myArray = delivery_date_params_exist.split("-");
726			var month = myArray[1];
727			var date = myArray[2];
728			var year = myArray[0];
729			var delivery_new_date = month + '-' + date + '-' + year;
730
731
732			delivery_zip_code = '<div class="field zipcode d-none"><label> <span><b>Delivery for Zip Code: </b></span><span class="free_delivery"><input type="text" name="zipcode" id="delivery_zip_codes" value="' + current_zipcode + '"><a class="edit_zipcode_icons" href="javascript:">Change Zip Code</a></label> <input type="text" id="new_strat" class="dateepicker" value="' + delivery_new_date + '"></div>';
733
734		}
735		else {
736
737			const myArray = delivery_date_params_old.split("-");
738			var month = myArray[1];
739			var date = myArray[2];
740			var year = myArray[0];
741			var delivery_new_dates = month + '-' + date + '-' + year;
742
743
744			delivery_zip_code = '<div class="field zipcode d-none"><label> <span><b>Delivery for Zip Code: </b></span><span class="free_delivery"><input type="text" name="zipcode" id="delivery_zip_codes" value="' + current_zipcode + '"><a class="edit_zipcode_icons" href="javascript:">Change Zip Code</a></label><input type="text" id="new_strat" class="dateepicker" value="' + delivery_new_dates + '" ></div>';
745		}
746
747
748
749		var current_zipcode = localStorage.getItem("zipcode");
750		product_status = '';
751		if (product_status_str == "inactive") {
752			product_status = '<div class="outofstock"><p>Out of Stock</p></div>';
753		}
754
755		product_detail_str = '<div class="product_detail ' + product_status_str + '"><div class="container"><div class="row"><div class="col-md-12"><div class="row"><div class="col-md-4 text-center"><div class="relpos"><img src="' + product_image + '" >' + product_status + '</div>' + product_descriptions_str + '</div><div class="col-md-8"><div class="pseperator"><h2>' + product_name + '</h2></div><form class="single_product_variations">' + delivery_zip_code + price_variation_str + label_product_str + date_variation_str + time_variation_str + '<input type="hidden" name="store_end_time" id="store_end_time" value="' + store_end_time + '"/><input type="hidden" name="product_type" id="product_type" value="' + product_type + '"/><div class="custom-sec"><p class="windows-custom-time"></p><div class="error-block"></div><div class="e-message"></div><div class="custom-from-time"></div><div class="custom-to-time"></div></div><div class="row"><div class="order-card col-md-12 col-lg-5 order_button"><input type="submit" class="btn" name="ordernow" value="Order Now"/></div><div class="order-card col-md-12 col-lg-5 d-none-mobile"></div></div></form>' + guarantee_str + '</div></div></div>' + related_product_str + '</div></div><input type="hidden" name="product_id" class="product_id" value="' + product_id + '"><input type="hidden" name="timezone" id="timezone" class="timezone" value="' + time_zone + '">';
756
757	} else {
758		product_detail_str += '<div class="product_detail"><div class="container"><div class="row"> <div class="col-md-12 text-center"><p>No Product data</p></div></div></div></div>';
759	}
760
761	return product_detail_str;
762}
763
764function timedifferentcheck(date1, railwaytime, time_zone, store_in_times) {
765	var today = new Date();
766
767	tomorrow_hours = today.getHours();
768	const current_date = new Date().toLocaleString("en-US", { timeZone: time_zone });
769
770
771
772	let options = {
773		month: 'short',
774		day: 'numeric',
775		year: 'numeric',
776		hour: 'numeric',
777		minute: 'numeric',
778		second: 'numeric',
779		hour12: false,
780		timeZone: time_zone
781	};
782
783
784	curentTimeZone = new Intl.DateTimeFormat('en-US', options).format(new Date());
785
786
787
788	var crr = curentTimeZone.split(',');
789	var crrs = crr[2].split(':');
790	var hours = crrs[0];
791	var mintss = crrs[1];
792
793	var railwaytimes = railwaytime.split(':');
794	var railway_hours = railwaytimes[0];
795	var railway_mintss = railwaytimes[1];
796	var hours_new = 0;
797	var mintes_new = 0;
798	var seconds = parseInt(crrs[2]);
799	var store_in_railway_time = store_in_times.split(':');
800	var store_in_hours = store_in_railway_time[0];
801	var store_in_mintss = store_in_railway_time[1];
802
803	if ((parseInt(railway_hours) > parseInt(hours)) && (parseInt(store_in_hours) > parseInt(hours))) {
804
805		if (parseInt(store_in_hours) > parseInt(hours)) {
806			if (store_in_mintss > mintss) {
807				hours_new = parseInt(store_in_hours) - parseInt(hours);
808				mintes_new = store_in_mintss - mintss;
809			} else {
810
811				hours_new = parseInt(store_in_hours) - parseInt(hours);
812				mintes_new = mintss - store_in_mintss;
813
814				hours_new = hours_new - 1;
815				hours_new = -Math.abs(hours_new);
816				mintes_new = 60 - mintes_new;
817				seconds = 60 - seconds;
818			}
819
820		} else if (parseInt(railway_hours) > parseInt(hours)) {
821
822			if (railway_mintss > mintss) {
823				hours_new = parseInt(railway_hours) - parseInt(hours);
824				mintes_new = railway_mintss - mintss;
825			} else {
826
827				hours_new = parseInt(railway_hours) - parseInt(hours);
828				mintes_new = mintss - railway_mintss;
829
830				hours_new = hours_new - 1;
831				mintes_new = 60 - mintes_new;
832				seconds = 60 - seconds;
833			}
834
835		} else {
836
837			if (railway_mintss > mintss) {
838				hours_new = parseInt(hours) - parseInt(railway_hours);
839				mintes_new = railway_mintss - mintss;
840			} else {
841				hours_new = parseInt(hours) - parseInt(railway_hours);
842				mintes_new = mintss - railway_mintss;
843			}
844			hours_new = -Math.abs(hours_new);
845
846		}
847
848	} else {
849
850		if (parseInt(railway_hours) > parseInt(hours)) {
851
852			if (railway_mintss > mintss) {
853				hours_new = parseInt(railway_hours) - parseInt(hours);
854				mintes_new = railway_mintss - mintss;
855			} else {
856
857				hours_new = parseInt(railway_hours) - parseInt(hours);
858				mintes_new = mintss - railway_mintss;
859
860				hours_new = hours_new - 1;
861
862				mintes_new = 60 - mintes_new;
863				seconds = 60 - seconds;
864			}
865
866		} else {
867
868			if (railway_mintss > mintss) {
869				hours_new = parseInt(hours) - parseInt(railway_hours);
870				mintes_new = railway_mintss - mintss;
871			} else {
872				hours_new = parseInt(hours) - parseInt(railway_hours);
873				mintes_new = mintss - railway_mintss;
874			}
875			hours_new = -Math.abs(hours_new);
876		}
877
878
879
880	}
881
882
883
884	var difference_str = '<span><b>' + hours_new + '</b>hrs</span> : <span><b>' + mintes_new + '</b> mins</span> : <span><b>' + seconds + '</b>  secs</span> ';
885	document.getElementById("counter_content").innerHTML = difference_str;
886
887
888
889}
890
891
892
893jQuery(document).ready(function () {
894	jQuery('.single_product_variations .field input[name="custom_calendar"]').click(function () {
895
896		currentdate = jQuery(this).val();
897		var today = new Date();
898		var new_date = new Date(currentdate);
899		diffTime = new_date.getTime() - today.getTime();
900		var time_variation = jQuery('.time_variation_start').map((_, el) => el.value).get();
901
902		if (diffTime || diffTime < 0) {
903
904			for (var timekey in time_variation) {
905				time_val = time_variation[timekey];
906				check_time_status = check_time_variations(currentdate, time_val);
907				var time_label = time_val.replace(".", "") + 'label';
908
909				if (check_time_status) {
910					var time_val = check_time_status;
911					if (time_val != 'no') {
912
913						jQuery('.' + time_label).removeClass('invalid_time');
914						jQuery('.' + time_label).css('pointer-events', 'none');
915						jQuery('.' + time_label).removeClass('active');
916					} else {
917						jQuery('.time_variations .choice ').css('pointer-events', 'all');
918					}
919				}
920
921			}
922
923		}
924
925	});
926
927});
928
929function check_store_date(values, store_end_time, time_zone) {
930
931	var currentdate = new Date();
932
933	var time_content = store_end_time.split(':');
934	values.setHours(time_content[0]);
935	values.setSeconds(time_content[1]);
936	values.setMinutes(00);
937
938
939	options = {
940		month: 'short',
941		day: 'numeric',
942		year: 'numeric',
943		hour: 'numeric',
944		minute: 'numeric',
945		second: 'numeric',
946		hour12: false,
947		timeZone: time_zone,
948	},
949		currentdates = new Intl.DateTimeFormat('en-US', options).format(currentdate);
950	cur_date_sec = get_date_time_format(currentdates, time_zone);
951
952
953
954	valuesdates = new Intl.DateTimeFormat('en-US', options).format(values);
955	values_date_sec = get_date_time_format(valuesdates, time_zone);
956
957
958	diffTime = values_date_sec - cur_date_sec;
959
960
961	if (diffTime < 0) {
962		return 'dayend';
963	} else {
964		return 'day';
965	}
966
967}
968
969function get_date_time_format(date, timezone) {
970	let DateTime = luxon.DateTime;
971	let fIn = 'MMM dd, yyyy, HH:mm:ss';
972
973	let d = DateTime.fromFormat(date, fIn, { zone: timezone });
974	let fOut = 'dd.MM.yyyy, HH:mm:ss ZZ';
975	d.toFormat(fOut);
976	return d.toFormat('X');
977}
978
979
980
981document.addEventListener("DOMContentLoaded", function () {
982	let items = document.querySelectorAll(".faq-main .faq-item");
983	items.forEach(function (item) {
984		item.addEventListener("click", function () {
985			items.forEach(function (el) {
986				el.classList.remove("faq-item-show");
987			});
988			if (!item.classList.contains("faq-item-show")) {
989				item.classList.add("faq-item-show");
990			}
991		});
992	});
993
994});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.