Page 1 of 1
Shipping by Cart total, not weight.
Posted: Thu Sep 26, 2013 8:50 pm
by jewellerstore
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
Re: Shipping by Cart total, not weight.
Posted: Thu Sep 26, 2013 10:04 pm
by Johnathan
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.
Re: Shipping by Cart total, not weight.
Posted: Fri Sep 27, 2013 7:17 pm
by jewellerstore
Any free mods available?
Re: Shipping by Cart total, not weight.
Posted: Fri Sep 27, 2013 10:07 pm
by Johnathan
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'],
Re: Shipping by Cart total, not weight.
Posted: Thu Jun 17, 2021 9:34 pm
by ru-lefthanded
Hi, where are those files in OC3 please - tried changing \catalog\model\extension\shipping\weight - but that didnt work

Re: Shipping by Cart total, not weight.
Posted: Thu Jun 17, 2021 11:34 pm
by straightlight
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
Re: Shipping by Cart total, not weight.
Posted: Sat Jun 19, 2021 12:08 am
by ru-lefthanded
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 ?
Re: Shipping by Cart total, not weight.
Posted: Sat Jun 19, 2021 12:52 am
by straightlight
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.