Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need shipping module


EddieO

Recommended Posts

So, my webguy has basically disappeared on me....I can't get him to do anything quickly as his work ties him up too much.

 

I was using an older version of oscommerce since 2004....worked fine for years. In February somehow a hacker did something to the Database.....was using our server to send spam emails. No matter what we did, the hacker would again gain acess to the site as soon as we installed a backup. We went back to the oldest one we still had (about a year old)........still same problem.

 

So, my web guy upgraded me to 2.3 and we started the website from scratch again...but now getting stuff finished and working has been going on a month.

 

My shipping is pretty straight forward, $7 US, $15 international......all by USPS flat rate. He has installed a couple of flat rate modules, but claims neither work right with 2.3, as they are older 2.2 modules.

 

I am very novice at this stuff, but I have managed to get a couple modules working on my own....but if anyone can point me to a working module thats not overly hard to install, that would be awesome. Still trying to figure out how to install the postage pony thing...

 

www.teambrood.com is my site.....I could also use an attributes sort order and a new theme....

 

Thanks for your time.

 

Later EddieO

Link to comment
Share on other sites

  • 4 weeks later...

EddieO,

 

I hope that I can help and I'm not too late. I've just done the same task that you're needing assistance with. I'm using version 2.3.1. Here's what I done based on the flat shipping method:

 

1. In your files open catalog/includes/modules/shipping/flat.php with your favorite text editor (I used Wordpad). With the same text editor open a blank document.

 

2. Next in flat.php copy the entire contents over to the blank document which will become the file for your new shipping rate.

 

3. Then in the new document every occurance of "flat" should be changed to the name you choose for your new shipping rate. I chose standard. Be careful some occurances are in all caps.

 

4. Save the file in php format. For example, standard.php

 

5. Now you must make another file. Open catalog/includes/languages/english/modules/shipping/flat.php and copy the conents.

 

6. Open another blank document. Paste the contents of flat.php

 

7. Once again change all occurances of flat to whatever you chose to name your shipping method. It must be the same name as the first file. For example, standard.php

 

8. Now upload both files to your server.

catalog/includes/modules/shipping/standard.php or whatever name you chose

catalog/includes/languages/english/modules/shipping/standard.php must be same name as first file.

 

9. Login to your admin area, click on Modules then Shipping In the upper-right of the admin area there should a button labeled Install Module. Click on that button

 

10. Your newly named shipping method should be listed along with the other shipping methods. Attempt to install it and edit the settings as you wish.

 

If you have trouble ask for help.

Link to comment
Share on other sites

Ok, so I managed to do all the stuff and not mess anything up....

 

It's installed and appears to be there.....but how do I set it to charge shipping for only international without goobering up the USA shipping....

 

Thanks for your help....was begining to think I was all alone on this!

 

Later EddieO

Link to comment
Share on other sites

Eddie,

 

In admin>>location/taxes/tax zones create a new zone that includes ALL countries and provinces you want to ship to except the USA. In the second flat rate shipping module you created, assign that module the new zone.

 

 

 

 

 

Chris

Link to comment
Share on other sites

K, trying that....is there anyway to add them all though instead of one at a time? Gonna be here all night!

 

Later EddieO

EddieO,

Since you're new to this, I recommend having more than one copy of fresh files of OSCommerce version 2.3.1. The golden rule is to have a backup of the files you've modified.

 

I must ask how many shipping methods does your business require. Since I sale media, my flat rates are low. I use standard, 3-day, expedited, Canada & Mexico and international. I used the same process I described to create all those.

 

I'm not familiar with the solution Chris provides above but my guess would be create multiple international shipping methods and assign them to countries according to regions of the world they lie in. So when a customer from a certain zone place an order, they would be charged the rate according to the shipping method you assigned their zone. That would take some research with your preferred shipping provider. Also you may need to consider the cost to ship one item to that zone and charge a couple of bucks extra to ship additional items.

 

OR.....

 

You can calculate the cost to ship one item to different zones and charge one flat rate for all regions plus cost to ship additional items. I find it simpler this way.

 

