Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product weights?????


jp2006

Recommended Posts

you can only change it in the shipping modules you're using. osc does not have a weight unit, its up to your interpretation.

Link to comment
Share on other sites

you can only change it in the shipping modules you're using. osc does not have a weight unit, its up to your interpretation.

 

huh? Sorry im new to this

 

cant i change it to kg then?

Link to comment
Share on other sites

only the shipping modules those like UPS, Fedex etc may show the weight units. So you will have to change the shipping module settings or code. So where do you see the lbs?

Link to comment
Share on other sites

As Mark said, they are just words

 

includes\languages\english\modules\shipping\zones.php(16): define('MODULE_SHIPPING_ZONES_TEXT_UNITS', 'lb(s)');

 

includes\modules\shipping\usps.php(91): 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)');

 

There might be a couple more instances of the abbreviation "lb" ...depends on which shipping module you're using. If it's not one of the ones above, then let us know which one it is.

Link to comment
Share on other sites

only the shipping modules those like UPS, Fedex etc may show the weight units. So you will have to change the shipping module settings or code. So where do you see the lbs?

 

 

I have to ship on a weight basis, dur to the variance in my items. wheni enter a product (New) at the bottom it asks for the weight , and the on the checkout it calculates the total weight and gives them a postage value, but their weights in 15ib and all mine are in KG

Link to comment
Share on other sites

This is my includes\languages\english\modules\shipping\zones.php

 

*/

 

class zones {

var $code, $title, $description, $enabled, $num_zones;

 

// class constructor

function zones() {

$this->code = 'zones';

$this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;

$this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;

$this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;

$this->icon = '';

$this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;

$this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);

 

// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED

$this->num_zones = 1;

}

 

// class methods

function quote($method = '') {

global $order, $shipping_weight, $shipping_num_boxes;

 

$dest_country = $order->delivery['country']['iso_code_2'];

$dest_zone = 0;

$error = false;

 

for ($i=1; $i<=$this->num_zones; $i++) {

$countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);

$country_zones = split("[,]", $countries_table);

if (in_array($dest_country, $country_zones)) {

$dest_zone = $i;

break;

}

}

 

if ($dest_zone == 0) {

$error = true;

} else {

$shipping = -1;

$zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);

 

$zones_table = split("[:,]" , $zones_cost);

$size = sizeof($zones_table);

for ($i=0; $i<$size; $i+=2) {

if ($shipping_weight <= $zones_table[$i]) {

$shipping = $zones_table[$i+1];

$shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;

break;

}

}

 

if ($shipping == -1) {

$shipping_cost = 0;

$shipping_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE;

} else {

$shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);

}

}

 

$this->quotes = array('id' => $this->code,

'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,

'methods' => array(array('id' => $this->code,

'title' => $shipping_method,

'cost' => $shipping_cost)));

 

if ($this->tax_class > 0) {

$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

}

 

if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

 

if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;

 

return $this->quotes;

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

return $this->_check;

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ZONES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");

for ($i = 1; $i <= $this->num_zones; $i++) {

$default_countries = '';

if ($i == 1) {

$default_countries = 'GB';

}

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");

}

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

 

function keys() {

$keys = array('MODULE_SHIPPING_ZONES_STATUS', 'MODULE_SHIPPING_ZONES_TAX_CLASS', 'MODULE_SHIPPING_ZONES_SORT_ORDER');

 

for ($i=1; $i<=$this->num_zones; $i++) {

$keys[] = 'MODULE_SHIPPING_ZONES_COUNTRIES_' . $i;

$keys[] = 'MODULE_SHIPPING_ZONES_COST_' . $i;

$keys[] = 'MODULE_SHIPPING_ZONES_HANDLING_' . $i;

}

 

return $keys;

}

}

?>

Link to comment
Share on other sites

Hi, thanks. I've done it all, but it's working only 50/50 for me.

 

Now I see words kg displayed instead of lb, but weight is not correct at the checkout point.

For example, product weights 5kg. At the checkout it calculates shipping and displays 10kg. There's only 1 product in the basket at that time. I checked - it always doubles up. :blush:

 

What would I do about it?

Link to comment
Share on other sites

Now I see words kg displayed instead of lb, but weight is not correct at the checkout point.

For example, product weights 5kg. At the checkout it calculates shipping and displays 10kg. There's only 1 product in the basket at that time. I checked - it always doubles up. blush.gif

 

 

check admin>configuration>shipping & packaging "tare weight"

 

The amount shown there will be added to your orders to allow for packaging. If you would like it to be zero, you can set it to zero.

Link to comment
Share on other sites

jp2006,

 

Which shipping module are you using? Zone?

 

The file you posted is catalog/includes/modules/shipping/zones

 

To change the "lb" word, You need to go to

 

catalog/includes/languages/english/modules/shipping/zones.php

Link to comment
Share on other sites

check admin>configuration>shipping & packaging "tare weight"

 

The amount shown there will be added to your orders to allow for packaging. If you would like it to be zero, you can set it to zero.

 

Thanks, but there isn't folder named configuration in admin (only images, includes)

& configuration.php in admin folder doesn't contain anything about the tare weight.

Link to comment
Share on other sites

Thanks, but there isn't folder named configuration in admin (only images, includes)

& configuration.php in admin folder doesn't contain anything about the tare weight.

 

its not a folder its the steps in the osc admin panel

Link to comment
Share on other sites

its not a folder its the steps in the osc admin panel

 

Oh, yes, I've done that first of all. It still multiplies the final weight by 2. Not a fixed value is added, but it is always doubled up. I've spent the whole day today trying to find what the problem is.

 

JUST FOUND IT. It was stairing me in the face :))))))) If I was a man I probably would have noticed I made a mistake editing the code earlier :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...