Jump to content
blucollarguy

Multi_Vendor_Shipping new thread

Recommended Posts

Hi Jim,

 

Did you manage to get this new version to work with the UPSXML module?

(Just thought I'd ask before installing it to find out if it suits my needs yet)

I tested it with both the stock UPS module and UPSXML. Two of the live stores I have installed this on are running UPSXML, although only one of those uses MVS. I did see a couple of problems with the MVS/UPSXML combination early on, but none after I finished reworking the code. That doesn't mean it won't happen, since the errors I saw appeared to be caused by the UPS server dropping the connection. They use SSL which can slow things down enough for the server to time out. There is a test file in the distribution, so you can test this out without annoying your customers. Please post your results here; I'd like to know if the problem is fixed.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
There are no country-specific restrictions in this code. You can use any osCommerce shipping module that has been modified for MVS. If the modules you want to use have not been modified, you can do this yourself using the instructions provided with the MVS distribution, or pay someone to do this for you. If you don't need to use MVS, the Shipping Estimator will work on standard osCommerce shipping modules.

 

Regards

Jim

 

Hi i do not have MVS as my modules are just used like standard OScommerce and its also used by google checkout.

 

it says "This module is for MVS (Multi Vendor Shipping) ONLY!" on the description, i take it your version will work with my stock modules?

 

Thanks

Share this post


Link to post
Share on other sites
Hi i do not have MVS as my modules are just used like standard OScommerce and its also used by google checkout.

 

it says "This module is for MVS (Multi Vendor Shipping) ONLY!" on the description, i take it your version will work with my stock modules?

 

Thanks

Earlier versions were only for MVS. This one should work with any standard osCommerce installation. I have not tried it with every possible combination of mods, so there is no guarantee that it will always work, but it should. I'm using it right now on a heavily modified store that does not have MVS installed, and it works just fine.

 

You could run the following SQL to be certain:

INSERT INTO `configuration` VALUES (NULL, 'Enable Vendor Shipping', 'SELECT_VENDOR_SHIPPING', 'false', 'Enable Multi-Vendor shipping-(true/false)', 7, 6, '2004-09-07 13:19:40', '2004-05-04 14:43:03', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');

That shouldn't be necessary, since MVS is off by default, but that would make it certain.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
I tested it with both the stock UPS module and UPSXML. Two of the live stores I have installed this on are running UPSXML, although only one of those uses MVS. I did see a couple of problems with the MVS/UPSXML combination early on, but none after I finished reworking the code. That doesn't mean it won't happen, since the errors I saw appeared to be caused by the UPS server dropping the connection. They use SSL which can slow things down enough for the server to time out. There is a test file in the distribution, so you can test this out without annoying your customers. Please post your results here; I'd like to know if the problem is fixed.

 

Regards

Jim

 

 

Hi Jim

 

I found 2 minor errors in the install

 

in includes/filenames.php you forgot to include:

 

define('FILENAME_PRODUCTS_SHIP_ESTIMATOR', 'products_ship_estimator.php');

 

in the files products_ship_estimator.php and ship_estimator.php,

the close window image is coded as button_close_window.jpg when the included button is button_close_window.gif

 

seems to work well but...

I'm still not getting quotes from UPSXML.

(at least it does not show an error, it just does not include the UPS quote)

 

will see if I can figure out the xml issue but I think it is a bit beyond me


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
Hi Jim

 

I found 2 minor errors in the install

 

in includes/filenames.php you forgot to include:

 

define('FILENAME_PRODUCTS_SHIP_ESTIMATOR', 'products_ship_estimator.php');

 

in the files products_ship_estimator.php and ship_estimator.php,

the close window image is coded as button_close_window.jpg when the included button is button_close_window.gif

 

seems to work well but...

I'm still not getting quotes from UPSXML.

(at least it does not show an error, it just does not include the UPS quote)

 

will see if I can figure out the xml issue but I think it is a bit beyond me

 

 

2 more little glitches..

in the files catalog/products_ship_estimator.php and catalog/ship_estimator.php,

 

" IMAGE_BUTTON_CLOSE " needs to be changed to " TEXT_CLOSE_WINDOW " to match the language file definitions


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
2 more little glitches..

in the files catalog/products_ship_estimator.php and catalog/ship_estimator.php,

 

" IMAGE_BUTTON_CLOSE " needs to be changed to " TEXT_CLOSE_WINDOW " to match the language file definitions

 

 

hmmmm

 

still no quotes from UPS XML

 

and since I have some products that only ship by UPS, the estimator will return a box with the product in it, but without a quote.

Perhaps a message saying "no quote is available at this time" if the estimator does not get a valid quote?


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
Hi Jim

 

I found 2 minor errors in the install

 

in includes/filenames.php you forgot to include:

 

define('FILENAME_PRODUCTS_SHIP_ESTIMATOR', 'products_ship_estimator.php');

 

in the files products_ship_estimator.php and ship_estimator.php,

the close window image is coded as button_close_window.jpg when the included button is button_close_window.gif

 

seems to work well but...

I'm still not getting quotes from UPSXML.

(at least it does not show an error, it just does not include the UPS quote)

 

will see if I can figure out the xml issue but I think it is a bit beyond me

The define in includes/filenames.php is in the included file, but apparently I forgot it in the instructions. The button image is a bug I thought I'd fixed, but obviously didn't. Thanks for finding those errors; I'll have to put up a bug fix release.

 

I still don't understand why UPSXML is not working for you. Since I can't duplicate the problem, I'm likely not going to be able to figure it out without help. Perhaps if you turn on logging you can get some more data on this.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
The define in includes/filenames.php is in the included file, but apparently I forgot it in the instructions. The button image is a bug I thought I'd fixed, but obviously didn't. Thanks for finding those errors; I'll have to put up a bug fix release.

 

I still don't understand why UPSXML is not working for you. Since I can't duplicate the problem, I'm likely not going to be able to figure it out without help. Perhaps if you turn on logging you can get some more data on this.

 

Regards

Jim

 

 

now we are getting somewhere..

 

With logging turned on for the upsxml module, when I try the ship estimator, no log is written

when I got to checkout_shipping.php, the ups log is written and everything looks ok.

 

SO..

it appears that the ship estimator is not even connecting in any way to upsxml.php on my system

 

now, if we could only figure out why not!

 

 

can you send me a copy of the upsxml module that you have the ship estimator working with?

maybe then I can see what is differnet with my version and figure this thing out.

 

Thanks

Edited by cigarsforless

Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites

I'm completely unable to think of a reason why the module would not even write to the logfile. Perhaps we need some more logging in there.

 

I was going to say that my upsxml.php was stock, but a quick check indicates that it is not. I'll send over a copy as soon as I post this. If this one works, I'll do a comparison to find out what the difference is.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
Earlier versions were only for MVS. This one should work with any standard osCommerce installation. I have not tried it with every possible combination of mods, so there is no guarantee that it will always work, but it should. I'm using it right now on a heavily modified store that does not have MVS installed, and it works just fine.

 

You could run the following SQL to be certain:

INSERT INTO `configuration` VALUES (NULL, 'Enable Vendor Shipping', 'SELECT_VENDOR_SHIPPING', 'false', 'Enable Multi-Vendor shipping-(true/false)', 7, 6, '2004-09-07 13:19:40', '2004-05-04 14:43:03', NULL, 'tep_cfg_select_option(array(''true'', ''false''),');

That shouldn't be necessary, since MVS is off by default, but that would make it certain.

 

Regards

Jim

 

 

Hi Jim just installed this and works well. thank you.

 

can you tell me how i can make UK default and remove postcode/zipcode?

 

Thanks

Share this post


Link to post
Share on other sites
Hi Jim just installed this and works well. thank you.

 

can you tell me how i can make UK default and remove postcode/zipcode?

 

Thanks

The default country can be changed in catalog/includes/languages/english/ship_estimator.php and catalog/includes/languages/english/products_ship_estimator.php.

 

Removing the Postcode would be very difficult. That is embedded and checked in several places. Possibly the number could be replaced with a hidden fake code. I'll have to play with that idea a bit.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
The default country can be changed in catalog/includes/languages/english/ship_estimator.php and catalog/includes/languages/english/products_ship_estimator.php.

 

Removing the Postcode would be very difficult. That is embedded and checked in several places. Possibly the number could be replaced with a hidden fake code. I'll have to play with that idea a bit.

 

Regards

Jim

 

Hi i found how to change, the post code aint really a issue, i do have 1 shipping method missing.

 

I have RoyalMail 1st class upto 1kg,

RoyalMail 1st recorded upto 2Kg

Special Del upto 10 Kg and shows from 1 kg

Courier upto 10 kg and shows from 2KG <----this is not showing

Airmail for non UK but this is showing rate on every UK estimate. but works when a international county is selected and all others are not show.

 

But when UK is selected all shipping rates or modules are show except courier.

 

I pm u link so you can see what i mean. Normally in OScommer when something is exceeded/not met its not show.

 

Thanks

Share this post


Link to post
Share on other sites
<snip>

Courier upto 10 kg and shows from 2KG <----this is not showing

<snip>

This looks like the module is not seeing the weight properly. I have tested with a couple of weight-based modules and they all work, so I wonder if your module is getting the weight some non-standard way. Does it do this for both the shopping cart estimator and the products estimator?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
This looks like the module is not seeing the weight properly. I have tested with a couple of weight-based modules and they all work, so I wonder if your module is getting the weight some non-standard way. Does it do this for both the shopping cart estimator and the products estimator?

 

Regards

Jim

 

How do i check product estimator, i got the file in/catalog/ but i never did the In catalog/includes/boxes/shopping_cart.php code as i didnt want it there.

 

My modules for shipping work fine for oscommerce and google checkout.

 

Thanks.

 

I dont think product estimator was defined.

Edited by none_uk

Share this post


Link to post
Share on other sites

Hi Jim you forgot to define products_ship_estimtor.

 

IN /LAG/ENGLIS.PHP

 

// Ship Estimator

define('IMAGE_BUTTON_SHIP_ESTIMATOR', 'Get a Shipping Estimate');

define('IMAGE_BUTTON_PRODUCTS_SHIP_ESTIMATOR', 'Get a Shipping Estimate');

// End ship estimator

 

 

IN FILENAMES

 

// Begin pop-up ship estimator

define('FILENAME_SHIP_ESTIMATOR', 'ship_estimator.php');

define('FILENAME_PRODUCTS_SHIP_ESTIMATOR', 'products_ship_estimator.php');

// End pop-up ship estimator

Edited by none_uk

Share this post


Link to post
Share on other sites
How do i check product estimator, i got the file in/catalog/ but i never did the In catalog/includes/boxes/shopping_cart.php code as i didnt want it there.

 

My modules for shipping work fine for oscommerce and google checkout.

 

Thanks.

 

I dont think product estimator was defined.

You can use the catalog/test.php script to test both shipping estimators.

 

The shipping estimator is derived from checkout_shipping.php, so it should work the same if the customer is logged in. If the customer is not logged in, we have to supply all of the information normally supplied by the cart class etc. There is a lot of data that needs to be replaced in order for thsi to work. It's possible that I missed something.

 

This is working fine with two different UPS modules (which are weight based) and was tested with another weight-based module. If your module is not getting the weight properly, it could be looking for some other variable that I didn't code in. I don't know this; it's only a guess. There could be something else wrong.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
You can use the catalog/test.php script to test both shipping estimators.

 

The shipping estimator is derived from checkout_shipping.php, so it should work the same if the customer is logged in. If the customer is not logged in, we have to supply all of the information normally supplied by the cart class etc. There is a lot of data that needs to be replaced in order for thsi to work. It's possible that I missed something.

 

This is working fine with two different UPS modules (which are weight based) and was tested with another weight-based module. If your module is not getting the weight properly, it could be looking for some other variable that I didn't code in. I don't know this; it's only a guess. There could be something else wrong.

 

Regards

Jim

 

Thanks, i will remove this for now as it will confuse my customers as it seems to be having issues with my modules. I'll keep it all defined in the hope that there will be an update and i'll get it it working :)

 

Thanks again

Share this post


Link to post
Share on other sites
I'm completely unable to think of a reason why the module would not even write to the logfile. Perhaps we need some more logging in there.

 

I was going to say that my upsxml.php was stock, but a quick check indicates that it is not. I'll send over a copy as soon as I post this. If this one works, I'll do a comparison to find out what the difference is.

 

Regards

Jim

 

 

Hi Jim,

 

After comparing the 2 files, I find that I have this block of code in there to calculate the handling from both the vendor info and the module itself.

 

// START doing things differently


if (isset($this->servicesTimeintransit[$type])) {
$eta_array = explode("-", $this->servicesTimeintransit[$type]["date"]);
$months = array (" ", "Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec");
$eta_arrival_date = $months[(int)$eta_array[1]]." ".$eta_array[2].", ".$eta_array[0];
$_type .= ", Estimated Delivery Date: ".$eta_arrival_date;
}
//END of doing things differently:
//MVS Start
$vendors_data_query = tep_db_query("select handling_charge,
handling_per_box,
vendor_country,
vendors_zipcode
from " . TABLE_VENDORS . "
where vendors_id = '" . (int)$vendors_id . "'"
);
$vendors_data = tep_db_fetch_array($vendors_data_query);
$country_name = tep_get_countries($vendors_data['vendor_country'], true);
//MVS Start
$handling_charge = $vendors_data['handling_charge'];
$handling_per_box = $vendors_data['handling_per_box'];
if ($handling_charge > $handling_per_box*$shipping_num_boxes) {
$handling = $handling_charge;
} else {
$handling = $handling_per_box*$shipping_num_boxes;
}
//MVS End
$handling_fee = constant('MODULE_SHIPPING_UPSXML_RATES_HANDLING_' . $vendors_id);
$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($handling_fee + $cost + $handling));

 