I hope this helps

Link to comment
Share on other sites

Very new to this....my web guy doesn't have time to help much anymore, so I've resulted to doing stuff myself. I back the stuff up always.

 

I sell RC car parts........mainly motors. I have two shipping rates.........$7 USA and $20 international.......flat rate........with 2.2, there was an addon that worked fine, when we moved to 2.3, there is only the USA flat rate. I installed the one you said, and I added the countries manually to a zone........selected that zone and set the shipping price....not sure if it works yet, as I have not got an international order yet, so we will see.

 

Later EddieO

 

EddieO,

Since you're new to this, I recommend having more than one copy of fresh files of OSCommerce version 2.3.1. The golden rule is to have a backup of the files you've modified.

 

I must ask how many shipping methods does your business require. Since I sale media, my flat rates are low. I use standard, 3-day, expedited, Canada & Mexico and international. I used the same process I described to create all those.

 

I'm not familiar with the solution Chris provides above but my guess would be create multiple international shipping methods and assign them to countries according to regions of the world they lie in. So when a customer from a certain zone place an order, they would be charged the rate according to the shipping method you assigned their zone. That would take some research with your preferred shipping provider. Also you may need to consider the cost to ship one item to that zone and charge a couple of bucks extra to ship additional items.

 

OR.....

 

You can calculate the cost to ship one item to different zones and charge one flat rate for all regions plus cost to ship additional items. I find it simpler this way.

 

I hope this helps

Link to comment
Share on other sites

Hello should this procedure work for Table rate shipping.

 

I created the 2 copies, called them tableeu.php, replaced all instances of "table" (regardless of capitalisation) with "tableeu"

 

when I tried to install the new shipping module, i get

 

1146 - Table 'mydomain.TABLEEU_CONFIGURATION' doesn't exist

 

select configuration_value from TABLEEU_CONFIGURATION where configuration_key = 'MODULE_SHIPPING_TABLEEU_STATUS'

 

Thanks

 

ken

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Link to comment
Share on other sites

So this worked for the first two international orders I got, one from switzerland and one from chile.....but today the one from the United Kingdom only charged the USA rate....double checked and its listed in the zones as required....

 

Any ideas?

 

Later EddieO

Link to comment
Share on other sites

Hello should this procedure work for Table rate shipping.

 

I created the 2 copies, called them tableeu.php, replaced all instances of "table" (regardless of capitalisation) with "tableeu"

 

when I tried to install the new shipping module, i get

 

1146 - Table 'mydomain.TABLEEU_CONFIGURATION' doesn't exist

 

select configuration_value from TABLEEU_CONFIGURATION where configuration_key = 'MODULE_SHIPPING_TABLEEU_STATUS'

 

Thanks

 

ken

Hello,

Im not familiar with table rates. All I can say is to backup your original files and give it a try. Search the forums for a discussion about table rates.

 

Sorry I couldn't help.

Link to comment
Share on other sites

So this worked for the first two international orders I got, one from switzerland and one from chile.....but today the one from the United Kingdom only charged the USA rate....double checked and its listed in the zones as required....

 

Any ideas?

 

Later EddieO

Maybe give the UK its own shipping module. The word "United" may have something to do with the mixup. Or change the United Kingdom to Great Britain. Im not sure what it would take to make that change. I remember shipping items there and I couldn't make shipping labels using United Kingdom.

 

I hope that helps

Link to comment
Share on other sites

Hi, as I'd suspected when I changed "table" to "tableeu" I had actually removed some the calls to Tables in the database, anyway just to avoid confusion decided to change the name of each relevant php files to euship.php, the code below does now work in version 2.3.1 to give you an extra Table Rate to install.

 

Includes/languages/modules/shipping/euship.php

 

