Skip to content

Commit b4adfca

Browse files
committed
[*] MO : Bug fix for currency/language change
1 parent 67dfdf6 commit b4adfca

File tree

7 files changed

+78
-24
lines changed

7 files changed

+78
-24
lines changed

CHANGELOG

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.36Better support for killing sessions on language/currency changeHelping Danish customers with ssn1.8.35Company name fix1.8.34Remove hooks in checkout as they are included in shopping-cart.tpl.1.8.33Listen to PS_CUSTOMER_CREATION_EMAIL 1.8.32Footer logo fixes.Fix for NL and birthdayDocumentation improved1.8.31Newsletter boxEncoding issue for product namesDocumentation improvedAdded support for possible cronjob status checks pending orders1.8.30Link to legacy checkout in case of Klarna service interuption.1.8.29Update to carrier validation1.8.28Improvements on documentation1.8.27Removed some notices.Imporved company customer support in KPM.Added purifyHTML to voucher code.Changed the terms text for netherlands1.8.26Changed the flag for discountChanged the terms text for germanyFixed issue with genderlink to kco hidden if kco not active for selected country in default checkout.Fixed settings for checkout logo1.8.25changes to javascript for correct layout of discount prices in cart rows1.8.24Changes to orderstatuses on install1.8.23Autofix of default addresses on checkout pages.1.8.22Improvements to security1.8.21Reverse birthday year-month-day to day-month-year for Germany1.8.20move sum to variable.1.8.19pSQL added to push1.8.18Added simple hook for paymentEU.1.8.17Added issue with special chars in message field1.8.16Change expire field from int to varchar in install script.1.8.15Change expire field from int to varchar, due to Klarna sometimes sending - instead of empty value.1.8.14Added Deactivate for status selections.1.8.13Added support for gb iso code1.8.12Added support for minimum amount on orders.1.8.11Moved SQL Install script to sql folder.Added id_cart to klarna_orders table.Made some changes as to in what order klarna order information is saved to module tables. mainly to support different EIDs for SBM system.1.8.10Changed a link1.8.9Fixed an & sign1.8.8changed some tabs to spaces.1.8.7Added automatic meta on installation.1.8.6Fixed issue in kco_height.tpl1.8.5Name changesfilename changescoding standardsoptimization1.8.4Coding standardsUpdate on library1.8.3Save function for test flag moved.1.8.2moved libraries into libraries folder.1.8.1Removed a link in the backoffice.Moved test flag to common settings.1.8.0Cleaned up some more.1.7.0Added readmeCleaned up markupAdded texts explanations1.6.0Escape variablessome sql changesgetaddress fix1.5.0Fixed pclasses for Denmark1.4.0Added so that links are not replaced when KCO is not active.Added button for KCO address check.1.3.0Fixed some issues with kco UK1.2.0Changes to the layout1.1.0UK EID not always int.1.0.0First version for 1.6
1+
1.8.37Better support for killing sessions on language/currency change1.8.36Better support for killing sessions on language/currency changeHelping Danish customers with ssn1.8.35Company name fix1.8.34Remove hooks in checkout as they are included in shopping-cart.tpl.1.8.33Listen to PS_CUSTOMER_CREATION_EMAIL 1.8.32Footer logo fixes.Fix for NL and birthdayDocumentation improved1.8.31Newsletter boxEncoding issue for product namesDocumentation improvedAdded support for possible cronjob status checks pending orders1.8.30Link to legacy checkout in case of Klarna service interuption.1.8.29Update to carrier validation1.8.28Improvements on documentation1.8.27Removed some notices.Imporved company customer support in KPM.Added purifyHTML to voucher code.Changed the terms text for netherlands1.8.26Changed the flag for discountChanged the terms text for germanyFixed issue with genderlink to kco hidden if kco not active for selected country in default checkout.Fixed settings for checkout logo1.8.25changes to javascript for correct layout of discount prices in cart rows1.8.24Changes to orderstatuses on install1.8.23Autofix of default addresses on checkout pages.1.8.22Improvements to security1.8.21Reverse birthday year-month-day to day-month-year for Germany1.8.20move sum to variable.1.8.19pSQL added to push1.8.18Added simple hook for paymentEU.1.8.17Added issue with special chars in message field1.8.16Change expire field from int to varchar in install script.1.8.15Change expire field from int to varchar, due to Klarna sometimes sending - instead of empty value.1.8.14Added Deactivate for status selections.1.8.13Added support for gb iso code1.8.12Added support for minimum amount on orders.1.8.11Moved SQL Install script to sql folder.Added id_cart to klarna_orders table.Made some changes as to in what order klarna order information is saved to module tables. mainly to support different EIDs for SBM system.1.8.10Changed a link1.8.9Fixed an & sign1.8.8changed some tabs to spaces.1.8.7Added automatic meta on installation.1.8.6Fixed issue in kco_height.tpl1.8.5Name changesfilename changescoding standardsoptimization1.8.4Coding standardsUpdate on library1.8.3Save function for test flag moved.1.8.2moved libraries into libraries folder.1.8.1Removed a link in the backoffice.Moved test flag to common settings.1.8.0Cleaned up some more.1.7.0Added readmeCleaned up markupAdded texts explanations1.6.0Escape variablessome sql changesgetaddress fix1.5.0Fixed pclasses for Denmark1.4.0Added so that links are not replaced when KCO is not active.Added button for KCO address check.1.3.0Fixed some issues with kco UK1.2.0Changes to the layout1.1.0UK EID not always int.1.0.0First version for 1.6