and in the file you sent me is

 

				// START doing things differently
			/*

							 if (isset($this->servicesTimeintransit[$type])) {
							 $eta_array = explode("-", $this->servicesTimeintransit[$type]["date"]);
							 $months = array (" ", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
							 $eta_arrival_date = $months[(int)$eta_array[1]]." ".$eta_array[2].", ".$eta_array[0];
							$_type .= ", <acronym title='Estimated Delivery Date'>EDD</acronym>: ".$eta_arrival_date;
							}
 END of doing things differently:				*/

				$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->handling_fee + $cost));

 

I tried just using the UPSXML module you sent me (I uninstalled the old one and reinstalled the new one) and I am still not getting USPSXML quotes

 

Drat it all to heck!


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to BS 2.3.4.1 Frozen)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
<snip>

I tried just using the UPSXML module you sent me (I uninstalled the old one and reinstalled the new one) and I am still not getting USPSXML quotes

 

Drat it all to heck!

I have no idea. Obviously not the module, since mine doesn't work either. Something in your setup perhaps. I don't even know where to start looking for the problem. Sorry.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello

 

I am having a problem with MVS Shipping when the customer clicks the estimate_shipping button at the shopping cart. I did have this contribution working fine until I setup my USPS module to the live/production server. Now when clicking to estimate shipping the popup pops up but takes a while to load and shoots out error message:

 

