Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Estimated Shipping Costs


Recommended Posts

Here is the output from debuging the module.. Looks like they require city and street address to quote? Does this look like that to you?

 

<?xml version="1.0"?>
<eCommerce version="1.1" action="Response" timestamp="2005/08/31T07:00:18" transmission_reference="758285C1"><Requestor><ID>*********</ID>
<Password><![CDATA[********]]></Password></Requestor><Shipment action="RateEstimate" version="1.0" test="True"><Faults><Fault><Code>2553</Code>
<Desc>Required element/node is missing.</Desc><Source>Shipment/Receiver/Address/State</Source></Fault><Fault><Code>1002</Code>
<Desc>Required element/node is missing.</Desc><Source>Shipment/Receiver/Address/City</Source></Fault></Faults><Result><
Code>202</Code><Desc>The shipment could not be rated.</Desc></Result><ShippingCredentials><ShippingKey>*****</ShippingKey>
<AccountNbr>*****</AccountNbr></ShippingCredentials><ShipmentDetail><ShipDate>2005-09-02</ShipDate><Service><Code>G</Code></Service><ShipmentType>
<Code>P</Code></ShipmentType><Weight>1</Weight><Dimensions><Length>0</Length><Width>0</Width><Height>0</Height></Dimensions><SpecialServices>
<SpecialService><Code>SAT</Code></SpecialService></SpecialServices></ShipmentDetail><Billing><Party><Code>S</Code></Party></Billing><Sender/>

 

Sorry I mean City and State

Edited by waxteddy
Link to comment
Share on other sites

  • Replies 388
  • Created
  • Last Reply

Top Posters In This Topic

Here is the output from debuging the module.. Looks like they require city and street address to quote? Does this look like that to you?

 

<?xml version="1.0"?>
<eCommerce version="1.1" action="Response" timestamp="2005/08/31T07:00:18" transmission_reference="758285C1"><Requestor><ID>*********</ID>
<Password><![CDATA[********]]></Password></Requestor><Shipment action="RateEstimate" version="1.0" test="True"><Faults><Fault><Code>2553</Code>
<Desc>Required element/node is missing.</Desc><Source>Shipment/Receiver/Address/State</Source></Fault><Fault><Code>1002</Code>
<Desc>Required element/node is missing.</Desc><Source>Shipment/Receiver/Address/City</Source></Fault></Faults><Result><
Code>202</Code><Desc>The shipment could not be rated.</Desc></Result><ShippingCredentials><ShippingKey>*****</ShippingKey>
<AccountNbr>*****</AccountNbr></ShippingCredentials><ShipmentDetail><ShipDate>2005-09-02</ShipDate><Service><Code>G</Code></Service><ShipmentType>
<Code>P</Code></ShipmentType><Weight>1</Weight><Dimensions><Length>0</Length><Width>0</Width><Height>0</Height></Dimensions><SpecialServices>
<SpecialService><Code>SAT</Code></SpecialService></SpecialServices></ShipmentDetail><Billing><Party><Code>S</Code></Party></Billing><Sender/>

 

Sorry I mean City and State

 

That makes more sense indeed and that information is not passed to the shipping modules which explains the error(s). The idea for me to build this was to provide shipping costs before login/register and going to the checkout. City and State information are then of course not available which seems fine for UPS and USPS but appearantly not for DHL. This means the DHL module is only to be used for logged in/registered customers and to get it working would imply to have the estimated_shipping_class.php changed.

Link to comment
Share on other sites

Yeah, It looks like I have two choices. Create City and State fields to the est., or maintain my own zip code database. DHL is such a pain, they are cheap and fast, but they still have their issues...

 

I really dont understand why its a requirement when you can get est. from the their website wih just a zip code..

Link to comment
Share on other sites

I really dont understand why its a requirement when you can get est. from the their website wih just a zip code..

 

I didn't want to say that but it wondered me too. Probably the online DHL module you have to use with osC is not (yet) on par with their normal online shipping module ?! You could inquire with them if that is going to change in the near future or if a simple setting can make the module work without the need for city and state.

You can also try to adept the catalog/includes/classes/estimated_shipping_class.php but it will still only work if your customers are logged in into your site.

If you reinstate the following query:

      $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'");
     $shipping_address = tep_db_fetch_array($shipping_address_query);