<?php
/*
 $Id$

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

define('MODULE_SHIPPING_EUSHIP_TEXT_TITLE', 'Table Rate EU');
define('MODULE_SHIPPING_EUSHIP_TEXT_DESCRIPTION', 'Table Rate EU');
define('MODULE_SHIPPING_EUSHIP_TEXT_WAY', 'Best Way');
define('MODULE_SHIPPING_EUSHIP_TEXT_WEIGHT', 'Weight');
define('MODULE_SHIPPING_EUSHIP_TEXT_AMOUNT', 'Amount');
?>

 

and for includes/modules/shipping/euship.php

 

<?php
/*
 $Id$

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright (c) 2008 osCommerce

 Released under the GNU General Public License
*/

 class euship {
   var $code, $title, $description, $icon, $enabled;

// class constructor
   function euship() {
     global $order;

     $this->code = 'euship';
     $this->title = MODULE_SHIPPING_EUSHIP_TEXT_TITLE;
     $this->description = MODULE_SHIPPING_EUSHIP_TEXT_DESCRIPTION;
     $this->sort_order = MODULE_SHIPPING_EUSHIP_SORT_ORDER;
     $this->icon = '';
     $this->tax_class = MODULE_SHIPPING_EUSHIP_TAX_CLASS;
     $this->enabled = ((MODULE_SHIPPING_EUSHIP_STATUS == 'True') ? true : false);

     if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_EUSHIP_ZONE > 0) ) {
       $check_flag = false;
       $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_EUSHIP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
       while ($check = tep_db_fetch_array($check_query)) {
         if ($check['zone_id'] < 1) {
           $check_flag = true;
           break;
         } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
           $check_flag = true;
           break;
         }
       }

       if ($check_flag == false) {
         $this->enabled = false;
       }
     }
   }

// class methods
   function quote($method = '') {
     global $order, $shipping_weight, $shipping_num_boxes;

     if (MODULE_SHIPPING_EUSHIP_MODE == 'price') {
       $order_total = $this->getShippableTotal();
     } else {
       $order_total = $shipping_weight;
     }

     $tableeu_cost = preg_split("/[:,]/" , MODULE_SHIPPING_EUSHIP_COST);
     $size = sizeof($euship_cost);
     for ($i=0, $n=$size; $i<$n; $i+=2) {
       if ($order_total <= $euship_cost[$i]) {
         $shipping = $euship_cost[$i+1];
         break;
       }
     }

     if (MODULE_SHIPPING_EUSHIP_MODE == 'weight') {
       $shipping = $shipping * $shipping_num_boxes;
     }

     $this->quotes = array('id' => $this->code,
                           'module' => MODULE_SHIPPING_EUSHIP_TEXT_TITLE,
                           'methods' => array(array('id' => $this->code,
                                                    'title' => MODULE_SHIPPING_EUSHIP_TEXT_WAY,
                                                    'cost' => $shipping + MODULE_SHIPPING_EUSHIP_HANDLING)));

     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);

     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_EUSHIP_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 Table Method', 'MODULE_SHIPPING_EUSHIP_STATUS', 'True', 'Do you want to offer table 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, date_added) values ('Shipping Table', 'MODULE_SHIPPING_EUSHIP_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())");
     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 ('Table Method', 'MODULE_SHIPPING_EUSHIP_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_EUSHIP_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', 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_EUSHIP_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, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_EUSHIP_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_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_EUSHIP_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
   }

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

   function keys() {
     return array('MODULE_SHIPPING_EUSHIP_STATUS', 'MODULE_SHIPPING_EUSHIP_COST', 'MODULE_SHIPPING_EUSHIP_MODE', 'MODULE_SHIPPING_EUSHIP_HANDLING', 'MODULE_SHIPPING_EUSHIP_TAX_CLASS', 'MODULE_SHIPPING_EUSHIP_ZONE', 'MODULE_SHIPPING_EUSHIP_SORT_ORDER');
   }

   function getShippableTotal() {
     global $order, $cart, $currencies;

     $order_total = $cart->show_total();

     if ($order->content_type == 'mixed') {
       $order_total = 0;

       for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
         $order_total += $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);

         if (isset($order->products[$i]['attributes'])) {
           reset($order->products[$i]['attributes']);
           while (list($option, $value) = each($order->products[$i]['attributes'])) {
             $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id");
             $virtual_check = tep_db_fetch_array($virtual_check_query);

             if ($virtual_check['total'] > 0) {
               $order_total -= $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
             }
           }
         }
       }
     }

     return $order_total;
   }
 }