The page isn't redirecting properly

 

Any help would be appreciated

Share this post


Link to post
Share on other sites
Hello

 

I am having a problem with MVS Shipping when the customer clicks the estimate_shipping button at the shopping cart. I did have this contribution working fine until I setup my USPS module to the live/production server. Now when clicking to estimate shipping the popup pops up but takes a while to load and shoots out error message:

 

The page isn't redirecting properly

 

Any help would be appreciated

The only thing I can think of is the USPS server is being too slow. Timeouts on that end can result in odd error messages. Do you get a quote going through the checkout process?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hey Jim,

 

Thanks for your reply. Yes USPS still gives quotes in the checkout process. But every time I estimate shipping it's always the same error. Any other ideas?

Share this post


Link to post
Share on other sites
Hey Jim,

 

Thanks for your reply. Yes USPS still gives quotes in the checkout process. But every time I estimate shipping it's always the same error. Any other ideas?

Sorry, I still have no idea. That doesn't sound like a PHP error, or at least not one I've ever seen. You should be getting a line number, even if it's wrong. Could be a browser message -- I've seen Firefox do this. Try a different browser?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I now have a thory of what could be happening here. The script could be going into an endless redirect loop. I don't see how it could, and I don't know why it ould do this with some modules and not others, and on some sites and not mine. It's just the only explanation I could come up with.

 

So, here's a copy of ship_estimator.php with all of the redirects removed and the logic adjusted to work without them. Please try this out if you have been seeing the estimator hang or give redirect errors. This is beta code, so please don't put this on a live site. I've tested it on my test box, but the previous version worked fine on it, so you know how much good that does.

 

