Files
kupshop/web/templates/elnino/block.karsa.tpl
2025-08-02 16:30:27 +02:00

38 lines
1.2 KiB
Smarty

<script>
//** BEGIN karsaMonitorCollector v5 **
(function() {
var supportJsHostUrl = "https://collector.karsa-monitor.com";
var d = document, g = d.createElement("script"), s = d.getElementsByTagName("script")[0];
g.type = "text/javascript";
g.async = true;
g.defer = true;
g.src = supportJsHostUrl + "/collector-api.js";
s.parentNode.insertBefore(g, s);
})();
//** END karsaMonitorCollector v5 **
</script>
{* jen na ordering.success.tpl *}
{if $order_success and $body.order.order_no}
<script>
window.karsaCollectorInit = function(karsaMonitorCollector) {
karsaMonitorCollector.sendOrder({$dbcfg.custom.karsaEhsopId}, '{$body.order.order_no}');
};
</script>
{/if}
{* jen na product.tpl *}
{if $karsa_products}
<script>
window.karsaCollectorInit = function(karsaMonitorCollector) {
{foreach $karsa_products as $product}
{if $product.inStore > 0}
karsaMonitorCollector.addProduct("{$product.code}", {$product.productPrice.value_with_vat->asFloat()});
{/if}
{/foreach}
karsaMonitorCollector.send({$dbcfg.custom.karsaEhsopId});
};
</script>
{/if}