Skip to main content

Auto select default shipping method

More
11 years 4 months ago #202201 by gpraceman
-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.39

If I set "Auto select default shipping and payment methods" to Yes, it is not selecting the least expensive shipping option. I have USPS and FedEx shipping enabled, but it always selects the least expensive FedEx option, even if there is a less expensive USPS option.

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

More
11 years 4 months ago #202211 by nicolas
Hi,

When you set it to yes, it selects the first one of the list.
If USPS is less expensive than FedEx, then swap their ordering via the menu System>Shipping methods and that should do it.

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

More
11 years 4 months ago #202313 by gpraceman
If that is the case, then it is not working correctly. I have USPS ordered to display before FedEx.

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

More
11 years 4 months ago #202321 by Xavier
Hi,

Please provide screenshots of the shipping methods listing and the settings of FedEx and USPS.
This way we will be able to reproduce the issue on our end and debug that.

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

More
11 years 4 months ago - 11 years 4 months ago #202384 by gpraceman
Here's the screenshots.
Last edit: 11 years 4 months ago by gpraceman.

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

More
11 years 4 months ago #202386 by gpraceman
Here's one more.

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

More
11 years 4 months ago #202431 by Mohamed Thelji
Hello,
Can you clear your browser cache and try it again to be sure that it's not coming from it ?

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

More
11 years 4 months ago #202510 by gpraceman
I tried it on a different browser and deleting out the browser cache. It still selects the cheapest FedEx option, which is more expensive than the cheapest USPS option.

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

More
11 years 4 months ago - 11 years 4 months ago #202564 by Mohamed Thelji
Hello,
I succeed to reproduce your issue, the solution will be to edit the code of the "components\com_hikashop\views\checkout\view.html.php" file and change these lines :
Code:
foreach($shipping_groups as $key => $shipping_group) { $p = reset($shipping_group->shippings); foreach($usable_rates as $rate) { if($rate->shipping_id == $p) { $rates[] = $rate; $shipping_id[] = $rate->shipping_id.'@'.$key; $shipping_method[] = $rate->shipping_type.'@'.$key; break; } } }
To :
Code:
foreach($shipping_groups as $key => $shipping_group) { foreach($usable_rates as $rate) { if(in_array($rate->shipping_id, $shipping_group->shippings)) { $rates[] = $rate; $shipping_id[] = $rate->shipping_id.'@'.$key; $shipping_method[] = $rate->shipping_type.'@'.$key; break; } } }
Be sure to clear your cache before testing it.
Last edit: 11 years 4 months ago by Mohamed Thelji.

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

More
11 years 4 months ago - 11 years 4 months ago #202592 by gpraceman
I made that change, cleared the site cache, cleared the browser cache, cleared out the shopping cart, and still have the same problem.

I do notice a similar block of code in the &initCart() function that may also need changing.

Code:
foreach($shipping_groups as $key => $shipping_group) { $p = reset($shipping_group->shippings); foreach($usable_rates as $rate) { if($rate->shipping_id == $p && (!isset($rate->shipping_warehouse_id) || $rate->shipping_warehouse_id === $key)) { $rates[] = $rate; $shipping_ids[] = $rate->shipping_id.'@'.$key; $shipping_methods[] = $rate->shipping_type.'@'.$key; break; } } }
Last edit: 11 years 4 months ago by gpraceman.

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

More
11 years 4 months ago #202636 by Jerome
Hi,

The code you're currently mentioned has been tested and validated ; it does not require modification.
The code that Mohamed mentioned might need a modification but we still need to review it in order to be sure.

Because the code line:
Code:
if($rate->shipping_id == $p && (!isset($rate->shipping_warehouse_id) || $rate->shipping_warehouse_id === $key)) {
is working and has been highly tested. And if we change that line, it will break several features (including warehouses) and a lot of working stores in the same time.

Regards,

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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

More
11 years 4 months ago #202659 by gpraceman
I was just pointing out another similar chunk of code. This is obviously a bug and as such, each place where the problem could be occurring should be examined.

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

More
11 years 4 months ago #202661 by Jerome
Hi,

That's right ; and we will examine it with Mohamed who has reproduce the issue in his website.

Regards,

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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

More
11 years 3 months ago #204386 by gpraceman
Any update on this issue?

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

More
11 years 3 months ago #204512 by Mohamed Thelji
Hello,
Yes, I made a fix regarding that issue which will be available within few hours, so you'll just have to download the last Hikashop version through our website, install it and test it again.
Don't forget to clear your browser cache/session before testing it.

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

More
11 years 3 months ago #204619 by gpraceman
I downloaded and installed the latest package today and I am still having the same problem. I tried on two different browsers, even after clearing the browser cache.

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

More
11 years 3 months ago - 11 years 3 months ago #204827 by Mohamed Thelji
That's weird, the patch fixed that issue on my end, can you give me a temporary FTP access (through our contact form) to your website so that I can see if the patch was correctly applied.
If you're still having that issue despite the new patch, I'll be able to test it and to fix it on your end.
Thanks.
Last edit: 11 years 3 months ago by Mohamed Thelji.

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

More
11 years 3 months ago #205081 by gpraceman
PM sent

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

More
11 years 3 months ago #205138 by Mohamed Thelji
The patch wasn't applied on the "administrator\components\com_hikashop\classes\shipping.php" file, I just added it manually, can you test it again ?
Thanks.

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

More
11 years 3 months ago #205202 by gpraceman
That fixed the problem. Though, I would have thought that installing the latest package would have had the updated file in it.

I was going to add a free shipping option for those that wish to pickup their order in person. However, this does end up defaulting to that option, even though the vast majority of our customers are not local. I assume that there isn't a way to get this to default to the lowest rate that isn't zero, or is there?

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

Time to create page: 0.327 seconds
Powered by Kunena Forum