Jump to content
Roaddoctor

Shipping Quote in Cart 2.3.3.4 - Support Thread

Recommended Posts

Hi I have recently installed this addon (bootstrap version) on my site have to say with the way my shipping is calculated it works very well and customer can see the cost of shipping prior to checking out, which is definitely useful

 

I was just wondering would there be anyway of turning the shipping quote into a module box ? so instead of the button only appearing on the shopping cart page the same drop box with the country and zip code / post code would appear in say left of right box ?

 

great work by the guys involved in the original coding

Share this post


Link to post
Share on other sites

Hi

 

I couldn't stop thinking about this issue. I love Lambros' idea with the shipping-modal, but without a correct calculation of the tax it is of no use for me. So, I've tried myself to find a solution. And with some copy'n paste :- and some ajax code I finally got one.

Installation is simple:

shopping_cart.php:
after:   <div class="buttonSet">
        <span class="buttonAction">
add :
    <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#quotesModal"><?php echo GET_QUOTES; ?></button>

before: require(DIR_WS_INCLUDES . 'template_bottom.php');
add: include(DIR_WS_MODULES . 'shipping_in_cart.php');

includes/languages/your_language(s)/shopping_cart.php insert:
german:
define('GET_QUOTES', 'Versandkosten-Rechner');
define('GET_QUOTES_TITLE', 'Versandkosten-Rechner');
define('TEXT_DELIVERY_STATE', 'Bestimmungsland: ');
define('TEXT_DELIVERY_TRANSPORT', 'Versandart: ');
define('TEXT_FREE_SHIPPING', 'Versand kostenlos');

english:
define('GET_QUOTES', 'Shipping Calculator');
define('GET_QUOTES_TITLE', 'Shipping Calculator');
define('TEXT_DELIVERY_STATE', 'Destination Country: ');
define('TEXT_DELIVERY_TRANSPORT', 'Shipping Method: ');
define('TEXT_FREE_SHIPPING', 'Shipping free');
 

get_shipping_quotes.php

shipping_in_cart.php

 

Copy the file shipping_in_cart.php into the folder catalog/includes/modules
Copy the file get_shipping_quotes.php into the catalog folder

I beg for leniency, that the code is partially still somewhat sloppy.
What's still missing is a routine that automatically selects the country of logged-in customers. Currently, always the store country is chosen on the first call. I guess it's no big deal!

 

Demo here

 

Thoughts?

 

J.J.

Share this post


Link to post
Share on other sites

@@De Dokta

 

I'm testing your demo site. This is what I see when I try the shipping calculator ...

 

 

 

One more quick observation ...

 

While going through the guest checkout, you have gender as a required field, but there is no red asterisk indicating that it is required ...

 

HTH

 

Malcolm

 


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@@De Dokta

 

I'm testing your demo site. This is what I see when I try the shipping calculator ...

 

attachicon.gifScreen Capture - 01-09-15.JPG

 

One more quick observation ...

 

While going through the guest checkout, you have gender as a required field, but there is no red asterisk indicating that it is required ...

 

HTH

 

Malcolm

 

@@ArtcoInc

 

"Shipping Quote in cart" means Shipping Quote in CART! Your screenshot doesn't show the shopping cart, but the product info. This is NOT the shipping calculator, this is the shipping info modal from "tax info and shipping" (obligatory in Germany! :x )

Put something into your shopping cart (buy or add to cart button), call the shopping cart where you now find a button Shipping Calculator. Et violà!

And you don't need to log in!

 

J.J.

Share this post


Link to post
Share on other sites

Hi, i´m Brazilian, and i´m trying to install this more than 5 times, i dont have any idea  what´s the problem, i can´t see any shipping option in my shopping cart, i test whit many shipping options and all are looking ok in checkout_shipping.

Edited by burt
remove commercial solicitation

I did, helped or traslate.

http://addons.oscommerce.com/profile/104964

 

My english it´s só poor, but of you need help in portuguese, like shipping and payment that´s make a diference in brazil, come one,

Obrigado (thank´s)

 

Share this post


Link to post
Share on other sites

@@De Dokta

 

 