and change

'city' => ''
and
'state' => ''

to

'city' => $shipping_address['entry_city']
and
'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_name'])

it should be enough to get it working with the DHL module.

I haven't tested this but it should give the required information and not inferre for customers who are not logged in (and therefore can't use estimated shipping costs for DHL quotes).

Link to comment
Share on other sites

I replaced

 

'city' => ''

 

with

 

'city' => 'dummy'''

 

And the requirement for the City went away..

 

I was thinking about changing estimated_shipping.php to include a state selection..

 

                $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><CENTER>' .  TEXT_COUNTRY_TO_SHIP_TO . '</CENTER><TABLE WIDTH="' . BOX_WIDTH . '"><TR><TH colspan="3">' . tep_get_country_list('country', $country, 'onChange="this.form.submit();" style="width:' . (BOX_WIDTH+50) . 'px"') . '</th></tr><tr><td align="left" class="smallText">' . TEXT_ZIPCODE . '</td><td align="left">' . tep_draw_input_field('estzipcode', $estzipcode,'MAXLENGTH="20" SIZE="10"') . '</td><td align="center" class="smallText">' . TEXT_ZIPCODE_SUBMIT . '</td></tr></TABLE>' . tep_get_estimated_shipping_quotes($country,  $HTTP_GET_VARS['action'],$customer_country_id));

 

You think making a change in there and in estimated_shipping_class.php

 

'state' => $custstate,

 

or something

 

I send them an email asking them whats the deal...

Link to comment
Share on other sites

I replaced

 

'city' => ''

 

with

 

'city' => 'dummy'''

 

And the requirement for the City went away..

 

I was thinking about changing estimated_shipping.php to include a state selection..

 

 ? ? ? ? ? ? ? ?$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><CENTER>' . ?TEXT_COUNTRY_TO_SHIP_TO . '</CENTER><TABLE WIDTH="' . BOX_WIDTH . '"><TR><TH colspan="3">' . tep_get_country_list('country', $country, 'onChange="this.form.submit();" style="width:' . (BOX_WIDTH+50) . 'px"') . '</th></tr><tr><td align="left" class="smallText">' . TEXT_ZIPCODE . '</td><td align="left">' . tep_draw_input_field('estzipcode', $estzipcode,'MAXLENGTH="20" SIZE="10"') . '</td><td align="center" class="smallText">' . TEXT_ZIPCODE_SUBMIT . '</td></tr></TABLE>' . tep_get_estimated_shipping_quotes($country, ?$HTTP_GET_VARS['action'],$customer_country_id));

 

You think making a change in there and in estimated_shipping_class.php

 

'state' => $custstate,

 

or something

 

I send them an email asking them whats the deal...

 

So a 'dummy' for the city was already enough :D Didn't that work for a state also ?! Do you ship national as well as international ? Not all countries have states so you would have to make something similar as with the account creation. I wonder what state information DHL would want to have for countries like Holland, Belgium and others without states ?

Link to comment
Share on other sites

So a 'dummy' for the city was already enough  :D Didn't that work for a state also ?! Do you ship national as well as international ? Not all countries have states so you would have to make something similar as with the account creation. I wonder what state information DHL would want to have for countries like Holland,  Belgium and others without states ?

 

Nope didnt work for state, I dont ship DHL international. There rates are to high for that. I have DHL zoned to states only.

 

I think Ill wait to hear from DHL before I put a bunch of work into rewriting the module to include a state option.

Link to comment
Share on other sites

I think Ill wait to hear from DHL before I put a bunch of work into rewriting the module to include a state option.

 

Seems like a good idea. In the meantime you can always try the steps I described so at least registered customers can get their shipping quote on beforehand.

 

grtz,

Howard

Link to comment
Share on other sites

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.

Will try this and let you know thanks

Link to comment
Share on other sites

Hello-

State and zip are required.

Regards,

XML Implementation Team

 

DHL! Err! What kind of email is that!

 

Must be the shortest mail ever :lol: But it's clear what they need for input so if you want to use the contribution there must be a state selection attached to it. Shouldn't be a problem now you only ship within the US.

Link to comment
Share on other sites

Well, Well.. I found this in the ShipIt Documentation!

 

