Skip to content

Commit 67dfdf6

Browse files
committed
[*] MO : Minor changes
1 parent 1e1492f commit 67dfdf6

14 files changed

+73
-32
lines changed

CHANGELOG

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
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.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.33]]></version>
5+
<version><![CDATA[1.8.36]]></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,6 +35,17 @@ 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+
}
3849
if (Tools::isSubmit('kco_change_country')) {
3950
$id_lang = 0;
4051
$id_currency = 0;

controllers/front/checkoutklarnauk.php

+11
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ 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+
}
3647
if (Tools::isSubmit('kco_change_country')) {
3748
$id_lang = 0;
3849
$id_currency = 0;

controllers/front/kpmpartpayment.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,9 @@ public function initContent()
265265
$houseext
266266
);
267267

268-
if (Tools::getValue('kpm_company') != "") {
268+
if (Tools::getValue('kpm_company')!="") {
269269
$addr->setCompanyName(utf8_decode(Tools::getValue('kpm_company')));
270+
$addr->isCompany = true;
270271
}
271272

272273
$k->setAddress(KlarnaFlags::IS_BILLING, $addr);
@@ -283,8 +284,13 @@ public function initContent()
283284
}
284285
$k->setEstoreInfo('', $this->context->cart->id, '');
285286
$payed_amount = number_format($this->context->cart->getOrderTotal(true, 3), 2, '.', '');
287+
288+
$ssn = ''.Tools::getValue('kpm_ssn', Tools::getValue('kpm_birthdate'));
289+
if ($klarnaCountry == 'DK') {
290+
$ssn = str_replace("-","", $ssn);
291+
}
286292
$result = $k->reserveAmount(
287-
''.Tools::getValue('kpm_ssn', Tools::getValue('kpm_birthdate')),
293+
$ssn,
288294
$gender,
289295
-1,
290296
KlarnaFlags::NO_FLAG,
@@ -661,6 +667,16 @@ public function initContent()
661667
$newPclass['logo']['uri'] = $logourl;
662668
$data['payment_methods'][] = $newPclass;
663669
}
670+
} else {
671+
if ($country->iso_code == "DE") {
672+
$use_case = Tools::file_get_contents(dirname(__FILE__)."/../../libraries/germanterms.txt");
673+
$use_case = str_replace("(eid)", $eid, $use_case);
674+
$this->context->smarty->assign('special_usecase', $use_case);
675+
} elseif ($country->iso_code == "NL") {
676+
$use_case = Tools::file_get_contents(dirname(__FILE__)."/../../libraries/netherlandsterms.txt");
677+
$use_case = str_replace("(url)", $this->context->shop->virtual_uri, $use_case);
678+
$this->context->smarty->assign('special_usecase', $use_case);
679+
}
664680
}
665681

666682
$kpm_pclasses = $data['payment_methods'];

doc/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Klarna Official PrestaShop - Documentation</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="description" content="">
8-
<meta name="author" content="Ivor">
8+
<meta name="author" content="Prestaworks AB">
99

1010
<!-- Le styles -->
1111
<link href="assets/css/bootstrap.css" rel="stylesheet">
@@ -57,7 +57,7 @@
5757
<div class="masthead">
5858
<h1>Klarna Official for PrestaShop</h1>
5959
<p class="marketing-byline">Klarna Official for PrestaShop Documentation</p>
60-
<p>PrestaShop Module User Guide for v1.8.20</p>
60+
<p>PrestaShop Module User Guide</p>
6161
</div>
6262

6363
<div id="intro">
@@ -276,7 +276,7 @@ <h3>Important about callbacks</h3>
276276
<div class="page-header">
277277
<h1>Changelog <small>A road-map on updates for Klarna Official - PrestaShop</small></h1>
278278
</div>
279-
<p><a href="../modules/klarnaofficial/CHANGELOG" target="_blank">Open Changelog</a></p>
279+
<p><a href="../CHANGELOG" target="_blank">Open Changelog</a></p>
280280

281281
</section>
282282

klarnaofficial.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct()
2727
{
2828
$this->name = 'klarnaofficial';
2929
$this->tab = 'payments_gateways';
30-
$this->version = '1.8.33';
30+
$this->version = '1.8.36';
3131
$this->author = 'Prestaworks AB';
3232
$this->module_key = '0969b3c2f7f0d687c526fbcb0906e204';
3333
$this->need_instance = 1;

libraries/germanterms.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@ Jahreszins 18,07%* und Gesamtbetrag 218,57€*
88
Standardinformationen für Verbraucherkredite.</a>
99
Übersteigt Ihr Einkauf mit Klarna Ratenkauf erstmals einen Betrag von 199,99 €
1010
erhalten Sie von Klarna einen Ratenkaufver trag mit der Bitte um
11-
Unterzeichnung zugesandt. Ihr Kauf gilt solange als Rechnungskauf.
11+
Unterzeichnung zugesandt. Ihr Kauf gilt solange als Rechnungskauf.
12+
<br /><br />
13+
<input type="checkbox" onchange="checkRequirementsDE();" id="requirementsDE" />
14+
Mit der Übermittlung der für die Abwicklung der gewählten Klarna
15+
Zahlungsmethode und einer Identitäts- und Bonitätsprüfung erforderlichen
16+
Daten an Klarna bin ich einverstanden. Meine <a href="https://cdn.klarna.com/1.0/shared/content/legal/terms/(eid)/de_de/consent"
17+
target="_blank" class="kpm_terms_link">Einwilligung</a> kann ich jederzeit mit Wirkung für die Zukunft widerrufen.
18+
Es gelten die AGB des Händlers.

views/img/loader.gif

111 KB
Loading

views/js/klarna_checkout.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ $(document).ready(function()
2424
//$("#kco_cart_summary_div a.cart_quantity_input").typeWatch({ highlight: true, wait: 600, captureLength: 0, callback: function(val) { updateQty(val, true, this.el); } });
2525
});
2626

