Post by yorkshireboy » Sun Jan 01, 2017 8:57 pm

I am running OC2.0.3.1 and use the in-built Royal Mail shipping module as I'm based in the UK.

The module works fine, however I get some customers who don't pay enough attention to whats on the screen and just select the first available shipping option in the list - which happens to also be the most expensive.

The default display order seems to be:
1) Special Delivery
2) First Class
3) Second Class

I want to change the display order to be 3-2-1 so that the lowest priced shipping option is shown at the top.

I'd also like to set (3) as the default - at the moment (1) shows as the default

Can anyone help me locate where this is defined so that I can adjust it

Thanks

The site is https://shop.angeldancewear.co.uk/

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Sun Jan 01, 2017 9:13 pm

In the file catalog/model/extension/shipping/royal_mail.php, find following line:

Code: Select all

$method_data = array();
Now add following lines of code after that line:

Code: Select all

        $price_order = array();
        foreach ($quote_data as $key => $value) {
            $price_order[$key] = $value['cost'];
        }

      array_multisort($price_order, SORT_ASC, $quote_data);
Good luck!

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by yorkshireboy » Sun Jan 01, 2017 9:56 pm

Thanks for your help.

Don't know if its a version thing (I'm on 2.0.3.1) but I don't have catalog/model/extension/shipping/royal_mail.php

I do have catalog/model/shipping/royal_mail.php and in that file at the very bottom there is:

$method_data = array();
if ($quote_data) {
$method_data = array(
'code' => 'royal_mail',
'title' => $this->language->get('text_title'),
'quote' => $quote_data,
'sort_order' => $this->config->get('royal_mail_sort_order'),
'error' => false
);
}
return $method_data;

If I'm in the right place, this would seem to suggest to me that there is a 'royal_mail_sort_order' configuration somewhere??

Any idea's

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Sun Jan 01, 2017 11:57 pm

Yes you are right. In OC 2.0.3.1 file location is catalog/model/extension/shipping/royal_mail.php

Just insert codes after the following line:

Code: Select all

$method_data = array();

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by yorkshireboy » Mon Jan 02, 2017 1:04 am

Worked perfectly - thanks for your help

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Mon Jan 02, 2017 2:03 am

Glad to hear. Thanks!

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by yorkshireboy » Mon Jan 02, 2017 5:46 am

Hi - before I followed the instructions and made this change to the postage order, I had set up Paypal Express checkout

(I just opened another thread for it)

Is there any chance this postage mod could have affected the Paypal Express checkout process??

Basically the product 'option' criteria is being lost when the Paypal Express Checkout is used

Thanks

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Mon Jan 02, 2017 2:05 pm

Nope, apparently it should not. Seems different issue.

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by yorkshireboy » Tue Jan 03, 2017 1:12 am

Thanks - didn't think so, but worth checking

Any idea's on my Paypal Express option problem? - i think it might have been a known issue, which I'm sure there must be a simple solution for

New member

Posts

Joined
Wed Oct 21, 2015 2:10 am
Location - UK

Post by opencartmart » Tue Jan 03, 2017 2:09 pm

I need to know more details. What is the thread URL that you have created for that issue?

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am
Who is online

Users browsing this forum: No registered users and 40 guests