Jump to content
Sign in to follow this  
wheeloftime

Estimated Shipping Costs

Recommended Posts

Update available to Estimated Shipping v1.5 with UPS-USPS support

 

On request the UPS/USPS shipping option will not be shown when there is an empty zipcode field. UPS/USPS would return a kind of cryptic error message on that anyway. The error for an invalid zipcode will be returned as normal. For those countries where a valid, or any, zipcode is not neccessary UPS/USPS will show the quotes as normal (at least UPS does, I can't test for USPS).

 

regards,

Howard

Share this post


Link to post
Share on other sites

How do I add this Contribution on the Shopping cart only so when people are in the shopping cart page shopping_cart.php they can see the Estimated Shipping. I tried what someone posted a couple of pages back but did not work. Like in the install text it says on step 3 it says Add the following to the file catalog/includes/classes/boxes.php (just before the last ?>): but do I still need to do that is I want it on the shopping_cart.php ?

Share this post


Link to post
Share on other sites
How do I add this Contribution on the Shopping cart only so when people are in the shopping cart page shopping_cart.php they can see the Estimated Shipping.  I tried what  someone posted a couple of pages back but did not work.  Like in the install text it says on step 3 it says Add the following to the file catalog/includes/classes/boxes.php (just before the last ?>): but do I still need to do that is I want it on the shopping_cart.php ?

 

Yes, you still need to add that part to the boxes.php as it is used for both flavors.

On page 2 of this thread you will find how to add it correctly to the shopping cart page. It is merely a matter of not including the estimated shipping before the ending </form> tag from the shopping cart page itself.

Read step 6B from the install instructions for which files to rename to properly use it on a normal page instead of as an infobox.

Share this post


Link to post
Share on other sites
Make sure you have your shop's zipcode defined in your admin->configuration->shipping/packaging->Postal Code (only the 46526)

Well, I have the exact same error, and I did initialy forget my zip code as well. However, after putting in my zip code, I still get the error. Any suggestions?

Share this post


Link to post
Share on other sites
Well, I have the exact same error, and I did initialy forget my zip code as well.  However, after putting in my zip code, I still get the error.  Any suggestions?

 

If you still get invalid shipperpostalcode there still must be something wrong with it I guess. Have you filled in Country of Origin as United States ?

I have not really a clue for you as the only way I could test this was to find a valid 5 number US zipcode on the internet and make the testshop of US origin. After that it worked and I don't know of any other possible configurations options which might influence this.

Share this post


Link to post
Share on other sites
Yes, you still need to add that part to the boxes.php as it is used for both flavors.

On page 2 of this thread you will find how to add it correctly to the shopping cart page. It is merely a matter of not including the estimated shipping before the ending </form> tag from the shopping cart page itself.

Read step 6B from the install instructions for which files to rename to properly use it on a normal page instead of as an infobox.

 

Still having problems I'm sypposed to see this on the shopping cart page but nothing comes up.

I did what page 2 says. 6b I don't understand because you wanted to look for a certain part and replace it I igored this because it looks like what page 2 says. Then I renamed the Rename the file catalog/includes/modules/estimated_shipping.php to ie.

catalog/includes/modules/estimated_shipping_infobox.php and afterwards the file

catalog/includes/modules/estimated_shipping_index.php to

catalog/includes/modules/estimated_shipping.php.

But nothing happens. I followed all the other instructions from 1-5 then did what it said on page2 Please tell me what I did wrong. thanks

Share this post


Link to post
Share on other sites
Still having problems I'm sypposed to see this on the shopping cart page but nothing comes up.

I did what page 2 says.  6b I don't understand because you wanted to look for a certain part and replace it I igored this because it looks like what page 2 says.  Then I renamed the Rename the file catalog/includes/modules/estimated_shipping.php to ie.

catalog/includes/modules/estimated_shipping_infobox.php and afterwards the file

catalog/includes/modules/estimated_shipping_index.php to

catalog/includes/modules/estimated_shipping.php.

But nothing happens.  I followed all the other instructions from 1-5 then did what it said on page2 Please tell me what I did wrong. thanks

 

Well, to start with the obvious question: did you have something inside your cart before looking at the shopping cart page ? The estimated shipping box only shows when there is 1 or more items in the cart.

 

6b) doesn't say to replace anything but gives an example for the index.php of where to put the

