Post by Falco Stellare » Wed Mar 03, 2010 5:19 am

How to hide the weight indication in the shipping section during the checkout procedure?


Posts

Joined
Fri Feb 19, 2010 11:42 pm

Post by Qphoria » Wed Mar 03, 2010 5:28 am

1. EDIT: catalog/model/shipping/weight.php

2a. FIND (1.4.0 or older):

Code: Select all

'title'        => $result['name'] . '  (' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',
2b. FIND (1.4.1 or newer):

Code: Select all

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

Code: Select all

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

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Falco Stellare » Wed Mar 03, 2010 5:50 am

Great, thank you!!! ;D


Posts

Joined
Fri Feb 19, 2010 11:42 pm

Post by benisv » Thu Jun 10, 2010 4:58 am

After i made all that changes i got this on CHECKOUT CONFIRMATION page

Notice: Undefined index: cost in /catalog/model/total/shipping.php on line 7
Notice: Undefined index: cost in /catalog/model/total/shipping.php on line 8
Notice: Undefined index: cost in /catalog/model/total/shipping.php on line 20

Line 7 :

Code: Select all

        		'text'       => $this->currency->format($this->session->data['shipping_method']['cost']),
Line 8:

Code: Select all

        		'value'      => $this->session->data['shipping_method']['cost'],
Line 20:

Code: Select all

			$total += $this->session->data['shipping_method']['cost'];

New member

Posts

Joined
Mon May 31, 2010 3:59 pm

Post by Qphoria » Thu Jun 10, 2010 5:14 am

start over and make the change again..carefully

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by benisv » Thu Jun 10, 2010 6:22 pm

hi Qphoria but i can not find exact line from above in my weight.php ,so what should i replace from it ?
This is weight.php the original one :

Code: Select all

<?php 
class ModelShippingWeight extends Model {    
  	public function getQuote($address) {
		$this->load->language('shipping/weight');
		
		$quote_data = array();

		if ($this->config->get('weight_status')) {
			$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "geo_zone ORDER BY name");
		
			foreach ($query->rows as $result) {
   				if ($this->config->get('weight_' . $result['geo_zone_id'] . '_status')) {
   					$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$result['geo_zone_id'] . "' AND country_id = '" . (int)$address['country_id'] . "' AND (zone_id = '" . (int)$address['zone_id'] . "' OR zone_id = '0')");
				
					if ($query->num_rows) {
       					$status = TRUE;
   					} else {
       					$status = FALSE;
   					}
				} else {
					$status = FALSE;
				}
			
				if ($status) {
					$cost = 0;
					$weight = $this->cart->getWeight();
					
					$rates = explode(',', $this->config->get('weight_' . $result['geo_zone_id'] . '_rate'));
					
					foreach ($rates as $rate) {
  						$data = explode(':', $rate);
  					
						if ($data[0] >= $weight) {
							if (isset($data[1])) {
    							$cost = $data[1];
							}
					
   							break;
  						}
					}
					
					if ((string)$cost != '') { 
      					$quote_data['weight_' . $result['geo_zone_id']] = array(
        					'id'           => 'weight.weight_' . $result['geo_zone_id'],
        					'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class')) . ')',
        					'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')))
      					);	
					}
				}
			}
		}
		
		$method_data = array();
	
		if ($quote_data) {
      		$method_data = array(
        		'id'         => 'weight',
        		'title'      => $this->language->get('text_title'),
        		'quote'      => $quote_data,
				'sort_order' => $this->config->get('weight_sort_order'),
        		'error'      => FALSE
      		);
		}
	
		return $method_data;
  	}
}
?>
thanks again :P

New member

Posts

Joined
Mon May 31, 2010 3:59 pm

Post by benisv » Thu Jun 10, 2010 8:51 pm

DONE !!! thank you all ;D

New member

Posts

Joined
Mon May 31, 2010 3:59 pm

Post by Qphoria » Thu Jun 10, 2010 9:08 pm

In 1.4.8
FIND:

Code: Select all

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

Code: Select all

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

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by benisv » Thu Jun 10, 2010 9:16 pm

thank ,i got it ,many thanks again .
i got a question in PM

New member

Posts

Joined
Mon May 31, 2010 3:59 pm

Post by benisv » Fri Jun 11, 2010 4:55 am

for hide weight indication in Weight Based Shipping on shopping cart to checkout
System > Settings > Option > Display Weight on Cart Page: NO

Image

New member

Posts

Joined
Mon May 31, 2010 3:59 pm

Post by Purebeads » Fri Jun 18, 2010 2:48 pm

I have just upgraded to 1.4.8. I made the modification above so that "(Weight: 0.00oz)" is no longer showing up in the cart (during checkout). However, it is showing up in the Shopping Cart module to the right. How can I delete it from that area? Thanks!

The problem is now fixed! I think that some old information was still in the cache.