config.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<module>
33
<name>klarnaofficial</name>
44
<displayName><![CDATA[Klarna]]></displayName>
5-
<version><![CDATA[1.8.36]]></version>
5+
<version><![CDATA[1.8.37]]></version>
66
<description><![CDATA[Gateway for Klarna (KCO and KPM).]]></description>
77
<author><![CDATA[Prestaworks AB]]></author>
88
<tab><![CDATA[payments_gateways]]></tab>

controllers/front/checkoutklarna.php

-11
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ public function setMedia()
3535

3636
public function postProcess()
3737
{
38-
if (
39-
Tools::isSubmit('isolang') ||
40-
Tools::isSubmit('id_lang') ||
41-
Tools::isSubmit('SubmitCurrency') ||
42-
Tools::isSubmit('id_currency')
43-
) {
44-
if (isset($_SESSION['klarna_checkout'])) {
45-
unset($_SESSION['klarna_checkout']);
46-
}
47-
Tools::redirect('index.php?fc=module&module=klarnaofficial&controller=checkoutklarna');
48-
}
4938
if (Tools::isSubmit('kco_change_country')) {
5039
$id_lang = 0;
5140
$id_currency = 0;

controllers/front/checkoutklarnauk.php

-11
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ public function setMedia()
3333

3434
public function postProcess()
3535
{
36-
if (
37-
Tools::isSubmit('isolang') ||
38-
Tools::isSubmit('id_lang') ||
39-
Tools::isSubmit('SubmitCurrency') ||
40-
Tools::isSubmit('id_currency')
41-
) {
42-
if (isset($_SESSION['klarna_checkout'])) {
43-
unset($_SESSION['klarna_checkout']);
44-
}
45-
Tools::redirect('index.php?fc=module&module=klarnaofficial&controller=checkoutklarna');
46-
}
4736
if (Tools::isSubmit('kco_change_country')) {
4837
$id_lang = 0;
4938
$id_currency = 0;

override/classes/Tools.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
class Tools extends ToolsCore
3+
{
4+
public static function switchLanguage(Context $context = null)
5+
{
6+
if (isset($_SESSION['klarna_checkout'])) {
7+
unset($_SESSION['klarna_checkout']);
8+
}
9+
return parent::switchLanguage($context);
10+
}
11+
public static function setCurrency($cookie)
12+
{
13+
if (isset($_SESSION['klarna_checkout'])) {
14+
unset($_SESSION['klarna_checkout']);
15+
}
16+
return parent::setCurrency($cookie);
17+
}
18+
}

override/classes/index.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/**
4+
* 2015 Prestaworks AB.
5+
*
6+
* NOTICE OF LICENSE
7+
*
8+
* This source file is subject to the Academic Free License (AFL 3.0)
9+
* that is bundled with this package in the file LICENSE.txt.
10+
* It is also available through the world-wide-web at this URL:
11+
* http://opensource.org/licenses/afl-3.0.php
12+
* If you did not receive a copy of the license and are unable to
13+
* obtain it through the world-wide-web, please send an email
14+
* to [email protected] so we can send you a copy immediately.
15+
*
16+
* @author Prestaworks AB <[email protected]>
17+
* @copyright 2015 Prestaworks AB
18+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19+
* International Registered Trademark & Property of Prestaworks AB
20+
*/
21+
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
22+
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
23+
24+
header('Cache-Control: no-store, no-cache, must-revalidate');
25+
header('Cache-Control: post-check=0, pre-check=0', false);
26+
header('Pragma: no-cache');
27+
28+
header('Location: ../');
29+
exit;

override/index.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/**
4+
* 2015 Prestaworks AB.
5+
*
6+
* NOTICE OF LICENSE
7+
*
8+
* This source file is subject to the Academic Free License (AFL 3.0)
9+
* that is bundled with this package in the file LICENSE.txt.
10+
* It is also available through the world-wide-web at this URL:
11+
* http://opensource.org/licenses/afl-3.0.php
12+
* If you did not receive a copy of the license and are unable to
13+
* obtain it through the world-wide-web, please send an email
14+
* to [email protected] so we can send you a copy immediately.
15+
*
16+
* @author Prestaworks AB <[email protected]>
17+
* @copyright 2015 Prestaworks AB
18+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19+
* International Registered Trademark & Property of Prestaworks AB
20+
*/
21+
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
22+
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
23+
24+
header('Cache-Control: no-store, no-cache, must-revalidate');
25+
header('Cache-Control: post-check=0, pre-check=0', false);
26+
header('Pragma: no-cache');
27+
28+
header('Location: ../');
29+
exit;

0 commit comments

Comments
 (0)