"Shipping Quote in cart" means Shipping Quote in CART! Your screenshot doesn't show the shopping cart, but the product info. This is NOT the shipping calculator, this is the shipping info modal from "tax info and shipping" (obligatory in Germany! :x )

Put something into your shopping cart (buy or add to cart button), call the shopping cart where you now find a button Shipping Calculator. Et violà!

And you don't need to log in!

 

J.J.

 

You are right ... I was in the wrong screen :blush: :wacko: o:)

 

Once I put an item in the cart, and got to the right screen, :-  the shipping calculator worked fine. Tried different countries and shipping methods (flat rate or postal mailing).

 

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@@De Dokta

 

Very nice J.J.! Bravo!

Love the Ajax feature.

I haven't installed it to my demo shop yet but from what i see on your demo site it works fantastic.

Share this post


Link to post
Share on other sites

I am guessing this will be hard to implement this on MVS? I am about to upload the new version of MVS for 2.3.4 but looking for a new shipping estimator. Anyone?

Share this post


Link to post
Share on other sites

@@De Dokta

 

Hi J.J.

 

I finally had time to install your Shipping Quotes Version to my test shop.

 

I have two shipping modules installed.

 

 - Zone Shipping by State (for domestic shipping)

 - And a modified version of the Swiss Post module. (for international shipping)

 

When i am "not" logged in the calculation seems to work fine except for the domestic shipping i get an "Invalid Zone" error. I guess that happens because of the Zone Shipping by State module that needs additional modifications.

When changing to any other country i get the right calculations.

 

My problem starts when i am logged in. Japan is domestic for me and any other country would be international.

So after log in and setting an international address as primary I open the modal and I see Japan in the first drop down and only international shipping methods. Which makes no sense since there shouldn't be international shipping for Japan.

Same if i set a Japanese address as primary, i get the correct shipping (no invalid zone error this time) but no matter if I choose USA or Jamaica or any other country it alsways shows the domestic shipping module and price.

 

So no matter what i choose as destination it won't recalculate or change shipping module once I am logged in.

I guess this happens because he calculates from the address that is currently set as primary in the my account area.

I hope all what I explained so far makes sense...

 

Again when "not" logged in everything seems to be working fine but once logged in it won't recalculate or change shipping module when choosing a country from the drop down.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@De Dokta

 

Very nice J.J. !

Yes that seems to work nicely!

 

Now, when logged in the shipping method changes when switching between the countries.

I also see that you were able to show the country in the dropdown that is set in the primary address when the customer is logged in, sweet!

I still have an "invalid zone" issue for my domestic shipping module though but as i said that is something that I need to fix on my part.

 

There is one more thing that I would like to ask, i could look myself but if you know a quick answer....

In the second dropdown where you choose the shipping method, what code do I need to change to be able to show the [methods] name and not the [module] name. make sense?

 

For example, mine says Japan Post International for both methods. I want it to show "Airmail" and "(EMS) Express Shipping".

Edited by Tsimi

Share this post


Link to post
Share on other sites

After more testing and looking at the codes....

 

I couldn't figure out how to change the shipping inside the dropdown yet..... >_<

Regarding my domestic module issue (Zones by State), as the title says Zones by State but the estimator is looking for countries only and not state ids. I have not the slightest idea how to implement that yet so that he looks for country ids and state ids.

Share this post


Link to post
Share on other sites

@@wHiTeHaT

 

maybe the customer wants to send his package to an other country?

With the latest files of De Dokta the primary address is pre-selected inside the dropdown once logged in which is good and if a customer wants to get a quote on shipping to Fidji or Netherlands then he can do that.

 

...do you have any idea how to add country states and not only countries to the estimator?

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@Tsimi
 

There is one more thing that I would like to ask, i could look myself but if you know a quick answer....
In the second dropdown where you choose the shipping method, what code do I need to change to be able to show the [methods] name and not the [module] name. make sense?
 
For example, mine says Japan Post International for both methods. I want it to show "Airmail" and "(EMS) Express Shipping".


Hi Lambros
 
