Post by jewellerstore » Thu Sep 26, 2013 8:50 pm

Is there a way to calculate shipping by the cart total.
E.g. Orders under £50 are sent by recorded first class post £2.00

On orders over £50 sent by Special Delivery is £3.50.

All orders over £100 are sent Special Delivery Free of Charge.

This would seem to be a logical way to ship small items but I can not see a way to do this in opencarts standard shipping extensions.

Thanks

New member

Posts

Joined
Fri Dec 30, 2011 6:28 pm

Post by Johnathan » Thu Sep 26, 2013 10:04 pm

There's not one in the built-in shipping methods. You can use Total-Based Shipping to do this (available on opencart.com here: http://www.opencart.com/index.php?route ... ion_id=769

If you want further criteria, such a combination of total + weight or total + postcode, then you can use Formula-Based Shipping instead.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by jewellerstore » Fri Sep 27, 2013 7:17 pm

Any free mods available?

New member

Posts

Joined
Fri Dec 30, 2011 6:28 pm

Post by Johnathan » Fri Sep 27, 2013 10:07 pm

Not that I'm aware of, but you can check the opencart.com extension store. If you just want a simple edit to make the Weight Based Shipping compare against the sub-total rather than the weight, you can do this:

Code: Select all

IN:
/catalog/model/shipping/weight.php

REPLACE:
$weight = $this->cart->getWeight();

WITH:
$weight = $this->cart->getSubTotal(); 
You'll probably want the weight removed from the rate titles, too, in which case you can also make this edit:

Code: Select all

REPLACE:
'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',

WITH:
'title'        => $result['name'], 

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by ru-lefthanded » Thu Jun 17, 2021 9:34 pm

Hi, where are those files in OC3 please - tried changing \catalog\model\extension\shipping\weight - but that didnt work :(

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by straightlight » Thu Jun 17, 2021 11:34 pm

ru-lefthanded wrote:
Thu Jun 17, 2021 9:34 pm
Hi, where are those files in OC3 please - tried changing \catalog\model\extension\shipping\weight - but that didnt work :(
catalog/model/extension folder

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ru-lefthanded » Sat Jun 19, 2021 12:08 am

So (if I understand this correctly) - we need to change the following sections in each postage solution we use (luckily just Royal Mail at this stage for us) each time it arises.

In Royal Mail for example, for each instance we are using (1st Class, 2nd Class etc), we change (for example on the 1st Class)

$title = $this->language->get('text_1st_class_signed');

if ($this->config->get('shipping_royal_mail_display_weight')) {
$title .= ' (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')';

to
'title' => $result['text_1st_class_signed'],


Also, can I just check, should that end in a comma or a semi colon ?

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by straightlight » Sat Jun 19, 2021 12:52 am

ru-lefthanded wrote:
Sat Jun 19, 2021 12:08 am
So (if I understand this correctly) - we need to change the following sections in each postage solution we use (luckily just Royal Mail at this stage for us) each time it arises.

In Royal Mail for example, for each instance we are using (1st Class, 2nd Class etc), we change (for example on the 1st Class)

$title = $this->language->get('text_1st_class_signed');

if ($this->config->get('shipping_royal_mail_display_weight')) {
$title .= ' (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')';

to
'title' => $result['text_1st_class_signed'],


Also, can I just check, should that end in a comma or a semi colon ?
The instruction codes above originates from an array so, in this scenario, it would end with a comma.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 8 guests