Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't update postal prices - any ideas?


zefeena

Recommended Posts

I've been using the above contribution for the past 12 months, made a few adaptations to suit my site. I've just tried to update the prices and it simply won't allow it. Even when i go actually into the coded files and change things it doesn't appear to save.

 

I added another payment option and cos it won't allow me to change the original numbers whihc were as kilos, when i work in grammes, it contantly tells the customer the cart weight as been exceeded and shows a price of £0, which, they can choose! Any ideas why its not updating

 

www.sewingchest.co.uk

 

thanks kellie

Edited by zefeena

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

Hi Kellie,

after you changed the php files, did you uninstall and reinstall the shipping module in admin?

 

I'm using [CONTRIB] UK Royal Mail & Overseas Shipping Methods and there was a "Cart weight exceeded" problem with that - try the supprt thread for it to see if it's a similar issue. http://www.oscommerce.com/forums/index.php?sho...3681&st=160

 

Tigergirl

Edited by tigergirl

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

Hi, there wasn't anmy answers in the thread - people had just posted - 'great it worked' - without saying how!

 

this was fine before i reinstalled it, i'm presuming there is something i changed last time and haven't changed this time, but i can't see it.

 

The code i have is below. The problem is the basket gets exceeded at probably 2kg maybe less. My customer has just checked out a heavy fabrics order for £70 to italy on free post. Need to do something fast!

 

<?php

/*

 

$Id: zones.php,v 1.20 2003/06/15 19:48:09 thomasamoulton Exp $

 

 

*/

 

class airmailsignedfor {

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

 

// class constructor

function airmailsignedfor() {

global $order;

$this->code = 'airmailsignedfor';

$this->title = MODULE_SHIPPING_AIRMAILSIGNEDFOR_TEXT_TITLE;

$this->description = MODULE_SHIPPING_AIRMAILSIGNEDFOR_TEXT_DESCRIPTION;

$this->sort_order = MODULE_SHIPPING_AIRMAILSIGNEDFOR_SORT_ORDER;

$this->icon = DIR_WS_ICONS . 'shipping_airmail.gif'; // upload icon to catalog/images/icon directory

$this->tax_class = MODULE_SHIPPING_AIRMAILSIGNEDFOR_TAX_CLASS;

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

if ($order->delivery['country']['iso_code_2'] == 'GB') {

$this->enabled = false;

}

// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED

$this->num_zones = 2;

}

 

// 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_AIRMAILSIGNEDFOR_COUNTRIES_' . $i);

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

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

$dest_zone = $i;

break;

}

}

 

// elari - Added to select default country if not in listing

if ($dest_zone == 0) {

$dest_zone = $this->num_zones; // the zone is the lastest zone avalaible

}

// elari - Added to select default country if not in listing

if ($dest_zone == 0) {

$error = true; // this can no more achieve since by default the value is set to the max number of zones

} else {

$shipping = -1;

$zones_cost = constant('MODULE_SHIPPING_AIRMAILSIGNEDFOR_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];

if(tep_not_null($method) )

// Text shown on Checkout_Confirmation

$shipping_method = ''; // Leaving this entry blank causes only the shipping title to show i.e Royal Mail 1st Class Rec

else

// Text shown on Checkout_shipping - Delivery Weight : 0.7 Kg's (Ships normally within 1 to 3 days)

$shipping_method = MODULE_SHIPPING_AIRMAILSIGNEDFOR_TEXT_WAY . ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_AIRMAILSIGNEDFOR_TEXT_UNITS . ' ' . MODULE_SHIPPING_AIRMAILSIGNEDFOR_DELIVERY_TIMES;

if ($shipping_num_boxes > 1) {

$shipping_method .= $shipping_num_boxes . 'x ';

}

break;

}

}

 

if ($shipping == -1) {

$shipping_cost = 0;

$shipping_method = MODULE_SHIPPING_AIRMAILSIGNEDFOR_UNDEFINED_RATE;

} else {

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

}

}

 

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

'module' => MODULE_SHIPPING_AIRMAILSIGNEDFOR_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_AIRMAILSIGNEDFOR_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_AIRMAILSIGNEDFOR_STATUS'");

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

}

return $this->_check;

}

 

// elari - Added to select default country if not in listing

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_AIRMAILSIGNEDFOR_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_AIRMAILSIGNEDFOR_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_AIRMAILSIGNEDFOR_SORT_ORDER', '9', 'Sort order of display.', '6', '0', now())");

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

$default_countries = '';