There are three Override Codes available:Z1 - When you know that the Receiver\Address\PostalCode is not in the Receiver\Address\State use Z1 to override the DHL error message and generate the shipment.  Note that by utilizing the Z1 override, the shipment may incur misroute fees.

 

I updated the DHL module with the follwing code

 

          $request .= "<ShipmentProcessingInstructions>" .
                       "<Overrides>" .
                         "<Override>" .
                           "<Code>Z1</Code>" .
                         "</Override>" .
                       "</Overrides>" .
                     "</ShipmentProcessingInstructions>";

 

I then put a generic state in the class

 

'state' => 'Washington',

 

I looks like it works! What a hack! only took me 8 hours.. Thanks for your help.. I still need to make sure these are correct estimates.... I manually enter addressed for shipping lables so if the customer entered there state or zipcode wrong I will know then...

Link to comment
Share on other sites

Well, Well.. I found this in the ShipIt Documentation!

 

There are three Override Codes available:Z1 - When you know that the Receiver\Address\PostalCode is not in the Receiver\Address\State use Z1 to override the DHL error message and generate the shipment. ?Note that by utilizing the Z1 override, the shipment may incur misroute fees.

 

I updated the DHL module with the follwing code

 

 ? ? ? ? ?$request .= "<ShipmentProcessingInstructions>" .
? ? ? ? ? ? ? ? ? ? ? ?"<Overrides>" .
? ? ? ? ? ? ? ? ? ? ? ? ?"<Override>" .
? ? ? ? ? ? ? ? ? ? ? ? ? ?"<Code>Z1</Code>" .
? ? ? ? ? ? ? ? ? ? ? ? ?"</Override>" .
? ? ? ? ? ? ? ? ? ? ? ?"</Overrides>" .
? ? ? ? ? ? ? ? ? ? ?"</ShipmentProcessingInstructions>";

 

I then put a generic state in the class

 

'state' => 'Washington',

 

I looks like it works! What a hack! only took me 8 hours.. Thanks for your help.. I still need to make sure these are correct estimates.... I manually enter addressed for shipping lables so if the customer entered there state or zipcode wrong I will know then...

 

That sounds good ! A backdoor afterall which maybe isn't even surprising if they can give accuratie quotes from their own website with country/zipcode information only. You should be able to check the correctnes of the quotes quickly enough by doing sme test orders. I'm curious if it can work this way for DHL.

Link to comment
Share on other sites

I have a Problem everything looks fine but when I change the ship to country, what happens is that it empties the shopping cart and says your shopping cart is empty?  Any ideas?

 

Look at post #53 of page 3

I have never experienced this problem but that should give you the solution.

Link to comment
Share on other sites

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

Installed the 1.4 version and now get this error:

 

Fatal error: Call to undefined function: tep_get_estimated_shipping_quotes() in /home/.sites/23/site156/web/catalog/includes/modules/estimated_shipping.php on line 48

 

Any ideas?

Link to comment
Share on other sites

Installed the 1.4 version and now get this error:

 

Fatal error: Call to undefined function: tep_get_estimated_shipping_quotes() in /home/.sites/23/site156/web/catalog/includes/modules/estimated_shipping.php on line 48

 

Any ideas?

 

Sarah,

 

How have you installed the 1.4 version ? Have you overwritten all files with the latest ones ? The error indicates there is something wrong with the catalog/includes/functions/estimated_shipping_functions.php in your installation.

Check if the file is (still) there and alright.

Link to comment
Share on other sites

Sarah,

 

How have you installed the 1.4 version ? Have you overwritten all files with the latest ones ? The error indicates there is something wrong with the catalog/includes/functions/estimated_shipping_functions.php in your installation.

Check if the file is (still) there and alright.

Hi wheeloftime, Yup I just overwrit the old files. The estimated_shipping_functions is still there. Its also taking away the middle section of the shop so the column left (where I have the estimated shipping box installed) is sweeping from left to the middle of the page.

Link to comment
Share on other sites

Hi wheeloftime, Yup I just overwrit the old files. The estimated_shipping_functions is still there. Its also taking away the middle section of the shop so the column left (where I have the estimated shipping box installed) is sweeping from left to the middle of the page.

Must be looking "different" :D

Do you by any change use a templating system for your shop ? If all files are in the correct place and you made the changes correctly the error should not occur.