?>

 

However, having installed the new EU shipping module and setting the appropriate parameters for the new table rate, on the order confirmation page, for a customer based in the EU but not the UK, it correctly identifies that euship.php should be used but doesn't add its cost to the order, so I'm still missing something, any clues

 

thanks

 

Ken

 

 

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Link to comment
Share on other sites

So this worked on the first order placed, to switzerland.........but has since failed on every order since. UK, Spain, Portugal, and now Australia. All appear in my list and all the cities they ordered from are listed in the country list.

 

Not sure whats wrong.....

 

Is there any other options to get a flat rate international working? My stuff is pretty straight forward..........$7 in the USA...........$20 international.

 

Later EddieO

Link to comment
Share on other sites

Money I don't have to spend really, hence why I went with Oscommerce in the first place....it was free. I would not even know where to look to find someone to code that...

 

Later EddieO

 

Get something custom coded. Would cost you next to nothing, and you then have exactly what you want, with the support of someone professional rather than other shop owners.

Link to comment
Share on other sites

So I THINK I have found the root of the problem.

 

Today, when switching over a customer to a different purchasing discount, the store would not let me save his customer data without selecting a state....he lives in Germany. He has no STATE to select. I went and looked....every customer who has not been charged the correct shipping has no STATE, all the ones that do....charges the correct amount.

 

Any ideas on a fix?

 

Later EddieO

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Hello discxpress

 

I followed all the step you said to do but when I go to install the modules, they are not showing

 

I am using oscommerce 2.3.1

 

Can you help me please

 

Thank you

 

Ian

Link to comment
Share on other sites

Perfect it works now mate

 

Thank you

 

Appreciate it

 

Would you know how to get rid of the  before the pound sign in the postage and packaging drop down menu on the Paypal site when I pay for the goods

 

I added the line AddDefaultCharset ISO-8859-15 to the .htaccess that was in the home directory and then I added this line AddDefaultCharset utf-8 to .htaccess that was in the home directory then I emptied the internet cache before viewing the web page again.

 

I added them two lines at the bottom of the .htaccess file but I am still getting the  before the pound sign in the postage and packaging drop down menu

 

Thank you

 

Ian

Link to comment
Share on other sites

Hello Ian

 

I've had the same problem with  character, turned out in my case the database collation somehow always defaults to latin_swedish when a new install is undertaken

 

I ran this sql to resolve it,

 

ALTER SCHEMA 'yourdatabase' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci ;

 

or you can try changing any £ to the html equivalent of a pound sign, £ (it must have both the & and the semi-colon).

 

There is also a post about this issue see http://www.oscommerce.com/forums/topic/302941-french-letter-before-every-price-a/

 

ken

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Link to comment
Share on other sites

Hi

 

I put in ALTER SCHEMA 'yourdatabase' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci ; in the run sql

 

And I got this error Error

SQL query:

 

ALTER SCHEMA 'yourdatabase' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci

 

MySQL said:

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''yourdatabase' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci' at line 1

 

Any Ideas

 

Also I tried the other way of changing it to £ in the admin/localization/currencies on the admin side of the site and that didn't work either

 

Thank you

 

Ian

Link to comment
Share on other sites

Hi Ian

 

what is the database collation, let me know & I'll try it

 

Try entering the £ in the database rather than admin.

 

ken

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

Link to comment
Share on other sites

HI Ian, me again

 

I just checked the thread in my first post to you, the second to last post from Michael seems to have an answer, your could try this first

 

ken

 

http://forums.oscomm...-every-price-a/

Edited by kenkja

Os-commerce v2.3.3

Security Pro v11

Site Monitor

IP Trap

htaccess Protection

Bad Behaviour Block

Year Make Model

Document Manager

X Sell

Star Product

Modular Front Page

Modular Header Tags

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...