Post by ryrocks » Wed May 02, 2012 3:57 am

Hi,

Is is possible to remove the actual weight from the delivery section of the check out.

At checkout it currently says, for example:

UK Shipping (Weight: 19.00kg)

I'd like it to just say:

UK Shipping

Is is also possible to change the name displayed from "Weight Based Shipping" to something else, say "Standard Shipping".

Thanks,

Ryan

New member

Posts

Joined
Sat Apr 21, 2012 3:15 am

Post by Avvici » Wed May 02, 2012 8:35 am

v1.5.2.1
Open catalog/model/shipping/weight.php

Find this line: (array)

Code: Select all

$quote_data['weight_' . $result['geo_zone_id']] = array(
						'code'         => 'weight.weight_' . $result['geo_zone_id'],
						'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',
						'cost'         => $cost,
						'tax_class_id' => $this->config->get('weight_tax_class_id'),
						'text'         => $this->currency->format($this->tax->calculate($cost, $this->config->get('weight_tax_class_id'), $this->config->get('config_tax')))
					);
Make it look like this and you will get what you want:

Code: Select all

$quote_data['weight_' . $result['geo_zone_id']] = array(
						'code'         => 'weight.weight_' . $result['geo_zone_id'],
						'title'        => $result['name'],
						//'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',
						'cost'         => $cost,
						'tax_class_id' => $this->config->get('weight_tax_class_id'),
						'text'         => $this->currency->format($this->tax->calculate($cost, $this->config->get('weight_tax_class_id'), $this->config->get('config_tax')))
					);	
Note: we comment out code that we might want to use again by adding a // or a # in front of it.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by Johnathan » Wed May 02, 2012 9:13 pm

If you just need to hide the weight, you can turn it off in System > Settings > Option.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by labeshops » Wed May 02, 2012 9:17 pm

Johnathan wrote:If you just need to hide the weight, you can turn it off in System > Settings > Option.
Not true. It's turned off in my settings yet still shows on the invoice :P

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by Avvici » Wed May 02, 2012 11:40 pm

Johnathan wrote:If you just need to hide the weight, you can turn it off in System > Settings > Option.
Gosh, I am kind of glad that's not true otherwise I would have wasted 15 minutes of my life lol :laugh:

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by ryrocks » Thu May 03, 2012 7:02 am

Worked a treat! Thanks avvici :D :D

New member

Posts

Joined
Sat Apr 21, 2012 3:15 am

Post by Johnathan » Sat May 05, 2012 10:27 pm

labeshops wrote:
Johnathan wrote:If you just need to hide the weight, you can turn it off in System > Settings > Option.
Not true. It's turned off in my settings yet still shows on the invoice :P
I could have sworn this was the case, but you're right that that's not in the code. Seems like it would be a good idea, but we'd have to convince Daniel of that first.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by MZBS » Thu Jun 21, 2012 10:44 pm

Ok cool in the shipping area on the cart is not appearing but on the email / invoice is still the total weight.

Is there any way to hide completely the weight for customers ?

Thank you.

New member

Posts

Joined
Tue Jan 17, 2012 1:36 am

Post by syedilyasahmed » Fri Oct 25, 2013 9:53 am

You saved a lot of time, worked a charm! Thanks avvici :D :D


Posts

Joined
Sun Apr 07, 2013 12:46 pm

Post by Dargo80 » Fri Apr 03, 2015 12:25 am

Thanks for the guide.

Newbie

Posts

Joined
Fri Apr 03, 2015 12:24 am

Post by eddielai » Tue Mar 15, 2016 12:33 pm

Here is the vqmod I use, hope it helps:

Code: Select all

<modification>
  <id>Remove Shipping Weight</id>
  <version>1.0.0</version>
  <vqmver>2.2.1</vqmver>
  <author>Eddie</author>
<file name="catalog/model/shipping/weight.php">
    <operation>
      <search position="replace">
        <![CDATA[
        'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',
        ]]>
      </search>
      <add>
        <![CDATA[
        'title'        => $result['name'] . ' ',
        ]]>
      </add>
    </operation>
  </file>
</modification>
Last edited by Johnathan on Tue Mar 15, 2016 11:07 pm, edited 1 time in total.
Reason: Added [code] tags

Newbie

Posts

Joined
Fri Apr 20, 2012 10:42 am

Post by Pandicha » Tue Jan 24, 2017 4:37 pm

Hi Fellows, Avvici is right, his proposal works also with CityLink delivery method . Thanks a lot to Avvici for the helpfull comment ;-)

Newbie

Posts

Joined
Sun Jan 22, 2017 9:14 pm
Who is online

Users browsing this forum: No registered users and 43 guests