The same for breaking out of the column left, with a normal setup that shouldn't happen also. Without looking at your shop/code it's hard to tell where it goes wrong. If you can give a link to look at it might help to find some clue !

Link to comment
Share on other sites

  • 3 weeks later...

Hi guys,

I just have installed this great contribution on my "test shop". Actually I was looking for a contribution to install on my store that my customer could see the shipping fee for an item in the product page. I.e. when they look at a product, they be able to enter their zip could and then the contribution just show them the available shipping charge on that item only.

I have noticed that many people just visit a product and if they didn't like the price they will go away because they think that their is a high shipping charge for that item, while on some of my products they can choose a shipping option that cost only $0.60.

My question is, is there anyway that we could change this contribution so we could place it on the product page and it calculates the shipping charge for one item only (not the entire cart), or maybe there is a contribution for this purpose which I don't really know.

If any one could help me with this I will be appreciated.

 

Thanks to all.

Regards,

Link to comment
Share on other sites

Hi

 

Just tried out this mod after seeing a website having it in the shopping_cart.php WITH THIS:

 

Sub-Total: ?39.98

Zone Rates (Shipping to GB : 0.46 kg): ?2.52

Total: ?42.50

 

i have checked the forum and can't find any post that specifically tells how to get a 'TOTAL' including Sub-Total and Shipping WITHIN the shopping_cart.php

 

can anyone help please

 

Thanks

Edited by chooch

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

I must have mucked something up.. but the title of the Estimated Shipping box when displayed to the customer is:

TABLE_HEADING_ESTIMATED_SHIPPING

 

I can't see where I went wrong on the installation of it, and everything works perfectly. I used V1.5 with UPS support (I didn't need to, I just hadn't read this thread first so grabbed the latest version)

 

It's been installed on my shopping_cart.php

 

Any ideas? I realise it's a painfully obvious thing.. I just don't know php at all :blush:

 

 

 

Just tried out this mod after seeing a website having it in the shopping_cart.php WITH THIS:

 

Sub-Total: ?39.98

Zone Rates (Shipping to GB : 0.46 kg): ?2.52

Total: ?42.50

 

I saw that site also but I can't remember what it was.. however I am also interested in this. But I also remember someone mentioning that you would then end up with multiple totals for each different freight rate (unless you only have one shipping option)

Link to comment
Share on other sites

I must have mucked something up.. but the title of the Estimated Shipping box when displayed to the customer is:

TABLE_HEADING_ESTIMATED_SHIPPING

 

I can't see where I went wrong on the installation of it, and everything works perfectly. I used V1.5 with UPS support (I didn't need to, I just hadn't read this thread first so grabbed the latest version)

 

It's been installed on my shopping_cart.php

 

Any ideas? I realise it's a painfully obvious thing.. I just don't know php at all :blush:

I saw that site also but I can't remember what it was.. however I am also interested in this. But I also remember someone mentioning that you would then end up with multiple totals for each different freight rate (unless you only have one shipping option)

 

Morning Mr. Karl,

 

The define you are missing is the one as described in

5) Add the following to the file catalog/includes/languages/english.php

(also to dutch.php and the other language files if you use those):

// BEGIN estimated shipping

define('TABLE_HEADING_ESTIMATED_SHIPPING', 'Estimated Shipping Costs');

// END estimated shipping

from the installation instructions. Just add it to the mentioned file and it should be fine.

 

I read Chooch's remark also but I have no idea how this has been done. I am aware of only one other shipping calculator, called Ship In Cart, but I believe it does not have this kind of output.

You can integrate the Estimated Shipping module in your shopping cart page also but it will not have the same output as in the sample given plus, as you already noted, it all greatly depends if you have only one shipping option or multiple.

Link to comment
Share on other sites

I read Chooch's remark also but I have no idea how this has been done. I am aware of only one other shipping calculator, called Ship In Cart, but I believe it does not have this kind of output.

You can integrate the Estimated Shipping module in your shopping cart page also but it will not have the same output as in the sample given plus, as you already noted, it all greatly depends if you have only one shipping option or multiple.

the site is:

 

www.islamicjewellery.co.uk

 

it is running on that site but in the cart page it looks like this script modified and not the ship in cart ms2

 

does anyone have any ideas?

 

thanks

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

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