Active Member

Posts

Joined
Fri Apr 30, 2010 12:07 pm

Post by Qphoria » Fri Jun 18, 2010 7:56 pm

Purebeads wrote:I have just upgraded to 1.4.8. I made the modification above so that "(Weight: 0.00oz)" is no longer showing up in the cart (during checkout). However, it is showing up in the Shopping Cart module to the right. How can I delete it from that area? Thanks!

The problem is now fixed! I think that some old information was still in the cache.
That lower right side weight display in 1.4.7 was moved to the header in 1.4.8
But there is a simple on/off switch in the admin settings.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by thedevilznight » Tue Oct 11, 2011 12:44 am

Hi. .. This is exactly what i need to do also but I have the latest version v1.5.1.3 .. how is it possible to do the same thing in this version?

Thank you

New member

Posts

Joined
Mon Oct 10, 2011 1:39 pm

Post by thedevilznight » Tue Oct 11, 2011 1:23 am

OK sitting here waiting i figured it out!

If you were looking for the same thing you must edit this file;

/catalog/language/english/shipping > weight.php

Please ALWAYS make a backup of the file before you start playing around with these :) Cheers

New member

Posts

Joined
Mon Oct 10, 2011 1:39 pm

Post by ToddR » Fri Oct 28, 2011 11:03 pm

edit it to what?

Newbie

Posts

Joined
Tue Oct 18, 2011 10:15 am


Post by ToddR » Sat Oct 29, 2011 1:26 am

got it for newest version of oc
heres what you do follow steps 1.48 as shown above
then /catalog/language/english/shipping > weight.php
edit weight .php
edit result to whatever you want to name it.
and bingo!

Newbie

Posts

Joined
Tue Oct 18, 2011 10:15 am


Post by whelouski » Mon Nov 28, 2011 11:46 pm

None of this works for me.

I'm running 1.5.1

I unchecked the show weight.


I deleted the weight part in the php and the whole of weight based shipping stopped working.

I edited the php as in the above post but nothing changed.

???

Newbie

Posts

Joined
Mon Nov 28, 2011 8:22 pm

Post by Deckard » Mon Dec 05, 2011 5:20 am

Not working here either. (/catalog/language/english/shipping > weight.php)

If I change the line:
$_['text_title'] = 'Weight Based Shipping';
to
$_['text_title'] = '';

...then that successfully removes the 'Weight Based Shipping' heading in the 'Estimate Shipping & Taxes' section of the Shopping cart page. That's pretty straightforward. However... just below where that heading was, customers still see a radio button and its label, like this: Zone 1 (Weight: 12.00kg)

So if I go back into the above file and change the second line, from:
$_['text_weight'] = 'Weight:';
to
$_['text_weight'] = '';

...the customer still sees the weight listed next to the radio button: Zone 1 ( 12.00kg)

Can anyone explain how we get rid of the actual weight reference?

Newbie

Posts

Joined
Sat Oct 29, 2011 8:11 am

Post by jetswebstudio » Fri Dec 09, 2011 9:17 am

Ok, really had to read the answers carefully to be able to piece it together and get it working. Basically I wanted to retrofit the "Weight Based" shipping module to be used as flat rate shipping. If that's sortof what you're looking to do, here's what I did:

1) In the admin side, go to [System] > [Localisation] > [Geo Zones].

2) Insert/Create whatever Geo Zones you want. I created one for Canada and one for US...naming them what I wanted the customer to see (e.g. Flat Rate Shipping (USA) and Flat Rate Shipping (Canada)).

3) Then, go to [Extension] > [Shipping] and [Edit] for Weight Based Shipping. You should see the new Geo Zones you just created. To set it up as Flat Rate, I entered 99999:6 for US and 99999:8 for Canada, which means a customer can buy up to 99999 lbs of merchandise and the shipping for US will be $6. My products aren't heavy, so that should cover all orders. :)

4) Once you've saved the shipping settings, now you tap into the php files...I am running 1.5.whatever.

5) Go to catalog/model/shipping/weight.php and
Qphoria wrote:FIND (1.4.1 or newer):

Code: Select all

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

Code: Select all

'title'        => $result['name'],
6) Then, go to catalog/language/english/shipping/weight.php. And edit the "text_title" to say "Flat Rate Shipping." And take out all verbiage for "text_weight" so it's just the apostrophes.

That should do it. And if you still see the weight in the Shopping Cart Header, that can be turned off like benisv noted in this thread.

Newbie

Posts

Joined
Fri Dec 09, 2011 8:54 am

Post by Deckard » Sat Dec 10, 2011 1:25 am

Wow! Your very first post and you completely solved my problem - thank you so much, Jet, I appreciate it!

Newbie

Posts

Joined
Sat Oct 29, 2011 8:11 am
Who is online

Users browsing this forum: No registered users and 3 guests