<?php include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING); ?>

On page 2 of this thread it gives a correct position for if you want to use it on the shopping cart page.

If the include is placed correctly and after the renaming you still have an estimated_shipping.php while the other files are at the correct place also there should be no reason why it will not show.

Please give a link to look at if the above doesn't resolve your problem !

Share this post


Link to post
Share on other sites
Well, to start with the obvious question: did you have something inside your cart before looking at the shopping cart page ? The estimated shipping box only shows when there is 1 or more items in the cart.

 

6b) doesn't say to replace anything but gives an example for the index.php of where to put the

<?php include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING); ?>

On page 2 of this thread it gives a correct position for if you want to use it on the shopping cart page.

If the include is placed correctly and after the renaming you still have an estimated_shipping.php while the other files are at the correct place also there should be no reason why it will not show.

Please give a link to look at if the above doesn't resolve your problem !

Yes I did have something on my cart. So then i should not have done this on 6b Rename the file catalog/includes/modules/estimated_shipping.php to ie.

catalog/includes/modules/estimated_shipping_infobox.php and afterwards the file

catalog/includes/modules/estimated_shipping_index.php to

catalog/includes/modules/estimated_shipping.php.

 

So I should not have done that because I did. I did rename the files. I can't give you a link because this is on a test box on my pc so I can make sure everything works before puting it online. What I can do if you want it copy all the php files that I made the changes so you can take a look at it. Thank you

Share this post


Link to post
Share on other sites
Yes I did have something on my cart.? So then i should not have done this on 6b? Rename the file catalog/includes/modules/estimated_shipping.php to ie.

catalog/includes/modules/estimated_shipping_infobox.php and afterwards the file

catalog/includes/modules/estimated_shipping_index.php to

catalog/includes/modules/estimated_shipping.php.

 

So I should not have done that because I did.? I did rename the files.? I can't give you a link because this is on a test box on my pc so I can make sure everything works before puting it online.? What I can do if you want it copy all the php files that I made the changes so you can take a look at it. Thank you

 

Billy,

 

No, you did right renaming the files ! The default includes/modules/estimated_shipping.php is for use as an infobox. By renaming this file first to includes/modules/estimated_shipping_infobox.php you have a reminder, by the name, where it is supposed to be used for in case you want to use estimated shipping with an infobox at a later time. After that you rename the file includes/modules/estimated_shipping_index.php to includes/modules/estimated_shipping.php and that should take care for the little difference in displaying the estimated shipping box as an infobox in the left/right column or somewhere inside the index.php, shopping_cart.php etc.

Then you should also have a file estimated_shipping_functions.php inside the directory includes/functions/, a file estimated_shipping_class.php inside the directory includes/classes and a file estimated_shipping.php inside each of your language directories (like includes/languages/english/estimated_shipping.php).

And not to forget the line

  define('FILENAME_ESTIMATED_SHIPPING', 'estimated_shipping.php');
inside the file includes/filenames.php.

If that is all set you should see it unless there is something wrong with the placement of include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING).

Or, didn't think of that earlier, you use maybe a templating system which could make things different ?

If you can't give a link to your shop then copy/paste the code for your shopping_cart.php here please.

 

regards,

Howard

Edited by wheeloftime

Share this post


Link to post
Share on other sites

