This commit is contained in:
2026-04-01 12:48:10 +02:00
parent acef745ccc
commit 4a2135cf13
6 changed files with 58 additions and 40 deletions

View File

@@ -1,4 +1,4 @@
<?php
<?php
/**
* Cross Sell PRO module for cart page upsell.
*

View File

@@ -10,7 +10,13 @@
>
<div class="card-block">
<div class="crosssellpro-header">
<h2 class="h4 crosssellpro-title">{l s='Produkty, ktore moga Ci sie przydac' mod='crosssellpro'}</h2>
<h2 class="h4 crosssellpro-title">
{if $crosssellpro_is_checkout}
{l s='Ostatnia szansa na pełen komfort snu' mod='crosssellpro'}
{else}
{l s='Klienci, ktorzy kupili ten materac, wybierali tez:' mod='crosssellpro'}
{/if}
</h2>
<div class="crosssellpro-nav" aria-hidden="true">
<button type="button" class="crosssellpro-nav-btn js-crosssellpro-prev" aria-label="{l s='Poprzednie produkty' mod='crosssellpro'}">&lsaquo;</button>
<button type="button" class="crosssellpro-nav-btn js-crosssellpro-next" aria-label="{l s='Nastepne produkty' mod='crosssellpro'}">&rsaquo;</button>
@@ -68,3 +74,4 @@
</div>
</section>
{/if}

View File

@@ -86,6 +86,16 @@ var as4Plugin = {
// Prevent some action to be done if search is triggered from back/forward event
getASFormOptionsCompleteCallBack: function(arg1) {
as4Plugin.fromBackForwardEvent = false;
// Safety net: always remove loader/blur at the end of an AJAX cycle.
as4Plugin.removeLayer();
},
// Ajax error callback
showAsError: function(xhr, statusText, errorThrown) {
as4Plugin.removeLayer();
if (typeof(window.console) !== 'undefined' && typeof(window.console.error) === 'function') {
window.console.error('[AS4] AJAX error', statusText, errorThrown, xhr);
}
},
// Get Ajax dynamic parameters
@@ -93,6 +103,7 @@ var as4Plugin = {
return {
beforeSubmit: as4Plugin.showAsRequest,
success: as4Plugin.showAsResponse,
error: as4Plugin.showAsError,
complete: as4Plugin.getASFormOptionsCompleteCallBack,
localCache: as4Plugin.localCache,
localCacheKey: as4Plugin.localCacheKey,
@@ -113,6 +124,8 @@ var as4Plugin = {
return {
beforeSubmit: as4Plugin.showAsRequest,
success: as4Plugin.showAsResponse,
error: as4Plugin.showAsError,
complete: as4Plugin.getASFormOptionsCompleteCallBack,
localCache: as4Plugin.localCache,
localCacheKey: as4Plugin.localCacheKey,
cacheTTL: 2,

View File

@@ -81,6 +81,16 @@ var as4Plugin = {
// Prevent some action to be done if search is triggered from back/forward event
getASFormOptionsCompleteCallBack: function(arg1) {
as4Plugin.fromBackForwardEvent = false;
// Safety net: always remove loader/blur at the end of an AJAX cycle.
as4Plugin.removeLayer();
},
// Ajax error callback
showAsError: function(xhr, statusText, errorThrown) {
as4Plugin.removeLayer();
if (typeof(window.console) !== 'undefined' && typeof(window.console.error) === 'function') {
window.console.error('[AS4] AJAX error', statusText, errorThrown, xhr);
}
},
// Get Ajax dynamic parameters
@@ -88,6 +98,7 @@ var as4Plugin = {
return {
beforeSubmit: as4Plugin.showAsRequest,
success: as4Plugin.showAsResponse,
error: as4Plugin.showAsError,
complete: as4Plugin.getASFormOptionsCompleteCallBack,
localCache: as4Plugin.localCache,
localCacheKey: as4Plugin.localCacheKey,
@@ -108,6 +119,8 @@ var as4Plugin = {
return {
beforeSubmit: as4Plugin.showAsRequest,
success: as4Plugin.showAsResponse,
error: as4Plugin.showAsError,
complete: as4Plugin.getASFormOptionsCompleteCallBack,
localCache: as4Plugin.localCache,
localCacheKey: as4Plugin.localCacheKey,
cacheTTL: 2,
@@ -1233,4 +1246,4 @@ var as4Plugin = {
}
}
}
}