Model |
'+price.old+''+price.new);
}
}
/**
* Replace wrapper
*/
script.prev().remove().end().replaceWith(wrapper);
});
/**
* Tier prices support
*/
var tier = $('[data-product-id="' + id + '"]').parent('.product-info-price').next('.prices-tier:first');
if (tier.length)
{
var scripts = tier.find('script[type="text/template"]');
$.each(scripts, function(index, template)
{
var script = $(template), text = script.html(), wrapper = $(text);
/**
* Loop tier price(s)
*/
$.each(price.t, function(key, t)
{
/**
* Find price by benefit
*/
var exp = ['span.tier',t.price_id].join('-'), percent = $(exp);
if (percent.length)
{
percent.parents('.item:first').find('span.price').text(t.price);
}
});
/**
* Replace wrapper
*/
script.prev().remove().end().replaceWith(wrapper);
});
}
});
};
$.post('https://www.sentrycompany.cz/en/price/index/index/', { products: products }, priceRenderer, 'json');
}
})($);
}); |