I have the estimated shipping costs contribution installed and just noticed in testing my cart that when I go to view my test customer account history (http://www.tallpoppycraft.com/catalog/account_history_info.php?order_id=14) I get the following error in the estimated shipping box:

 

Fatal error: Cannot redeclare class order in /home/.sites/23/site156/web/catalog/includes/classes/estimated_shipping_class.php on line 14

 

Is there something I have missed?

 

Sarah

Share this post


Link to post
Share on other sites
I have the estimated shipping costs contribution installed and just noticed in testing my cart that when I go to view my test customer account history (http://www.tallpoppycraft.com/catalog/account_history_info.php?order_id=14) I get the following error in the estimated shipping box:

 

Fatal error: Cannot redeclare class order in /home/.sites/23/site156/web/catalog/includes/classes/estimated_shipping_class.php on line 14

 

Is there something I have missed?

 

Sarah

 

Hello Sarah,

 

I found that problem some while ago and it should be fixed after the initial 1.0 release. If you take the latest version, non-UPS or UPS, you should not have that problem anymore.

 

regards,

Howard

Share this post


Link to post
Share on other sites
Billy,

 

No, you did right renaming the files ! The default includes/modules/estimated_shipping.php is for use as an infobox. By renaming this file first to includes/modules/estimated_shipping_infobox.php you have a reminder, by the name, where it is supposed to be used for in case you want to use estimated shipping with an infobox at a later time. After that you rename the file includes/modules/estimated_shipping_index.php to includes/modules/estimated_shipping.php and that should take care for the little difference in displaying the estimated shipping box as an infobox in the left/right column or somewhere inside the index.php, shopping_cart.php etc.

Then you should also have a file estimated_shipping_functions.php inside the directory includes/functions/, a file estimated_shipping_class.php inside the directory includes/classes and a file estimated_shipping.php inside each of your language directories (like includes/languages/english/estimated_shipping.php).

And not to forget the line

inside the file includes/filenames.php.

If that is all set you should see it unless there is something wrong with the placement of include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING).

Or, didn't think of that earlier, you use maybe a templating system which could make things different ?

If you can't give a link to your shop then copy/paste the code for your shopping_cart.php here please.

 

regards,

Howard

 

I've got it to work looks like I forgot to add the define('FILENAME_ESTIMATED_SHIPPING', 'estimated_shipping.php'); Now my question is how can I make that smaller it's so wide and how can I make the per item, table rate and zone rate a little bigger so users can see what it says?

Edited by tegralens

Share this post


Link to post
Share on other sites
I've got it to work looks like I forgot to add the define('FILENAME_ESTIMATED_SHIPPING', 'estimated_shipping.php');  Now my question is how can I make that smaller it's so wide and how can I make the per item, table rate and zone rate  a little bigger so users can see what it says?

 

Hi Billy,

 

Glad to read you got it to work ! As for the wide; you can adjust that to your liking within the file catalog/includes/modules/estimated_shipping.php

Look for the part:

$info_box_contents[] = array('form' => tep_draw_form('estimated_shipping', tep_href_link(basename($PHP_SELF), '',$request_type, false), 'post'),
         'align' => 'left',
         'text' => TEXT_EXPLAIN_ESTIMATED_SHIPPING . '<BR>' .  TEXT_COUNTRY_TO_SHIP_TO . '<BR><TABLE WIDTH="100%"><TR><TH>' . tep_get_country_list('country', $country, 'onChange="this.form.submit();" style="width: 100%"') . '</TH><TR></TABLE>' . tep_get_estimated_shipping_quotes($country,  $HTTP_GET_VARS['action'],$customer_country_id));

Adjust the tag <TABLE WIDTH="100%"> to some other percentage until it fits for you.

 

The shipping textual thing you ar refering to you can alter by adjusting the font-szie part in catalog/stylesheet.css for the underneath section

.ShowShipping {
 background: #444ddd;
 color: #fffffa;
 font-family: Verdana, Arial, sans-serif;
 font-size: 6px;
 font-weight: bold;
 text-align: center;
}

I don't know why I put there 6px as it should be 10 or 11 px to be readable.

When checking in Firefox all seemed fine but later I realized that was because you can set your minimum font size in Firefox and so even with set to 1px it would show as 10px in Firefox :D With Internet Explorer that isn't an option and it will show the defined size which is that 6px :blush:

Share this post


Link to post
Share on other sites

Any thoughts on getting this to work with DHL?

 

I tried to change the line in functions to,

 

if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service' || $quotes[$i]['module'] == 'DHL/Airborne') && (!tep_not_null($estzipcode))) {

 

But doesnt work...

 

I wish I was a better at programming.

Share this post


Link to post
Share on other sites
Any thoughts on getting this to work with DHL?

 

I tried to change the line in functions to,

 

if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service' || $quotes[$i]['module'] == 'DHL/Airborne') && (!tep_not_null($estzipcode))) {

 

But doesnt work...

 

I wish I was a better at programming.

 

Which DHL contribution/module do you use ? I'll have to check for that one to see if it can be made working.

Share this post


Link to post
Share on other sites
Wow, that was fast.

 

Im using,

 

Airborne Express Quotes using ShipIT XML API

 

http://www.oscommerce.com/community/contri...,all/search,DHL

 

I picked the latest version for that DHL flavor and can only check if it shows up (which it does but I get no output as I have no valid ID/Pw/Account). What specifc error do you encounter ?

Share this post


Link to post
Share on other sites

This is when i add a item to the cart with no zipcode

 

DHL/Airborne (1 x 6lbs)

The following errors have occured:

1. Postal Code invalid.

2. Required element/node is missing.

3. Required element/node is missing.

 

This is when a zip code is entered.

 

The following errors have occured:

1. Sender Zip code not found.

2. Required element/node is missing.

3. Required element/node is missing.

Share this post


Link to post
Share on other sites
Hi Billy,

 

Glad to read you got it to work ! As for the wide; you can adjust that to your liking within the file catalog/includes/modules/estimated_shipping.php

Look for the part:

$info_box_contents[] = array('form' => tep_draw_form('estimated_shipping', tep_href_link(basename($PHP_SELF), '',$request_type, false), 'post'),
         'align' => 'left',
         'text' => TEXT_EXPLAIN_ESTIMATED_SHIPPING . '<BR>' .  TEXT_COUNTRY_TO_SHIP_TO . '<BR><TABLE WIDTH="100%"><TR><TH>' . tep_get_country_list('country', $country, 'onChange="this.form.submit();" style="width: 100%"') . '</TH><TR></TABLE>' . tep_get_estimated_shipping_quotes($country,  $HTTP_GET_VARS['action'],$customer_country_id));

Adjust the tag <TABLE WIDTH="100%"> to some other percentage until it fits for you.

 

The shipping textual thing you ar refering to you can alter by adjusting the font-szie part in catalog/stylesheet.css for the underneath section

.ShowShipping {
 background: #444ddd;
 color: #fffffa;
 font-family: Verdana, Arial, sans-serif;
 font-size: 6px;
 font-weight: bold;
 text-align: center;
}

I don't know why I put there 6px as it should be 10 or 11 px to be readable.

When checking in Firefox all seemed fine but later I realized that was because you can set your minimum font size in Firefox and so even with set to 1px it would show as 10px in Firefox  :D With Internet Explorer that isn't an option and it will show the defined size which is that 6px  :blush:

 

Thanks for your help

Share this post


Link to post
Share on other sites
Hi Billy,

 

Glad to read you got it to work ! As for the wide; you can adjust that to your liking within the file catalog/includes/modules/estimated_shipping.php

Look for the part:

$info_box_contents[] = array('form' => tep_draw_form('estimated_shipping', tep_href_link(basename($PHP_SELF), '',$request_type, false), 'post'),
         'align' => 'left',
         'text' => TEXT_EXPLAIN_ESTIMATED_SHIPPING . '<BR>' .  TEXT_COUNTRY_TO_SHIP_TO . '<BR><TABLE WIDTH="100%"><TR><TH>' . tep_get_country_list('country', $country, 'onChange="this.form.submit();" style="width: 100%"') . '</TH><TR></TABLE>' . tep_get_estimated_shipping_quotes($country,  $HTTP_GET_VARS['action'],$customer_country_id));

Adjust the tag <TABLE WIDTH="100%"> to some other percentage until it fits for you.

 

The shipping textual thing you ar refering to you can alter by adjusting the font-szie part in catalog/stylesheet.css for the underneath section

.ShowShipping {
 background: #444ddd;
 color: #fffffa;
 font-family: Verdana, Arial, sans-serif;
 font-size: 6px;
 font-weight: bold;
 text-align: center;
}

I don't know why I put there 6px as it should be 10 or 11 px to be readable.

When checking in Firefox all seemed fine but later I realized that was because you can set your minimum font size in Firefox and so even with set to 1px it would show as 10px in Firefox  :D With Internet Explorer that isn't an option and it will show the defined size which is that 6px  :blush:

 

Hello again, when I change that to let's say 50% the only thing that changes is the size of the country. What I wanted is the size of the whole estimated shipping costs to be smaller. Any ideas

Share this post


Link to post
Share on other sites
This is when i add a item to the cart with no zipcode

 

DHL/Airborne (1 x 6lbs)

The following errors have occured:

1. Postal Code invalid.

2. Required element/node is missing.

3. Required element/node is missing.

 

This is when a zip code is entered.

 

The following errors have occured:

1. Sender Zip code not found.

2. Required element/node is missing.

3. Required element/node is missing.

 

To surpress the error when no zipcode is entered you can change

  if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service') && (!tep_not_null($estzipcode))) {

to

  if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service' || substr($quotes[$i]['module'],0,8) == 'Airborne') && (!tep_not_null($estzipcode))) {

As the module returns 'Airborne Express' with the addition of the package information ie. Airborne Express (1 x 0.5lbs : 1lbs) you can only check for the first certain characters as that string will differ for each package. I think checking for 'Airborne' is enough (if DHL specific and not colliding with other shippers).

 

The error for 'Sender Zip code not found' is probably related to your setting with Admin->Configuration->Shipping/Packaging. You must have a valid postal code for your own shop defined there.

The ID errors I have no clue for, they most likely will be related to all the personal information you have to fill in with this module to be able to use it with DHL at all. Maybe you can find more information inside one of the DHL shipping threads (if there are).

 

I can get as far as this in my test shop (made it US based with a US zipcode):

The following errors have occured:

1. Required element/node is missing.

    (The required node <ID> is missing, empty, or contains a value that is not the correct data type.)

And as explained above that must be due to the fact I have no DHL ID, no password and no account with them to fill in.

 

I hope this will get you a bit further and you can get it working !

Share this post


Link to post
Share on other sites

I changed your line from

 

 ?if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service' || substr($quotes[$i]['module'],0,8) == 'Airborne') && (!tep_not_null($estzipcode))) {

 

to

 

  if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service' || substr($quotes[$i]['module'],0,3) == 'DHL') && (!tep_not_null($estzipcode))) {

 

All the the zip code errors are gone now, but Im still getting

 

DHL/Airborne (1 x 6lbs)

The following errors have occured:

1. Required element/node is missing.

2. Required element/node is missing.

 

Everything is correct in my configuration, I will see if I can find where that error is coming from

Share this post


Link to post
Share on other sites
I changed your line from

 

 ?if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service' || substr($quotes[$i]['module'],0,8) == 'Airborne') && (!tep_not_null($estzipcode))) {

 

to

 

 ?if (($quotes[$i]['module'] == 'United Parcel Service' || $quotes[$i]['module'] == 'United States Postal Service' || substr($quotes[$i]['module'],0,3) == 'DHL') && (!tep_not_null($estzipcode))) {

 

You have another module or changed the module name but if you change it accordingly, as you did, you will catch it.

I am sorry I can't help you with the rest but please put some feedback here once you have found where the error comes from so others who use DHL might find some clue with that information when needed !

Share this post


Link to post
Share on other sites
Hello again, when I change that to let's say 50% the only thing that changes is the size of the country.  What I wanted is the size of the whole estimated shipping costs to be smaller.  Any ideas

 

You are right, those two values inside the modules/estimated_shipping.php have no influence when you want the whole box smaller.

The best I could find so quickly is to change the part where you include the module (default in catalog/index.php)

<?php include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING); ?>

to

<table width="50%">
<?php include(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING); ?>
</table>

You'll have to play around with it a bit more as it only gets smaller to a certain amount after which there is no change whether I set 10%, 20% or something in that order.

Share this post


Link to post
Share on other sites
Hello again, when I change that to let's say 50% the only thing that changes is the size of the country.  What I wanted is the size of the whole estimated shipping costs to be smaller.  Any ideas

Did you get a chance to see this about the 50% only changes the country?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×