Have been doing some testing on the Klarna Checkout lately, and it's seems to be so buggy that it probably shouldn't have been released.
1. Shipping tax isn't handled correctly, even if it's only one VatTax +% defined and assigned to one shipping option. It doesn't send the tax value to Klarna, and it will always output a error to the logged in customers telling:
QuoteError vmError: KlarnaCheckout getTaxShipment: expecting math operation to be +% but is
This seems to be because $shipment_calc_id isn't defined ref.
http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.php#L247 (http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.php#L247)
function getTaxShipment($shipment_calc_id) {
// TO DO add shipmentTaxRate in the cart
// assuming there is only one rule +%
$db = JFactory::getDBO();
$q = 'SELECT * FROM #__virtuemart_calcs WHERE `virtuemart_calc_id`="' . $shipment_calc_id . '" ';
$db->setQuery($q);
$taxrule = $db->loadObject();
if ($taxrule->calc_value_mathop != "+%") {
VmError('KlarnaCheckout getTaxShipment: expecting math operation to be +% but is ' . $taxrule->calc_value_mathop);
}
return $taxrule->calc_value * 100;
}
Filling in the correct tax id directly in the query works as a workaround.
$q = 'SELECT * FROM #__virtuemart_calcs WHERE `virtuemart_calc_id`=1 ';
Don't know what the plan is/was, but even shops don't using tax, or don't have tax for shipping outside their own territory should be able to use this module - so requiring tax on it would be wrong anyway.
2. The system is always sending two error mails for each KCO order to store owner telling to look in error log, even if debug isn't activated, and there isn't any debug log. Those mails should only be sent when debug is active, or better have a own option for deactivation.
http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/administrator/components/com_virtuemart/plugins/vmpsplugin.php#L1299 (http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/administrator/components/com_virtuemart/plugins/vmpsplugin.php#L1299)
public function debugLog($message, $title='', $type = 'message', $doDebug=true) {
if ( isset($this->_currentMethod) and isset($this->_currentMethod->debug) and $this->_currentMethod->debug AND $doDebug) {
}
if ( isset($this->_currentMethod) and !$this->_currentMethod->log and $type !='error') {
//Do not log message messages if we are not in LOG mode
return;
}
if ( $type == 'error') {
$this->sendEmailToVendorAndAdmins();
}
$this->logInfo($title.': '.print_r($message,true), $type, true);
}
3. The debug file includes so much unneeded info, that it's really hard to read and identify the issues - often 100 KB per order ... and the debug will grove enormus in short time with the bugs that seems to be in there now.
4. Order history and comments is not added to the correct order. In a clean test site with only KCO-test, all is added to the first order. Only the first confimed message is added to the correct order. See image kco_comment_bug.png
5. On a live site the download links for packing slips is all going to testdrive: https://online.testdrive.klarna.com/packslips/ (https://online.testdrive.klarna.com/packslips/)....
6. Language files doesn't work. There's a bug in the core kco language file, giving bugs in all translations on Transifex:
VMPAYMENT_KLARNACHECKOUT_ERROR_AMOUNTS_SUBJECT="FEL med Klarna checkout"
But even if this is corrected manually the files will stopp KCO from working properly, t.ex. making it stop updating the orders on confirmed.
7. Debug choices in config use same language strings for both debug options, and the users have no clue what they do unless looking at the code. The last seems to be for saving the log file, the first I have no clue about - didn't care to figure out yet. See image kco_debug_option.png
Another thing is that the customers are forced to select a shipping option before Klarna Checkout can display, but when using shipping options requiring ZIP/Country, this doesn't work to well unless the customer register an address first. And so the effect of Klarna Checkout's simplified checkout process is partly lost...
There should be a field for entering zip, witch needs to be filled, before shipment options displays.
«Select shipping
[ ] Enter your zip code to see all available shipping options»
- This same zip field could then also post the zip to the Klarna Checkout field I guess...
Oh, and one more thing related to Klarna Checkout...
In cart after selecting Klarna Checkout, the requirement and display of TOS should be skipped/hidden, and same for the VM Checkout button - as both are handled in Klarna Checkout.
They only make it confusing, and if clicked they sends the customer to the VM registration process. Chances are big for the customer being annoyed and leaving the damn cart is quite big...
Thank you for your report, we take a look soon.
Please also note that the tax issue also applies to the older versions, for both Klarna and Klarna Checkout. Plus that normal Klarna (invoice/account) seems totally broken in VM3 ...
Tested on default demo install J2.5.28 + VM 3.0.7.4 from http://dev.virtuemart.net/projects/virtuemart/files
Using PHP 5.3.29 since it's required by this Klarna Module, according to the config screen.
Guest Checkout
Product Details Display:
Quote
The layout: productprice_layout does not exist in:
/templates/vmbeez5/html/payment/klarna/productprice_layout.php
/plugins/payment/klarna/tmpl/productprice_layout.php
/plugins/payment/klarna/klarna/tmpl/productprice_layout.php
Cart Display - One Page. No payment options displayed, only:
Quote
Notice: Undefined property: VirtueMartViewCart::$found_payment_method in /components/com_virtuemart/views/cart/tmpl/select_payment.php on line 61
Notice: Undefined property: VirtueMartViewCart::$payment_not_found_text in /components/com_virtuemart/views/cart/tmpl/select_payment.php on line 75
Normal Cart - Payment Selection:
Quote
The layout: payment_form does not exist in:
/templates/vmbeez5/html/payment/klarna/payment_form.php
/plugins/payment/klarna/tmpl/payment_form.php
/plugins/payment/klarna/klarna/tmpl/payment_form.php
Strict Standards: Non-static method KlarnaHandler::getKlarnaError() should not be called statically, assuming $this from incompatible context in /plugins/vmpayment/klarna/klarna/helpers/klarna_payments.php on line 231
Strict Standards: Non-static method KlarnaHandler::checkPartpriceCondition() should not be called statically, assuming $this from incompatible context in /plugins/vmpayment/klarna/klarna.php on line 379
Strict Standards: Non-static method KlarnaHandler::getKlarnaError() should not be called statically, assuming $this from incompatible context in /plugins/vmpayment/klarna/klarna/helpers/klarna_payments.php on line 231
Also test server parameter is missing for Klarna invoice/account...
One more thing,
Since Klarna is a invoicing service sending valid invoices to the customers, the module should have an option to send over the model number (SKU) instead of the product ID.
Many store owners don't have any realtion to the product ID in VirtueMart. They handle support calls, returns etc., based on model number (SKU).
Have discovered something who seems to be a quite bad issue with Klarna Checkout, who is cluttering up the database big time.
Sometimes it fails to create the order i VirtueMart, but the order is created and complete at Klarna Online - just missing an order number from VM. This is actually fine, good to have the order at least.
But now the problems starts as Klarna is sending updates for the order several times per day, and with the way the module seems to have been created this leads to a new insert in the virtuemart_orders table alone for each single update sent from Klarna - thus you will get lots of empty orders in VirtueMart for the failed orders.
It's really about time to get this module fixed, or removed, it's not stable at all it seems...
Oh... and for the orders being "OK", the log is filed up with lines like this:
Quote2015-06-18 21:25:32 ERROR vmError: No klarna data for this order: 6521
2015-06-18 21:25:32 ERROR plgVmOnUpdateOrderPayment: No klarna data for this order:6521
Hello
I am fixing it. I have contacted you by skype .
Hello Rune
i have fixed klarnachekout
there is one issue i am not able to reproduce it is the "KlarnaCheckout getTaxShipment: expecting math operation to be +% but is "
i will send you the new version via skype to test
Hello Rune,
I have sent you the link to download the plugin Klarnacheckout fixed.
This error "KlarnaCheckout getTaxShipment: expecting math operation to ..". i am not able to reproduce it
There is a debug+log option. If you set it on, and you have that error, send me the log file. it will give me some information to understand the error.
Thank you for the testing.
Hi Valérie, any news/progress on the VM3 version?
For the "KlarnaCheckout getTaxShipment: expecting math operation to .." remember that it only displays when the user is logged in.
And anyhow shipping tax is missing at Klarna Online also for guest, in the new VM2 version I got for testing.
Hello
The VM3 version is available here
https://www.dropbox.com/s/ac9b57282w9ewhc/com_virtuemart.3.0.10KCObeta1_ext_aio.zip?dl=0
the taxshipment issue is fixed for VM3.
I'll check for VM2 that issue tomorrow
there is still one issue which depend on your shipment configuration.
the issue is the following: if your shop has only shipment with countries, then vm has to wait until it gets the BT/ST address , and then the client can select the shipment
For example, if your shop uses UPS, it needs the ShipTo country, and shipto ZIP to return quotes
I am waiting for some replies from Klarna to finish that step.
OK, good - seems like tax issue is solved yes. At least it works in a "close to default" demo now.
But "Your payment for order %s has been confirmed by Klarna. Your reservation number is %s" is not inserted on the order status update, it only displays "Payment confirmed" - is it how it's supposed to be in beta mode, or is it a bug?
For the logo, isn't it better to use the eid and locale from the settings, in case there is seller/country/language specific logos or something influencing in future?
I mean for this one: http://dev.virtuemart.net/projects/virtuemart/repository/revisions/8893/diff/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout/tmpl/display_payment.php
One missing language strings in settings: VMPAYMENT_KLARNACHECKOUT_PAYMENT_LOGO_DISPLAY_TOOLTIP
Hello
Thanks for reporting. I am going to fix that.
Hi Valérie,
I noticed there was quite many, and some bigger changes to the codebase, for Klarna since the test version posted above. Some marked as WIP, but then no more changes during the latest weeks.
Is the module considered stable now, and can it be pulled out and used as it is? Or do the changes for Klarna rely on other changes in VirtueMart core, so we have to wait to the next stable release of VirtueMart before we can test and use it?
Hello Rune,
Yes it is true.
I made quite a lot of changes in the plugin, and we added some also in the core to make Klarna Checkout more user friendly.
I have to do some more testing ...and will give you a new version i hope this week.
OK, great Valérie. I'm glad to hear that it's made more user friendly.
For the new version, don't rush it for me. I'll probably take it slow a couple more weeks myself, I was just curious after looking briefly at the changes. Feel free to enjoy the summer if you can. :)
Noticed the 3.0.9.6 release, so I downloaded it and updated an existing 3.0.9.4 test site runing on Joomla! 3.4.3 with Klarna Checkout.
Entered and saved config.
Result was blank product info page and cart, nothing logged.
Thus I deleted the vmbeez5-template folder and uploaded it from the VirtueMart3.0.9.6_Joomla_2.5.28-Stable-Full_Package.zip, nothing changed.
So then I changed Joomla config to use developer on error reporting, resulting in the display of:
QuoteParse error: syntax error, unexpected '[', expecting ')' in /plugins/vmpayment/klarnacheckout/klarnacheckout.php on line 734
Hi Valérie, I wonder if Klarna Checkout is considered to be stable in VirtueMart 3.0.10?
T.ex. there are still some missing language strings in admin (language files downloaded today), and some not loaded from translation in cart it seems (like the select shipping first text). And the KCO displays on top of cart, instead of on the bottom, like we would believe from setting in the module. Which is annoying when shipping is required selected first.
Also when the new VM config 'Ajax for OPC' is activated, that seems to make KCO re-load all the time, so you can't fill anything. Disabling it makes the rest of the cart broken, t.ex. updating product quantity and deleting products doesn't work then.
Anyhow I wonder, since the documentation isn't updated, is there any special settings needed in VM configuration to make things work better? And if there is known issues or requirement, please let us know before we and other users waste a lot of time trying to update and figure it out. ;)
Missing language strings in module config:
VMPAYMENT_KLARNACHECKOUT_REFUND -> http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.xml#L77 (http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.xml#L77)
VMPAYMENT_KLARNACHECKOUT_PAYMENT_LOGO_DISPLAY_TOOLTIP -> http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.xml#L99 (http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.xml#L99)
VMPAYMENT_KLARNACHECKOUT_PAYMENT_FORM_SPECIFIC -> http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.xml#L108 (http://dev.virtuemart.net/projects/virtuemart/repository/entry/trunk/virtuemart/plugins/vmpayment/klarnacheckout/klarnacheckout.xml#L108)
Btw! What is that 'Display payment form position: Specific' (ref. last missing string) meant to do in VM, as it seems to do the same now as 'Right'?
OK, found something ...
It seems like the 'Using the Script ajax Countries / Regions' is causing the Ajax trouble, unselecting it makes the cart work with or without 'Ajax for OPC' selected.
So,'Using the Script ajax Countries / Regions' must be unselected when using KCO.
Also it seems like unselecting 'Using the VirtueMart jQuery' stops KCO from "loading twice", making it much faster. 'Use external google jQuery library' doesn't influence, so it can be selected instead if needed.
Now we only need to get KCO down to the bottom, where it's supposed to be when bottom is selected, and VM3.0.10 KCO might actually be useful.
Btw! Adding a 'Display payment form position: Top' could be good for those having fixed/simple shipping option(s).
Just for the record, all tests done in VirtueMart3.0.10_Joomla_2.5.28-Stable-Full_Package with Vmbeez5 and English, in Firefox.
UPDATE/CORRECTION! Sadly unselecting 'Using the VirtueMart jQuery' breaks the add to cart function, so then there is a jQuery conflict with KCO who needs to be handled in the cart.
Hello Rune
Yes i know. The development is not finished yet.
I had a meeting with klarna on monday to find a solution.
I should have added that in the release announcements that it is not finished
It's still unfinished? Did you give up on Klarna Valérie?
What I don't understand is why the unfinished code is in a stable release like 3.014 then, unless you have some workarounds to get it work better than the older versions ( like 3.0.8 )?