Skip to main content

No update shipping costs in checkout when changing shipping method

9 years 4 months ago #272693 by evn64
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 5.6.30
-- Browser(s) name and version -- : Safari 10.1

If I understand correctly the new checkout from Hikashop 3.x updates the checkout form without refreshing the page manually.
Unfortunately this doesn't work in my website.

For testing I have made a clean Joomla install, installed only Hikashop and used the Protostar template. Attached is an image of the legacy settings.

Do you have an idea what goes wrong here?

Rgds, Eric

Please Log in or Create an account to join the conversation.

9 years 4 months ago #272704 by Jerome
Hello,

Can you please check your view "checkout / show_block_shipping" and look for the line
Code:
var url = "<?php echo hikashop_completeLink('checkout&task=submitblock&blocktask=shipping'.$this->cartIdParam.'&Itemid='.$this->itemid, 'ajax', false, true); ?>",
The second parameter of the function is "ajax" and it allows to generate an URL in Ajax context.
But in your website, the result URL is "tmpl=component", while it should be "tmpl=ajax" or "tmpl=raw".

So because the parameter "tmpl" is wrong, the return is not what the shipping system is expecting and that's why the cart is not refreshing.

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

9 years 4 months ago #272739 by evn64
Hello Jerome,

I have checked the view 'checkout/show_block_shipping'. But the line there is exactly as in your example.

I have checked the function that builds the URL: hikashop_completeLink in administrator/components/com_hikashop/helpers/helper.php
Code:
function hikashop_completeLink($link, $popup = false, $redirect = false, $js = false, $frontend = false){ if($popup) $link .= '&tmpl=component';

I put an 'echo $link' under this line to see what this function does. And it echoed an URL with &tmpl=ajax on the end. But in looking in the script there was still '&tmpl=component' at the end of the URL.

However changing the second line to
Code:
if($popup) $link .= '&tmpl=ajax';
did the trick and the URL in the script has '&tmpl=ajax' at the end and then the checkout refreshes fine, like you said it would. But I can't imagine such a newbie-non-programmer hack is the solution for my problem. So I removed all the changes.

So I'm still puzzled. Do I need to change something in the configuration of Hikashop? Or is something else wrong?

Rgds, Eric

Please Log in or Create an account to join the conversation.

9 years 4 months ago #272754 by nicolas
Hi,

The beginning of the hikashop_completeLink function is not like that.
It is:
Code:
function hikashop_completeLink($link, $popup = false, $redirect = false, $js = false, $frontend = false){ if($popup === 'ajax') $link .= '&tmpl=raw'; else if($popup) $link .= '&tmpl=component';
If you don't have that code, then either you have an old version of HikaShop and not the 3.1.1, or you have the latest but the file administrator/components/com_hikashop/helpers/helper.php was not updated during the update for some reason.
At the top of that file, you'll find the version of HikaShop for which that file was generated on our end so you can check that.

Please Log in or Create an account to join the conversation.

9 years 4 months ago #272785 by evn64
Hello Nicolas,

I have checked and at the top it says 3.1.1. To be sure I have downloaded Hikashop Business edition this morning again and unpacked it. When looking in de file 'back/helpers/helper.php it says on line 918:
Code:
function hikashop_completeLink($link, $popup = false, $redirect = false, $js = false, $frontend = false){ if($popup) $link .= '&tmpl=component'; $link = 'index.php?option='.HIKASHOP_COMPONENT.'&ctrl='.$link; $config = hikashop_config(); $app = JFactory::getApplication(); if($frontend && $app->isAdmin()){ static $mainurl = ''; static $otherarguments = false; if(empty($mainurl)){ $urls = parse_url(HIKASHOP_LIVE); if(isset($urls['path']) AND strlen($urls['path'])>0){ $mainurl = substr(HIKASHOP_LIVE,0,strrpos(HIKASHOP_LIVE,$urls['path'])).'/'; $otherarguments = trim(str_replace($mainurl,'',HIKASHOP_LIVE),'/'); if(strlen($otherarguments) > 0) $otherarguments .= '/'; }else{ $mainurl = HIKASHOP_LIVE; } } if($otherarguments && strpos($link,$otherarguments) === false){ $link = $otherarguments.$link; } $ret = $mainurl.$link; }else{ $ret = JRoute::_($link,!$redirect); } if($js) return str_replace('&amp;', '&', $ret); return $ret; }

See attachment.

Kind regards, Eric

Please Log in or Create an account to join the conversation.

9 years 4 months ago #272799 by nicolas
Hi,

Ah yes, I see. I was looking at a wrong branch on our versionning system.
I see the issue is a error with the handling of the merges.
I4ve added a patch to the install package on our website. It should work fine now.

Please Log in or Create an account to join the conversation.

9 years 4 months ago - 9 years 4 months ago #273508 by Jabatec
Hi,
I had the same problem and now it is solved.
Plugins shipping and pay, when select and refresh during checkout, not work fine.

Plugins pay
- HikaShop bank transfer payment plugin
- HikaShop Paypal payment plugin
- HikaShop collect on delivery payment plugin

Plugins shipping
- HikaShop manual shipping plugin

Updating the version today July 07, problem solved .
My version > hikashop_business_v3.1.1_2017-07-07

Attached my configuration legacy

Javier Ballester
Last edit: 9 years 4 months ago by Jabatec.
The following user(s) said Thank You: Philip

Please Log in or Create an account to join the conversation.

9 years 4 months ago #273633 by vyatka

Please Log in or Create an account to join the conversation.

9 years 4 months ago #273719 by Jerome
Hello,

Can you please provide the HikaShop version number (and build number) you're using ?
See : www.hikashop.com/support/documentation/5...onfig.html#main_main

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

Time to create page: 0.145 seconds
Powered by Kunena Forum