Needless to say, please post here if this works. Or if it sets fire to your server. I'll believe just about anything at this point.

 

<?php
/*
 $Id: ship_estimator.php,v 2.1beta 2008/02/23 jck Exp $
 $Loc: catalog/

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

 Copyright © 2008 osCommerce

 Released under the GNU General Public License
*/

 $debug = 'no';
 require_once ('includes/application_top.php');
 require_once ('includes/classes/http_client.php');
 require_once (DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHIP_ESTIMATOR);

// Get the action value and scrub it
$action = '';
if (isset ($_GET['action']) ) {
  $action = $_GET['action'];
}
/*  switch (true) {
case isset ($_GET['action']):
  $action = $_GET['action'];
break;
case isset ($_POST['action']):
  $action = $_POST['action'];
break;
default:
  $action = '';
 }
*/
 $action = preg_replace ("(\r\n|\n|\r)", '', $action);  // Remove CR &/ LF
 $action = preg_replace ("/[^a-z_]/i", '', $action); // Strip anything we don't want
//print 'Action: ' . $action . "<br>\n";

// If the customer is logged in OR has previously entered the ship-to data,
//   AND the action has not already been set to process the quote, 
//   set the action and get the quote
 if ($action == '' && (tep_session_is_registered ('customer_id') || (tep_session_is_registered ('shippostcode') && tep_session_is_registered ('shipcountry') ) ) ) {
$action = 'process';
//	tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=process', 'SSL'));
 }
//print 'Action: ' . $action . "<br>\n";

