<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">function OCTgeturlparam(param) {
	var urlParams = new URLSearchParams(window.location.search);
	return urlParams.get(param) !== null ? param+'='+urlParams.get(param) : '';
}
var OCT4_GET_LANG = '';
var prdvr_ur1201 = 'index.php?route=module/prdvr/';
var prdvr_url230 = 'index.php?route=extension/module/prdvr/';
var prdvr_url401 = 'index.php?route=extension/prdvr/module/prdvr|';
var prdvr_url402 = 'index.php?route=extension/prdvr/module/prdvr.';

var prdvr = {	
	'atgrid': function() {
  		var product_ids = [];
 		$("[onclick*='cart.add'], [onclick*='addToCart'], button[formaction*='checkout/cart.add']").each(function() {
			if($(this).closest('form').find("[name*='product_id']").length) {
				var product_id = $(this).closest('form').find("[name*='product_id']").val();	
				var target = $(this).closest('.product-thumb, .product-wrapper');
			} else if($(this).attr('onclick')) {
				var product_id = $(this).attr('onclick').match(/[0-9]+/).toString();
				var target = $(this).closest('.product-thumb, .product-wrapper');
			}
			if(target.length &amp;&amp; target.hasClass('main_prdvratgrid') == false) {
				target.addClass('main_prdvratgrid').addClass('main_prdvratgrid'+product_id);
				product_ids.push(product_id);
 			}
		});
		if(product_ids.length) { 
			//console.log(product_ids.length);
 			$.ajax({
				url: prdvr_url230 + 'getcache' + OCT4_GET_LANG,
				type: 'post',
				data: {product_ids:product_ids},
				cache: true,
				success: function(json) {
					if(json) {
						//console.log(json);
						$("[onclick*='cart.add'], [onclick*='addToCart'], button[formaction*='checkout/cart.add']").each(function() {
 							if($(this).closest('form').find("[name*='product_id']").length) {
								var product_id = $(this).closest('form').find("[name*='product_id']").val();	
								var target = $(this).closest('.product-thumb, .product-wrapper');
							} else if($(this).attr('onclick')) {
								var product_id = $(this).attr('onclick').match(/[0-9]+/).toString();
								var target = $(this).closest('.product-thumb, .product-wrapper');
							}	
							if(json['grid'] &amp;&amp; target.length &amp;&amp; target.find('.prdvr_griddiv').length == 0) {
								if(json['grid'][product_id]) {
									target.find('.short_description').after(json['grid'][product_id]);
								}
							}
						});
					}
				}
			});
		}		
  	},	
	'prodpage': function() {	
		var product_ids = [];
		var product_id = false;
		
		if($(".button-group-page input[name='product_id']").length) {
			product_id = $(".button-group-page input[name='product_id']").val();
			product_ids.push(product_id);
		} else if($('#input-product-id').length) {
			product_id = $('#input-product-id').val();
			product_ids.push(product_id);
		} else if($(".product-info input[name='product_id']").length) {
			product_id = $(".product-info input[name='product_id']").val();
			product_ids.push(product_id);
		} else if($("#product input[name='product_id']").length) {
			product_id = $("#product input[name='product_id']").val();
			product_ids.push(product_id);
		} 
			
		if (product_ids.length) {
			$.ajax({
				url: prdvr_url230 + 'getcache' + OCT4_GET_LANG,
				type: 'post',
				data: {product_ids:product_ids, pid:product_id, prdpgflag:1},
				cache: true,
				success: function(json) {
					if(json['prd']) {
						if(json['prd'][product_id]) {
							if($('.product-options h3.options-title').length) {
								$('.product-options h3.options-title').after(json['prd'][product_id]);
							} else if($('.button-group-page').length) {
								$('.button-group-page').before('&lt;div class="product-options"&gt;' + json['prd'][product_id] + '&lt;/div&gt;');
							} else {
								$('#product').prepend(json['prd'][product_id]);
							}
						}
					}
				}
			});
 		}
  	},
	'initjson': function() {
		prdvr.atgrid(); 
		$(document).ajaxStop(function() { prdvr.atgrid(); });
		prdvr.prodpage();
	}
}
$(document).ready(function() {
prdvr.initjson();
});</pre></body></html>