if ($i == 1) {

$default_countries = 'AL,AD,AM,AT,AZ,BY,BE,BA,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GI,GR,GL,HU,IS,IE,I

T,KZ,KG,LV,LI,LT,LU,MK,MT,MD,MC,NL,NO,PL,PT,RO,RU,SM,SK,SI,ES,SE,CH,TJ,TR,TM,UA,U

Z,VA';

$shipping_table = '100:1.21,120:1.31,140:1.45,160:1.57,180:1.70,200:1.82,220:1.95,240:2.06,260:

2.18,280:2.31,300:2.44,400:2.99,500:2.54,600:4.09,700:4.64:800:5.19900:6.74,1000:

7.29,1100:7.79,1200:8.29,1400:9.29,1600:10.29,1800:11.29,2000:12.29,2500:36,3000:

42,4000:45,5000:49,6000:51,7000:54,8000:56,9000:59,10000:61,20000:75,99000:999';

}

if ($i == 2) {

$default_countries = 'All Others'; // this must be the lastest zone

$shipping_table = '100:1.93,160:2.44,200:2.94,240:3.41,280:3.88,300:4.11,400:5.32,500:6.52,600:

7.72,700:8.92,800:10.12,900:11.32,1000:12.52,1100:13.72,1200:14.92,1300:16.12,140

0:17.32,1500:18.52,1600:19.72,1700:20.92,1800:22.12,1900:23.32,2000:24.52,2500:66

,3000:70,4000:76,5000:83,6000:90,7000:97,8000:103,9000:110,10000:116,20000:165,99

000:999';

}

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_AIRMAILSIGNEDFOR_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_AIRMAILSIGNEDFOR_COST_" . $i ."', '" . $shipping_table . "', '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_AIRMAILSIGNEDFOR_HANDLING_" . $i ."', '5', 'If you want to add extra costs to customers for jiffy bags etc, the cost can be entered below (eg enter 1.50 for a value of £1.50)', '6', '0', now())");

}

}

// elari - Added to select default country if not in listing

 

function remove() {

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

}

 

function keys() {

$keys = array('MODULE_SHIPPING_AIRMAILSIGNEDFOR_STATUS', 'MODULE_SHIPPING_AIRMAILSIGNEDFOR_TAX_CLASS', 'MODULE_SHIPPING_AIRMAILSIGNEDFOR_SORT_ORDER');

 

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

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

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

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

}

 

return $keys;

}

}

?>

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

okay, i m,ay have found the glitch

 

i input my price changes directly into the code, and i see an error in the string:

 

$shipping_table = '100:1.21,120:1.31,140:1.45,160:1.57,180:1.70,200:1.82,220:1.95,240:2.06,260:

2.18,280:2.31,300:2.44,400:2.99,500:2.54,600:4.09,700:4.64:800:5.19900:6.74,1000:

7.29,1100:7.79,1200:8.29,1400:9.29,1600:10.29,1800:11.29,2000:12.29,2500:36,3000

:

42,4000:45,5000:49,6000:51,7000:54,8000:56,9000:59,10000:61,20000:75,99000:999';

 

i shall see it changing that cures the problem.

Running a botched up version of  osCommerce Online Merchant v2.3.4 bootstrap with the dresscode theme installed, numerous add-ons, terrible coding, terrible website, but will have to make do until I have made up for my losses and can risk shutting down for a couple of weeks while I start all over again. - I did not install my program but am endeavouring to fix it with your help.

Link to comment
Share on other sites

This is what I did to fix it in my shipping modules - [CONTRIB] UK Royal Mail & Overseas Shipping Methods - I'm not sure if you are using this but the file looks pretty similar - please back-up files first. The problem is something to do with tear weight and cart weight totalling around the amount of the max set weight in the module ie 2kg and the worked for me. I've taken this from the post I mentioned earlier.

 

I used this fix on every module to get rid of the £0.00 problem. It's not a 100% fix as the "cart weight exceeded" still shows occasionally but at least the customer cannot select £0.00 cost shipping.

 

The other problem I notice will this module is that if your customer tries to order products that weigh more then you ship, no postage optoion will show and they can check out without selecting any postage! I just put a restrictive cost of £1000.00 on 20 - 100kg to stop people ordering stuff that heavy.

 

Find this line:
if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_AIRMAILSIGNEDFOR_INVALID_ZONE;

and add this after it

if ($shipping_method == MODULE_SHIPPING_AIRMAILSIGNEDFOR_UNDEFINED_RATE ) $this->quotes['error'] = $shipping_method;

 

You will need to add this line to all the modules where the problem occurs (changing the module name to the module you are fixing ie AIRMAILSIGNEDFOR) (I added it to them all to be sure!)

 

This should fix the cart weight exceeded issue but I don't know why you can't update your prices.

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...