////
// Process the action. Actions are:
//   process: Get a quote
//   ship_error: The customer is not logged in and has not entered the required data
//   reset: Get a new destination to quote
//   end: Clean up and close the window
////
 switch ($action) {
case 'process':
//	  if (!tep_session_is_registered ('customer_id') && (!tep_session_is_registered ('shippostcode') || !tep_session_is_registered ('shipcountry') ) ) {
//		$error_code = '';
//		if (!tep_not_null ($_POST['shippostcode']) || !tep_not_null ($_POST['shipcountry']) ) {
	  if (!tep_session_is_registered ('customer_id') && !tep_not_null ($_POST['shippostcode']) && !tep_session_is_registered ('shippostcode') ) {
		$messageStack->add ('ship_estimator', ERROR_SHIPPOSTCODE);
		$action = '';
		break;
	  }
//		  if (!tep_not_null ($_POST['shippostcode'])) $error_code .= '&error_shippostcode=1';
//		  if (!tep_not_null ($_POST['shipcountry'])) $error_code .= '&error_shipcountry=1';
//		  tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=ship_error' . $error_shippostcode . $error_shipcountry, 'NONSSL'));
//		  exit; // Don't do anything else

//		} //if (!tep_not_null
//	  } //if (!tep_session_is_registered

//MVS
  if (SELECT_VENDOR_SHIPPING == 'true') {
	include_once (DIR_WS_CLASSES . 'vendor_shipping.php');
	$shipping_modules = new shipping;

	$vendor_shipping = $cart->vendor_shipping();
	$count_vendors_in_cart = count ($vendor_shipping);

  } else {
//MVS End
	include_once (DIR_WS_CLASSES . 'shipping.php');
	$shipping_modules = new shipping;
	$total_weight = $cart->show_weight();
	$cost = $cart->show_total();
	$total_count = $cart->count_contents();
  }

//  set all the $order variables if the customer is not logged in
  $cart_country_id = 0;
  if (!tep_session_is_registered ('customer_id')) {
	if (!tep_session_is_registered ('shippostcode') ) {
	  $shippostcode = $_POST['shippostcode'];
	  tep_session_register ('shippostcode');
	} else {
	  $shippostcode = $_SESSION['shippostcode'];
	}

	if (!tep_session_is_registered ('shipcountry') ) {
	  $shipcountry = $_POST['shipcountry'];
	  tep_session_register ('shipcountry');
	} else {
	  $shipcountry = $_SESSION['shipcountry'];
	}

	$country_info = tep_get_countries ($shipcountry, true);

	$order->delivery = array('postcode' => $shippostcode,
							 'country' => array('id' => $shipcountry, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']),
							 'country_id' => $_POST['country_id'],
							 'format_id' => tep_get_address_format_id($_POST['country_id']));
	$order->customer = array('postcode' => $shippostcode,
							 'country' => array('id' => $shipcountry, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']),
							 'country_id' => $shipcountry,
							 'format_id' => tep_get_address_format_id($cart_country_id));
	$order->billing = array('postcode' => $shippostcode,
							'country' => array('id' => $shipcountry, 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']),
							'country_id' => $shipcountry,
							'format_id' => tep_get_address_format_id($cart_country_id));
	$order->info = array('total' => $cart->show_total(), // TAX ????
						 'currency' => $currency,
						 'shipping_cost' => $shipping['cost'],
						 'shipping_method' => $shipping['title'],
						 'shipping_tax' => $shipping['shipping_tax_total'],
						 'subtotal' => 0,
						 'tax' => $order->products[$i]['tax'] + $shipping['shipping_tax_total'],
						 'tax_groups' => array(),
						 'country_id' => $shipcountry,
						 'currency_value'=> $currencies->currencies[$currency]['value']);

	$index = 0;
	$products = $cart->get_products();
	for ($i=0, $n=sizeof($products); $i<$n; $i++) {
	  //MVS - added 'vendors_id' => ..., 'vendors_name' => ...
	  $order->products[$index] = array('qty' => $products[$i]['quantity'],
									   'name' => $products[$i]['name'],
									   'model' => $products[$i]['model'],
									   'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
									   'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
									   'price' => $products[$i]['price'],
									   'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
									   'weight' => $products[$i]['weight'],
									   'id' => $products[$i]['id'],
									   'vendors_id' => $products[$i]['vendors_id'],
									   'vendors_name' => $products[$i]['vendors_name']
									  );
	  if ($products[$i]['attributes']) {
		$subindex = 0;
		reset($products[$i]['attributes']);
		while (list($option, $value) = each ($products[$i]['attributes'])) {
		  $attributes_query = tep_db_query ("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
		  $attributes = tep_db_fetch_array ($attributes_query);
		  $order->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
																	'value' => $attributes['products_options_values_name'],
																	'option_id' => $option,
																	'value_id' => $value,
																	'prefix' => $attributes['price_prefix'],
																	'price' => $attributes['options_values_price']);
		  $subindex++;
		}
	  }
	  $shown_price = tep_add_tax ($order->products[$index]['final_price'], $order->products[$index]['tax']) * $order->products[$index]['qty'];
	  $order->info['subtotal'] += $shown_price;
	  $products_tax = $order->products[$index]['tax'];
	  $products_tax_description = $order->products[$index]['tax_description'];
	  if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$order->info['tax'] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
		if (isset($order->info['tax_groups']["$products_tax_description"])) {
		  $order->info['tax_groups']["$products_tax_description"] += $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
		} else {
		  $order->info['tax_groups']["$products_tax_description"] = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
		}
	  } else {
		$order->info['tax'] += ($products_tax / 100) * $shown_price;
		if (isset($order->info['tax_groups']["$products_tax_description"])) {
		  $order->info['tax_groups']["$products_tax_description"] += ($products_tax / 100) * $shown_price;
		} else {
		  $order->info['tax_groups']["$products_tax_description"] = ($products_tax / 100) * $shown_price + $shipping['shipping_tax_total'];
		}
	  }
	  $index++;
	}
	if (DISPLAY_PRICE_WITH_TAX == 'true') {
	  $order->info['total'] = $order->info['subtotal'] + $order->info['shipping_cost'];
	} else {
	  $order->info['total'] = $order->info['subtotal'] + $order->info['tax'] + $order->info['shipping_cost'];
	}

  } else { //customer is logged in
	if (!tep_session_is_registered ('sendto')) {
	  tep_session_register ('sendto');
	  $sendto = $customer_default_address_id;
	} else {
	  // verify the selected shipping address
	  $check_address_query = tep_db_query ("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
	  $check_address = tep_db_fetch_array ($check_address_query);
	  if ($check_address['total'] != '1') {
		$sendto = $customer_default_address_id;
		if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
	  }
	}
  }

  // Get the ship-to address to display
  if (tep_session_is_registered('customer_id')) {
	require_once (DIR_WS_CLASSES . 'order.php');
	$order = new order;
	$display_address = tep_address_format ($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); 
  } else {
	$display_address = $shippostcode . '<br>' . tep_get_country_name ($shipcountry);
  } 

  //MVS
  if (SELECT_VENDOR_SHIPPING == 'true') {
	$quotes_array = array(); //Output array to collect the data we want to display
	foreach ($vendor_shipping as $vendors_id => $vendor_data) {
	  $total_weight = $vendor_data['weight'];
	  $shipping_weight = $total_weight;
	  $cost = $vendor_data['cost'];
	  $ship_tax = $shipping_tax;   //for taxes
	  $total_count = $vendor_data['qty'];

	  //Get the product names to display
	  $products_ids = $vendor_data['products_id'];
	  foreach ($products_ids as $product_id) {
		$products_query = tep_db_query("select products_name
										from " . TABLE_PRODUCTS_DESCRIPTION . "
										where products_id = '" . (int)$product_id . "'
										  and language_id = '" . (int)$languages_id . "'"
									  );
		$products = tep_db_fetch_array($products_query);
		$quotes_array[$vendors_id]['products'][] = $products['products_name'];
	  }//foreach ($products_ids

	  // Check if qualifies for free shipping
	  if ( defined ('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
		$pass = false;

		switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
		  case 'national':
			if ($order->delivery['country_id'] == STORE_COUNTRY) {
			  $pass = true;
			}
			break;
		  case 'international':
			if ($order->delivery['country_id'] != STORE_COUNTRY) {
			  $pass = true;
			}
			break;
		  case 'both':
			$pass = true;
			break;
		  }

		  $free_shipping = false;
		  if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
			$free_shipping = true;

			include_once (DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
		  }
		} else {
		  $free_shipping = false;
		}

		//Get the quotes
		$quotes = $shipping_modules->quote ('', '', $vendors_id);

		$multiple_quotes = false;
		if (count ($quotes) > 1) {
		  $multiple_quotes = true;
		}

		// If no free shipping, put the quotes information that we need into an array
		if ($free_shipping == false) {
		  for ($quote_no=0, $n=count($quotes); $quote_no<$n; $quote_no++) {
			$icon = '';
			if (isset($quotes[$quote_no]['icon']) && tep_not_null ($quotes[$quote_no]['icon']) ) { 
			  $icon = $quotes[$quote_no]['icon'];
			}
			$quotes_array[$vendors_id]['quotes'][$quote_no]['module'] = $quotes[$quote_no]['module'];
			$quotes_array[$vendors_id]['quotes'][$quote_no]['icon'] = $icon;

			if (isset($quotes[$quote_no]['error'])) {
			  $quotes_array[$vendors_id]['quotes'][$quote_no]['error'] = $quotes[$quote_no]['error'];
			} else {
			  for ($j=0, $n2=sizeof($quotes[$quote_no]['methods']); $j<$n2; $j++) {
				$shipping_actual_tax = $quotes[$quote_no]['tax'] / 100;
				$shipping_tax = $shipping_actual_tax * $quotes[$quote_no]['methods'][$j]['cost'];
				$quotes_array[$vendors_id]['quotes'][$quote_no]['methods'][$j]['title'] = $quotes[$quote_no]['methods'][$j]['title'];
				$quotes_array[$vendors_id]['quotes'][$quote_no]['methods'][$j]['cost'] = $currencies->format($quotes[$quote_no]['methods'][$j]['cost']);
			  } //for
			} //if (isset($quotes ... else
		  } //for ($quote_no=0,
		} //if ($free_shipping
	  } //foreach ($vendor_shipping

	} else { //if (SELECT_VENDOR_SHIPPING
	// End MVS

	//Get the quotes array
	$quotes = $shipping_modules->quote();

	// Check if qualifies for free shipping
	if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
	  $pass = false;

	  switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
		case 'national':
		  if ($order->delivery['country_id'] == STORE_COUNTRY) {
			$pass = true;
		  }
		  break;
		case 'international':
		  if ($order->delivery['country_id'] != STORE_COUNTRY) {
			$pass = true;
		  }
		  break;
		case 'both':
		  $pass = true;
		  break;
	  } //switch

	  $free_shipping = false;
	  if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
		$free_shipping = true;

		include_once (DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
	  }

	} else {
	  $free_shipping = false;
	}

	// If no free shipping, put the quotes information that we need into an array
	if ($free_shipping == false) {
	  for ($quote_no=0, $n=sizeof($quotes); $quote_no<$n; $quote_no++) {
		$icon = '';
		if (isset($quotes[$quote_no]['icon']) && tep_not_null ($quotes[$quote_no]['icon']) ) { 
		  $icon = $quotes[$quote_no]['icon'];
		}
		$quotes_array[$quote_no]['module'] = $quotes[$quote_no]['module'];
		$quotes_array[$quote_no]['icon'] = $icon;

		if (isset($quotes[$quote_no]['error'])) {
		  $quotes_array[$quote_no]['error'] = $quotes[$quote_no]['error'];
		} else {
		  for ($module_no=0, $n2=sizeof($quotes[$quote_no]['methods']); $module_no<$n2; $module_no++) {
			$shipping_actual_tax = $quotes[$quote_no]['tax'] / 100;
			$shipping_tax = $shipping_actual_tax * $quotes[$quote_no]['methods'][$module_no]['cost'];
			$quotes_array[$quote_no]['methods'][$module_no]['title'] = $quotes[$quote_no]['methods'][$module_no]['title'];
			$quotes_array[$quote_no]['methods'][$module_no]['cost'] = $currencies->format($quotes[$quote_no]['methods'][$module_no]['cost']);
		  } //for
		} //if (isset($quotes ... else
	  } // for ($quote_no=0,
	} //if ($free_shipping

//MVS
  } //if (SELECT_VENDOR_SHIPPING ... else
  break;

//	case 'ship_error': //Customer did not provide needed data, so set error msg
//	  if ($error_code != '') {
//		$messageStack->add ('ship_estimator', ERROR_SHIPPOSTCODE);

//	 }
/*	  if (tep_not_null ($_GET['error_shippostcode']) ) {
	$messageStack->add ('ship_estimator', ERROR_SHIPPOSTCODE);
  }
  if (tep_not_null ($_GET['error_shipcountry']) ) {  //Should never happen with country dropdown
	$messageStack->add ('ship_estimator', ERROR_SHIPCOUNTRY);
  }
*/
//	  break;

case 'reset': //Remove data so that customer may select a different ship-to
  tep_session_unregister ('shippostcode');
  tep_session_unregister ('shipcountry');
  tep_session_unregister ('sendto');
  tep_session_unregister ('shipping');
  tep_session_unregister ('est_shipping_ot');
  tep_session_unregister ('unregister');
  tep_session_close();
  $action = '';
//	  tep_redirect (tep_href_link (FILENAME_SHIP_ESTIMATOR, '', 'NONSSL') );
  break;

case 'end': //Clean up and close the window
  tep_session_unregister ('sendto');
  tep_session_unregister ('shipping');
  tep_session_unregister ('est_shipping_ot');
  tep_session_unregister ('unregister');
  tep_session_close();
?>
  <head>
  <script language="javascript"> <!-- 
  function CloseMe() {   
	self.close(); 
  } 
  // --> </script> 
  </head>  
  <body onload="CloseMe()"> 
  </body> 
<?php
  exit; // Don't do anything else
  break;

case '':
default:
  break;

 } //switch

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
 <title><?php echo TITLE; ?></title>
 <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
 <link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="3">
<!-- heading //-->
 <tr>
<td><table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td align="center" class="pageHeading"><b><?php echo HEADING_TITLE; ?></b></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator ('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
</table></td>
 </tr>
<!-- heading_eof //-->

<?php
// Show error messages if any
 if ($messageStack->size ('ship_estimator') > 0) {
?>
<!-- error_messages //-->
 <tr>
<td><table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><?php echo $messageStack->output ('ship_estimator'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator ('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
</table></td>
 </tr>
<!-- error_messages_eof //-->
<?php
 } //if ($messageStack->size
?>

<?php
// Customer is not signed in and has not selected destination, 
//   or has clicked reset, so show the form to enter ship-to
 if ( ($action == '' && $cart->count_contents() > 0 && !tep_session_is_registered('customer_id') ) || $action == 'reset' || $action == 'ship_error') {
?>
<!-- ship-to_form //-->
 <tr>
<td>
<?php echo tep_draw_form ('est_shipping_id', tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=process', 'SSL'), 'post')// . tep_draw_hidden_field('action', 'process'); ?>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  <tr class="infoBoxContents">
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td colspan=2 class="main"><b><?php echo TITLE_SHIPPING_ADDRESS; ?></b></td>
	  </tr>
	  <tr>
		<td class="infoBoxContents"><?php echo ENTRY_POST_CODE; ?></td>
		<td class="infoBoxContents"><?php echo tep_draw_input_field ('shippostcode') . ' ' . (tep_not_null(ENTRY_POST_CODE) ? '<span class="inputRequirement">* Required</span>': ''); ?></td>
	  </tr>
	  <tr>
		<td class="infoBoxContents"><?php echo ENTRY_COUNTRY; ?></td>
		<td class="infoBoxContents"><?php echo tep_get_country_list ('shipcountry',DEFAULT_COUNTRY) . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">* Required</span>': ''); ?></td>
	  </tr>
		<td class="infoBoxContents"></td>
		<td class="infoBoxContents"><?php echo tep_image_submit ('button_process_quote.gif', IMAGE_BUTTON_PROCESS_QUOTE); ?></td>
	  </tr>
	</table></td>
  </tr>
</table></form></td>
 </tr>
<!-- ship-to_form_eof //-->

<?php
// end of the shipping address form and begin the ship estimate
 } elseif ($action == 'process') {
?>
<!-- ship_quote_heading //-->
 <tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  <tr class="infoBoxContents">
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo HEADING_SHIPPING_ADDRESS; ?></b></td>
	  </tr>
	  <tr>
		<td class="main"><?php echo $display_address; ?></td>
	  </tr>
	</table></td>
  </tr>
</table></td>
 </tr>
<!-- ship_quote_heading_eof //-->

<?php
// Start MVS
if (SELECT_VENDOR_SHIPPING == 'true') {
?>

<?php
//Display a notice if we are shipping by multiple methods
if ($count_vendors_in_cart > 1) {
?>
<!-- multi_ship_notice //-->
 <tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  <tr class="infoBoxContents">
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
		<td class="main"><?php echo TEXT_MULTIPLE_SHIPPING_METHODS; ?></td>
		<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
	   </tr>
	 </table></td>
  </tr>
</table></td>
 </tr>
 <tr>
<td><?php echo tep_draw_separator ('pixel_trans.gif', '100%', '10'); ?></td>
 </tr>
<!-- multi_ship_notice_eof //-->
<?php
} //if (count ($vendor_shipping)
?>
<!-- quote //-->
 <tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  <tr class="infoBoxContents">
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<!-- products_quote //-->
<?php
foreach ($quotes_array as $vendors_id => $vendor_data) {
?>
	  <tr>
		<td><table border="1" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
		  <tr class="infoBoxContents">
			<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" width="100%" valign="top"><b><?php echo TEXT_PRODUCTS; ?></b></td>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
if (is_array ($vendor_data['products']) ) {
  foreach ($vendor_data['products'] as $product_name) {
?>
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" width="100%" valign="top"><?php echo $product_name; ?></td>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
  }//foreach
}//if
?>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator ('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<!-- products_quote_eof //-->

<!-- shipping_quote //-->
	  <tr>
		<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
		  <tr class="infoBoxContents">
			<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
  if ($multiple_quotes == true) {
?>
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" width="50%" valign="top"><?php echo TEXT_AVAILABLE_SHIPPING_METHOD; ?></td>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
  } //if ($multiple_quotes
?>

<?php
  if ($free_shipping == true) {
?>
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td colspan="2" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
				  <tr>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b> <?php echo $quotes[$quote_no]['icon']; ?></td>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
				  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
				</table></td>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
  } else {
	if (is_array ($vendor_data['quotes']) ) {
	  foreach ($vendor_data['quotes'] as $quote_data) {
?>
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
				  <tr>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" colspan="3"><b><?php echo $quote_data['module']; ?></b> <?php echo $quote_data['icon'];  ?></td>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
<?php
	if (isset($quote_data[$quote_no]['error'])) {
?>
				  <tr>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" colspan="3"><?php echo $quote_data['error']; ?></td>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
<?php
	} else {
	  for ($module_no=0, $n2=sizeof($quote_data['methods']); $module_no<$n2; $module_no++) {
?>
				  <tr>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" width="75%"><?php echo $quote_data['methods'][$module_no]['title']; ?></td>
					<td class="main" align="right"><?php echo $quote_data['methods'][$module_no]['cost']; ?></td>
					<td class="main" align="right"></td>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
<?php
	  } //for ($module_no=0
	} // if else
?>
				</table></td>
				<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
	} //foreach
  } // if
} //if ($free_shipping ... else
?>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator ('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
} //foreach ($quotes_array
 } else { //if (SELECT_VENDOR_SHIPPING
// End MVS
?>
<!-- quote //-->
	  <tr>
		<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
		  <tr class="infoBoxContents">
			<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<!-- products_quote //-->
<?php
  if ($multiple_quotes == true) {
?>
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td class="main" width="50%" valign="top"><?php echo TEXT_AVAILABLE_SHIPPING_METHOD; ?></td>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
  } //if ($multiple_quotes
?>

<?php
if ($free_shipping == true) {
?>
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td colspan="2" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
				  <tr>
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b> <?php echo $quotes[$quote_no]['icon']; ?></td>
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
				  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
				</table></td>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
} else {
?>
<?php
  foreach ($quotes_array as $quote_data) {
?>
			  <tr>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
				  <tr>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" colspan="3"><b><?php echo $quote_data['module']; ?></b> <?php if (isset($quotes[$quote_no]['icon']) && tep_not_null($quotes[$quote_no]['icon'])) { echo $quotes[$quote_no]['icon']; } ?></td>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
<?php
	if (isset($quote_data['error'])) {
?>
				  <tr>
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" colspan="3"><?php echo $quote_data['error']; ?></td>
					<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
<?php
	} else {
	  foreach ($quote_data['methods'] as $method_data) {
?>
				  <tr>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
					<td class="main" width="75%"><?php echo $method_data['title']; ?></td>
					<td class="main"><?php echo $method_data['cost']; ?></td>
					<td width="10"><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
				  </tr>
<?php
	  } //foreach ($quote_data['methods']
	} //if (isset($quote_data['error'] ... else
?>
				</table></td>
				<td><?php echo tep_draw_separator ('pixel_trans.gif', '10', '1'); ?></td>
			  </tr>
<?php
  } //foreach ($quotes_array
} //if ($free_shipping ... else
?>
				</table></td>
			  </tr>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator ('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
//MVS
} //if (SELECT_VENDOR_SHIPPING ... else
// end of the shipping section
?>
<!-- shipping_quote_eof //-->
<?php
 }
 // Stock Check
 $any_out_of_stock = false;
 if (STOCK_CHECK == 'true') {
for ($product_no=0, $n=sizeof($order->products); $product_no<$n; $product_no++) {
  if (tep_check_stock($order->products[$product_no]['id'], $order->products[$product_no]['qty'])) {
	$any_out_of_stock = true;
  } //if
} //for ($product_no=0,
// Out of Stock
if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {
?>
<!-- out_of_stock //-->
	  <tr>
		<td colspan="2" align="center" class="main"><b><?php echo TEXT_OUT_OF_STOCK; ?></b></td>
	  </tr>
<!-- out_of_stock_eof //-->
<?php
} //if ( (STOCK_ALLOW_CHECKOUT
 } //if (STOCK_CHECK
?>
	</table></td>
  </tr>
</table></td>
 </tr>
<!-- quote_eof //-->
<?php
 if (!tep_session_is_registered ('customer_id') && $action == 'process') {
?>
<!-- reset //-->
 <tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  <tr class="infoBoxContents">
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td class="main" width="100%" align="center"><?php echo TEXT_RESET_EXPLAIN; ?> </td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator ('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main" width="100%" align="center"><?php echo '<a href="' . tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=reset', 'SSL') . '">' . tep_image_button('button_reset.gif', IMAGE_BUTTON_RESET_FORM) . '</a>'; ?> </td>
  </tr>
	</table></td>
  </tr>
</table></td>
 </tr>
<!-- reset_eof //-->
<?php
 } 
?>

<?php
// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
?>
<!-- cart_empty //-->
 <tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
  <tr class="infoBoxContents">
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td colspan="2" align="center" class="main"><b><?php echo TEXT_CART_EMPTY; ?></b></td>
	  </tr>
	</table></td>
  </tr>
</table></td>
 </tr>
<!-- cart_empty_eof //-->
<?php 
 } //if ($cart->count_contents() 
?>

<!-- close_window //-->
 <tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 </tr>
 <tr>
<td>
  <p class="smallText" align="center">
  <?php echo '<a href="' . tep_href_link (FILENAME_SHIP_ESTIMATOR, 'action=end', 'NONSSL') . '">' . tep_image_button('button_close_window.gif', IMAGE_BUTTON_CLOSE) . '</a>'; ?>
  </p>
</td>
 </tr>
<!-- close_window_eof //-->
</table>

<?php
 if ($debug == 'yes') {
//		echo '<font color="#FFFFFF">';
	echo '<br>the action is:  ' . $action;
	echo '<br>the $customer_id is:  ' . $customer_id;
	echo '<br>the shipping cost from the cart  ' . $order->info['shipping_cost'];
	echo '<br>the county array id from the cart  ' . $order->delivery['country']['id'];
	echo '<br>the delivery zipcode from the cart  ' . $order->delivery['postcode'];
	echo '<br>the shipping title from the cart  ' . $order->info['shipping_method'];
	echo '<br>the order->info tax:  ' . $order->info['tax'];
	echo '<br>the POSTED shipping:  ' . $_POST['shipping'];
	echo '<br>the shipping from $order->info[]:  ' . $order->info['shipping'];
	echo '<br>the subtotal:  ' . $order->info['subtotal'];
	echo '<br>the shipping tax:  ' . $shipping['shipping_tax_total'];
	echo '<br>the $shippostcode:  ' .  $shippostcode;
	echo '<br>the $shipcountry:  ' . $shipcountry;
//		echo '</font>';
	// require_once ('show_variables.php');
 } //IF DEBUG
?>

</body>
</html>
<?php require_once (DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Regards

Jim

 

Edit: Stupid broken codebox tags....

Edited by kymation

See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
I now have a thory of what could be happening here. The script could be going into an endless redirect loop. I don't see how it could, and I don't know why it ould do this with some modules and not others, and on some sites and not mine. It's just the only explanation I could come up with.

 

So, here's a copy of ship_estimator.php with all of the redirects removed and the logic adjusted to work without them. Please try this out if you have been seeing the estimator hang or give redirect errors. This is beta code, so please don't put this on a live site. I've tested it on my test box, but the previous version worked fine on it, so you know how much good that does.

 

Needless to say, please post here if this works. Or if it sets fire to your server. I'll believe just about anything at this point.

 

 

Regards

Jim

 

Edit: Stupid broken codebox tags....

 

I gave it a try, its still does not work for me properly but the close button does not work this new code.

 

 

the module i use are in here http://addons.oscommerce.com/info/4473 1st class, recorded 1st class, special del, airemail and city link. citylink does not show.

 

thanks

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

×