27-
27+
function showLoaderImg()
28+
{
29+
$("#checkoutdiv").html('');
30+
}
2831
function downQuantity(id, qty)
2932
{
33+
showLoaderImg();
3034
var val = $('input[name=quantity_'+id+']').val();
3135
var newVal = val;
3236
if(typeof(qty) === 'undefined' || !qty)
@@ -116,6 +120,7 @@ function downQuantity(id, qty)
116120

117121
function upQuantity(id, qty)
118122
{
123+
showLoaderImg();
119124
if (typeof(qty) === 'undefined' || !qty)
120125
qty = 1;
121126
var customizationId = 0;
@@ -404,6 +409,7 @@ function updateCartSummary(json)
404409

405410
function deleteProductFromSummary(id)
406411
{
412+
showLoaderImg();
407413
var customizationId = 0;
408414
var productId = 0;
409415
var productAttributeId = 0;

views/js/kpm_common.js

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
1717
* International Registered Trademark & Property of Prestaworks AB
1818
*/
19+
function checkRequirementsDE()
20+
{
21+
if($("#requirementsDE").is(":checked")) {
22+
$("#confirmkpm").show();
23+
} else {
24+
$("#confirmkpm").hide();
25+
}
26+
}
1927
function showinfobox(pclass)
2028
{
2129
$("#kpm_displaybox").html($("#kpm_infobox_"+pclass).html());

views/templates/front/kco_height.tpl

-10
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,6 @@
128128
</form><!-- /#klarnagift -->
129129
</div>
130130
{/if}
131-
<div id="HOOK_SHOPPING_CART">
132-
{$HOOK_SHOPPING_CART}
133-
</div><!-- /#HOOK_SHOPPING_CART -->
134-
{if !empty($HOOK_SHOPPING_CART_EXTRA)}
135-
<div class="cart_navigation_extra clear">
136-
<div id="HOOK_SHOPPING_CART_EXTRA">
137-
{$HOOK_SHOPPING_CART_EXTRA}
138-
</div><!-- /#HOOK_SHOPPING_CART_EXTRA -->
139-
</div><!-- /.cart_navigation_extra -->
140-
{/if}
141131
</div><!-- /.row -->
142132
</div><!-- /.col-xs-12-->
143133
{if isset($delivery_option_list)}

views/templates/front/kco_twocolumns.tpl

-11
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,6 @@
214214
</p>
215215
</form><!-- /#klarnagift -->
216216
</div><!-- /.gift_container.kco-box -->
217-
{/if}
218-
<div id="HOOK_SHOPPING_CART">
219-
{$HOOK_SHOPPING_CART}
220-
</div><!-- /#HOOK_SHOPPING_CART -->
221-
222-
{if !empty($HOOK_SHOPPING_CART_EXTRA)}
223-
<div class="cart_navigation_extra clear">
224-
<div id="HOOK_SHOPPING_CART_EXTRA">
225-
{$HOOK_SHOPPING_CART_EXTRA}
226-
</div><!-- /#HOOK_SHOPPING_CART_EXTRA -->
227-
</div><!-- /.cart_navigation_extra -->
228217
{/if}
229218
</div><!-- /.col-xs-12.col-md-4 -->
230219
<div class="col-xs-12 col-md-8" id="checkoutdiv">

views/templates/front/kpm_partpayment.tpl

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
<a href="{$kpm_plan.terms.uri|escape:'htmlall':'UTF-8'}{if $kpm_plan.pclass_id==-1}{$klarna_invoice_fee|escape:'htmlall':'UTF-8'}{/if}" target="_blank" class="kpm_terms_link">({l s='Terms' mod='klarnaofficial'})</a>
3636
{if $kpm_plan.use_case != ''}<br /><label class="alert alert-success">{$kpm_plan.use_case|escape:'quotes':'UTF-8'}</label>{/if}<br />
3737
{/foreach}
38+
{if isset($special_usecase)}
39+
<label class="alert alert-success">{$special_usecase|escape:'quotes':'UTF-8'}</label>
40+
{/if}
3841
</div>
3942

4043
<div class="col-xs-4 col-lg-4">
@@ -155,7 +158,7 @@
155158
</div>
156159
<p class="cart_navigation clearfix">
157160
<a class="button-exclusive btn btn-default" href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}"><i class="icon-chevron-left"></i>{l s='Other payment methods' mod='klarnaofficial'}</a>
158-
<button name="confirmkpm" id="confirmkpm" class="button btn btn-default button-medium" type="submit">
161+
<button name="confirmkpm" id="confirmkpm" class="button btn btn-default button-medium{if $kpm_iso_code=='DE' || $kpm_iso_code=='de'} hidden{/if}" type="submit">
159162
<span>{l s='I confirm my order' mod='klarnaofficial'}<i class="icon-chevron-right right"></i></span>
160163
</button>
161164
</p>

0 commit comments

Comments
 (0)