diff --git a/CHANGELOG b/CHANGELOG index fea95f5..1b4e110 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +4.2.8 + - FN-14209 Fixed some bugs. + 4.2.7 - FN-13956 Minor fixes and improvements. diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d052ee..b1fffa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [4.2.8](https://github.com/comfino/PrestaShop/tree/4.2.8) (2026-03-04) + +[Full Changelog](https://github.com/comfino/PrestaShop/compare/4.2.7...4.2.8) + +**Merged pull requests:** + +- FN-14209 Fixed some bugs. [\#112](https://github.com/comfino/PrestaShop/pull/112) ([pkaluzinski-comfino](https://github.com/pkaluzinski-comfino)) + ## [4.2.7](https://github.com/comfino/PrestaShop/tree/4.2.7) (2026-01-09) [Full Changelog](https://github.com/comfino/PrestaShop/compare/4.2.6...4.2.7) diff --git a/comfino.php b/comfino.php index 64cb25f..217d096 100644 --- a/comfino.php +++ b/comfino.php @@ -37,11 +37,11 @@ } if (!defined('COMFINO_VERSION')) { - define('COMFINO_VERSION', '4.2.7'); + define('COMFINO_VERSION', '4.2.8'); } if (!defined('COMFINO_BUILD_TS')) { - define('COMFINO_BUILD_TS', 1769081918); + define('COMFINO_BUILD_TS', 1772632040); } if (!defined('WIDGET_INIT_SCRIPT_HASH')) { @@ -63,7 +63,7 @@ public function __construct() { $this->name = 'comfino'; $this->tab = 'payments_gateways'; - $this->version = '4.2.7'; + $this->version = '4.2.8'; $this->author = 'Comfino'; $this->module_key = '3d3e14c65281e816da083e34491d5a7f'; diff --git a/views/js/front/paywall-init.js b/views/js/front/paywall-init.js index e80a028..1f248f7 100644 --- a/views/js/front/paywall-init.js +++ b/views/js/front/paywall-init.js @@ -51,7 +51,7 @@ window.ComfinoPaywallInit = { priceModifier = parseInt(frontendInitElement.dataset.priceModifier); if (!Number.isNaN(priceModifier)) { - iframe.src += ('&priceModifier=' + priceModifier); + iframe.src += ((iframe.src.includes('?') ? '&' : '?') + 'priceModifier=' + priceModifier); } else { priceModifier = 0; } diff --git a/views/js/front/paywall-init.min.js b/views/js/front/paywall-init.min.js index d022406..e370077 100644 --- a/views/js/front/paywall-init.min.js +++ b/views/js/front/paywall-init.min.js @@ -3,7 +3,7 @@ @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ window.ComfinoPaywallInit={init:()=>{const a=document.getElementById("comfino-iframe-container");document.getElementById("comfino-iframe-container")?.querySelector("#comfino-paywall-container")?.remove();if(null==a)ComfinoPaywallFrontend.logEvent("Comfino paywall iframe container not found.","warning");else if(null!==a.querySelector("#comfino-paywall-container")&&ComfinoPaywallFrontend.isFrontendInitSet())ComfinoPaywallFrontend.logEvent("Comfino paywall iframe already initialized.","info",a);else{var b= -ComfinoPaywallFrontend.createPaywallIframe(ComfinoPaywallData.paywallUrl,ComfinoPaywallData.paywallOptions),f=document.getElementById("pay-with-comfino")??document.querySelector('input[data-module-name^="comfino"]'),d=0;"priceModifier"in f.dataset&&(d=parseInt(f.dataset.priceModifier),Number.isNaN(d)?d=0:b.src+="&priceModifier="+d);ComfinoPaywallData.paywallOptions.onUpdateOrderPaymentState=c=>{ComfinoPaywallFrontend.logEvent("updateOrderPaymentState PrestaShop","debug",c);const k=new URL(ComfinoPaywallData.paywallStateUrl), -g=new FormData;c={loan_amount:c.loanAmount,loan_type:c.loanType,loan_term:c.loanTerm,price_modifier:d};for(let e in c)g.append(e,c[e]);const h=k.toString();fetch(h,{method:"POST",body:g}).then(e=>{ComfinoPaywallFrontend.logEvent("updateOrderPaymentState PrestaShop","debug",h,e)})};a.appendChild(b);ComfinoPaywallFrontend.init(f,b,ComfinoPaywallData.paywallOptions)}},initWithObserver:()=>{ComfinoPaywallInit.init();if(!ComfinoPaywallFrontend.isFrontendInitSet()){var a=document.getElementById("pay-with-comfino")?? -document.querySelector('input[data-module-name^="comfino"]');if(a){ComfinoPaywallFrontend.logEvent("Paywall initialization with 'display' prop observer.","debug");const b=new MutationObserver(()=>{"block"===getComputedStyle(a).display&&(ComfinoPaywallInit.init(),ComfinoPaywallFrontend.isFrontendInitSet()&&b.disconnect())});b.observe(a,{attributes:!0,attributeFilter:["style"]})}}}}; +ComfinoPaywallFrontend.createPaywallIframe(ComfinoPaywallData.paywallUrl,ComfinoPaywallData.paywallOptions),f=document.getElementById("pay-with-comfino")??document.querySelector('input[data-module-name^="comfino"]'),d=0;"priceModifier"in f.dataset&&(d=parseInt(f.dataset.priceModifier),Number.isNaN(d)?d=0:b.src+=(b.src.includes("?")?"&":"?")+"priceModifier="+d);ComfinoPaywallData.paywallOptions.onUpdateOrderPaymentState=c=>{ComfinoPaywallFrontend.logEvent("updateOrderPaymentState PrestaShop","debug", +c);const k=new URL(ComfinoPaywallData.paywallStateUrl),g=new FormData;c={loan_amount:c.loanAmount,loan_type:c.loanType,loan_term:c.loanTerm,price_modifier:d};for(let e in c)g.append(e,c[e]);const h=k.toString();fetch(h,{method:"POST",body:g}).then(e=>{ComfinoPaywallFrontend.logEvent("updateOrderPaymentState PrestaShop","debug",h,e)})};a.appendChild(b);ComfinoPaywallFrontend.init(f,b,ComfinoPaywallData.paywallOptions)}},initWithObserver:()=>{ComfinoPaywallInit.init();if(!ComfinoPaywallFrontend.isFrontendInitSet()){var a= +document.getElementById("pay-with-comfino")??document.querySelector('input[data-module-name^="comfino"]');if(a){ComfinoPaywallFrontend.logEvent("Paywall initialization with 'display' prop observer.","debug");const b=new MutationObserver(()=>{"block"===getComputedStyle(a).display&&(ComfinoPaywallInit.init(),ComfinoPaywallFrontend.isFrontendInitSet()&&b.disconnect())});b.observe(a,{attributes:!0,attributeFilter:["style"]})}}}}; "complete"===document.readyState?ComfinoPaywallInit.initWithObserver():document.addEventListener("readystatechange",()=>{"complete"===document.readyState&&ComfinoPaywallInit.initWithObserver()});