I'm not sure if I exactly understand what you mean. Do you want to display in the pulldown that part that appears in checkout process after the name of the shipping module in brackets, e.g. Flat Rate (Best Way) ?
If so, look in both files for:

 $quotes_array[] = array('id' => $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'], 'text' => $quotes[$i]['module']);

and replace it by:

  $quotes_array[] = array('id' => $quotes[$i]['id'].'_'.$quotes[$i]['methods'][$j]['id'], 'text' => $quotes[$i]['methods'][$j]['title']);

also look for  (2x in each file) 

$title_shipping = $quotes[$i]['module'];

and replace it with:

   $title_shipping = $quotes[$i]['methods'][$j]['title'];

For your zones/states problem I have no quick answer. I never saw a shipping module which works on the basis of states (probably because something like that is not needed in Europe :D ) - so I don't know how they work. I suppose they use the entry_zone_id!? But it should be possible - for example as in create account - to add a logic that checks to see whether a country has zones, and if so, will open a second pulldown for states.........A lot of effort for such a gimmick!

 

J.J.


 

Share this post


Link to post
Share on other sites

 

I never saw a shipping module which works on the basis of states (probably because something like that is not needed in Europe :D ) - so I don't know how they work.

 

http://addons.oscommerce.com/info/4703  (w00t) 

 

You guys in Germany deserve a break, you got all kinds of silly laws and rules that you have to care about so why not have something "normal" from time to time. :P 

I need to have a shipping module that checks the country states, domestic shipping varies and therefore it is needed. Not a "gimmick" that I wish to have just a necessity. :wacko:

 

The other thing, worked like a charm. Thank you very much!

I was close though i just didn't add the [$j]['title'] part, only ['methods']. >_<

Edited by Tsimi

Share this post


Link to post
Share on other sites

@@De Dokta

 

I think I am having a small break through with the domestic shipping module situation. But can't find the last piece of the puzzle yet.

When I am "not" logged in I can see Japan inside the dropdown as default and below "finally" the correct shipping method and cost.

Still not logged in I can switch to an international country and it shows nicely the correct shipping method and price.

So the not logged in part is done! Will do more testing though just to make sure...

 

Now my problem is when logged in. When i set an international address as default (let's say Switzerland) the modal opens and shows Switzerland by default inside the dropdown and shipping method and price are correct. Still inside the same open modal i choose Japan and it shows the correct shipping method and price.

Now if I set Japan as default address and open the modal i get this Invalid Zone message again. And if i choose any other country it shows the correct international shipping method and price. And then if I switch back to Japan it shows the right shipping method and price.

So this one last thing needs to be solved and my guess would be somewhere inside the shipping_in_cart.php file.

I would appreciate it if you (or anyone else of course) could take a look at my current 2 files and tell me what I am missing.

 

shipping_in_cart.php

http://pastebin.com/ZTF3fusF

get_shipping_quotes.php

http://pastebin.com/hnSu1dUy
 

Edited by Tsimi

Share this post


Link to post
Share on other sites

Ok, next try - with a zones pulldown for those countries for which states/zones are stored in the database.

Since I use no shipping module, which works with zones, I would very much appreciate it if someone with such a module would test if it works correctly. Only for bootstrap!

shipping_in_cart.php

get_shipping_quotes.php

 

J.J.

Edited by De Dokta

Share this post


Link to post
Share on other sites

@@De Dokta

 

Hi J.J.

 

Just tested...no luck...in my case. Still cool though the new drop down with the states/zones. He shows them correct.

The Zones/States show but I still get the invalid zone message. No matter if logged in or not.

Also when i choose "Please select" again in the zones drop down the whole list inside the drop down disappears.

 

this following is from the install manual to that shipping module that I use

 

 

[catalog/]includes/classes/order.php

on or around line 163:

change this:
        $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 . "'");

To this:
        $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, z.zone_code, 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 . "'");


Note: adds 'z.zone_code' to $shipping_address_query in function cart().


on or around line 262:

Change this:
                              'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_name']),

To this:
                              'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_code']),
 

 

as you can see it changes from zone_name to zone_code. But again this is just in MY case I don't know how your latest files work with a regular zone shipping module or Jim's MZMT addon.

Edited by Tsimi

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

×