Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

Where can I get the list of products_id's in upsxml.php? I've tried outputting the values for $order and $cart and neither seem to carry id's in them. If I had a list of ID's i could easily do what I want..

catalog/includes/classes/shopping_cart.php:

 

function get_product_id_list()

 

(gives a comma separated list, beware that those id's have attributes included!)

Link to comment
Share on other sites

You don't happen to have uploaded the /shipping/upsxml.php file to the language directory have you?

 

JanZ - is the /shipping/upsxml.php file supposed to be uploaded to the language directory or not supposed to be?

 

I DID upload to my language directory (/language/english/modules/shipping) and I am receiving the same error:

Fatal error: Cannot redeclare class upsxml in /home/httpd/vhosts/bonsaibirds.com/httpdocs/shop/includes/modules/shipping/upsxml.php on line 0

 

 

Thanks in advance for any tips.

Kindly,

 

Andrea Fahy

Link to comment
Share on other sites

is the /shipping/upsxml.php file supposed to be uploaded to the language directory or not supposed to be?

 

I DID upload to my language directory (/language/english/modules/shipping) and I am receiving the same error:

Fatal error: Cannot redeclare class upsxml in /home/httpd/vhosts/bonsaibirds.com/httpdocs/shop/includes/modules/shipping/upsxml.php on line 0

The language file is in the package. As you found out you cannot upload the /shipping/upsxml.php twice because the shipping page loads both the shipping module and the corresponding language file. If they are the same, the class would be declared twice.

Link to comment
Share on other sites

The language file is in the package. As you found out you cannot upload the /shipping/upsxml.php twice because the shipping page loads both the shipping module and the corresponding language file. If they are the same, the class would be declared twice.

 

Fantastic JanZ - thank you yet again :)

Kindly,

 

Andrea Fahy

Link to comment
Share on other sites

  • 2 weeks later...

PROBLEM: UPS XML Rates not being sent to Google Checkout!

 

The module works fine in OSC checkout. I get the rate quotes, etc. However, when I use Google Checkout it lists the UPS shipping options properly but list a $0 charge for all of them! I already searched the forums and can't find anything on this issue. I already ran the Google Shipping Generator and modified the code as needed in the Google Checkout contribution. Any ideas ???

 

Thanks!

 

To see issue - Visit My Website

Link to comment
Share on other sites

First, thanks for the contribution.

 

I installed this contribution using the attached documentation. No problem. I went to admin and configured UPS XML as instructed. I also made sure that zip code is correct in My Store and Shipping and Packaging. However, during the check out process, the UPS options are not shown. Please help!!!

 

Thanks.

Link to comment
Share on other sites

I am installing the UPS XML Shipping Module on an new cart, vers. rc1. After installation, I recieved the following at the top of the product edit page in admin.

 

1146 - Table 'flt_rc1.table_products_split' doesn't exist

 

select count(*) as total from TABLE_PRODUCTS_SPLIT where products_id = '2'

 

Does anyone know how to correct this problem?

Link to comment
Share on other sites

I am installing the UPS XML Shipping Module on an new cart, vers. rc1. After installation, I recieved the following at the top of the product edit page in admin.

 

1146 - Table 'flt_rc1.table_products_split' doesn't exist

 

select count(*) as total from TABLE_PRODUCTS_SPLIT where products_id = '2'

 

Does anyone know how to correct this problem?

At the very least you didn't follow all the instructions in the file split_products_instruction.txt where it tells you to add a define for that table in the admin part:

 

admin/includes/database_tables.php

**ADD**

 define('TABLE_PRODUCTS_SPLIT', 'products_split');

Link to comment
Share on other sites

However, during the check out process, the UPS options are not shown.

I assume that by now you have found out that UPSXML was not enabled as a shipping method for the zone your customer [with which you test] lives in?

Link to comment
Share on other sites

At the very least you didn't follow all the instructions in the file split_products_instruction.txt where it tells you to add a define for that table in the admin part:

 

admin/includes/database_tables.php

**ADD**

 define('TABLE_PRODUCTS_SPLIT', 'products_split');

 

You are correct. At the time I made the post, I had not followed any of the split_products_instruction.txt or the dimensions.txt instructions since in the readme.txt, Step 6 said they were optional. I have gone through both now. At the bottom of the split_products_instruction.txt it states,

In catalog/includes/modules/shipping/upsxml.php (from version 1.2.7)

 

you will find around line 224:

 

if (method_exists($cart, 'get_products_for_packaging') ) {

$productsArray = $cart->get_products_for_packaging();

} else {

$productsArray = $cart->get_products();

}

 

Once you added the function get_products_for_packaging to the class shopping_cart, this function will be used to pick up the details for packaging and the price for insurance. If you have mods to the original get_products function (like SPPC) be aware that these are not in the function get_products_for_packaging !!

 

I am not understanding what it is telling me to do.

Is there something missing?

Link to comment
Share on other sites

In catalog/includes/modules/shipping/upsxml.php (from version 1.2.7)

 

you will find around line 224:

 

if (method_exists($cart, 'get_products_for_packaging') ) {

$productsArray = $cart->get_products_for_packaging();

} else {

$productsArray = $cart->get_products();

}

 

Once you added the function get_products_for_packaging to the class shopping_cart, this function will be used to pick up the details for packaging and the price for insurance. If you have mods to the original get_products function (like SPPC) be aware that these are not in the function get_products_for_packaging !!

 

I am not understanding what it is telling me to do.

Is there something missing?

No, what I'm trying to say there is for "split products" to work, you need to add a new function to the class shopping_cart.php (the function get_products_for_packaging). It won't give an error if you don't (because of the check on the existence of that function) but it won't work either. Just to make people aware that everything might seem to work fine because you don't get an error whereas in reality it is not working because you didn't add that function...

Link to comment
Share on other sites

No, what I'm trying to say there is for "split products" to work, you need to add a new function to the class shopping_cart.php (the function get_products_for_packaging). It won't give an error if you don't (because of the check on the existence of that function) but it won't work either. Just to make people aware that everything might seem to work fine because you don't get an error whereas in reality it is not working because you didn't add that function...

 

where do I find that function at and where do I put it?

Link to comment
Share on other sites

Is there any way to see what items the dimensional weight code decides to put in each box? I can see the size of each box by turning on the logging feature. But I can't see what items, it actually put in what box.

 

I think this would be great for debugging purposes.

 

Thanks,

 

Donna

Link to comment
Share on other sites

Is there any way to see what items the dimensional weight code decides to put in each box? I can see the size of each box by turning on the logging feature. But I can't see what items, it actually put in what box.

 

I think this would be great for debugging purposes.

It wouldn't be impossible to implement. I used this (starts around line 233 in upsxml.php) to debug that:

		if ($this->dimensions_support == '2') {
		// sort $productsArray according to ready-to-ship (first) and not-ready-to-ship (last)
		usort($productsArray, ready_to_shipCmp);
		// Use packing algoritm to return the number of boxes we'll ship
		$boxesToShip = $this->packProducts($productsArray);
// part I would uncomment to see what went in what, obviously not for a working shop...
				  /* echo '<pre>Boxes to ship:<br>';
					print_r($boxesToShip);
					exit; */
		// Quote for the number of boxes

Serializing the array $boxesToShip and storing it in a table with an id, time, customer_id and the serialized array in a text field would save the data in a working shop. But to make something presentable and searchable out of that.... that would take some serious time...

Link to comment
Share on other sites

Hello Everyone,

I have used UPS XML Rates & Services v 1.2.8.1. Everything seems to be fine except when I get the rate quotes back they are as shown below.

This is currently the only shipping method available to use on this order.

UPS (1 pkg x 5 lbs total) UPS

UPS Ground $3.00

UPS 3 Day Select $12.00

UPS 2nd Day Air $2.00

UPS Next Day Air Early A.M. $14.00

 

Now when I looked at the UPS Response in the log file, I have this as sample..

- <RatedShipment>

- <Service>

<Code>03</Code>

</Service>

........

- <TransportationCharges>

<CurrencyCode>USD</CurrencyCode>

<MonetaryValue>6.61</MonetaryValue>

</TransportationCharges>

................

- <RatedShipment>

- <Service>

<Code>12</Code>

</Service>

................

- <TransportationCharges>

<CurrencyCode>USD</CurrencyCode>

<MonetaryValue>10.15</MonetaryValue> ..................

 

As you can see, for each of these code, monetary value is

 

3 - 6.61

2 - 13.34

13 - 23.14

14 - 58.71

 

 

What it looks to me that somehow on my page it is using Service / code node value as price instead of <MonetaryValue>

I have not made any changes to the original version.

 

Can someone please help?

 

Thanks

SHAH

Link to comment
Share on other sites

What it looks to me that somehow on my page it is using Service / code node value as price instead of <MonetaryValue>

I have not made any changes to the original version.

Let me guess: you ticked the option for "discounted rates" for whatever reason. However, you don't get discounted rates (perhaps you do from UPS, but the UPS server doesn't know that [yet]) and therefore you get these numbers.

Link to comment
Share on other sites

Let me guess: you ticked the option for "discounted rates" for whatever reason. However, you don't get discounted rates (perhaps you do from UPS, but the UPS server doesn't know that [yet]) and therefore you get these numbers.

 

Thank You JanZ.. You were right. Though I don't remember why or when I'd change that setting. But it works. Can I ask one more question? It's about the weight calculation and getting accurate charges.

 

In total right now I have about 10 products, 2 of which are about 2.75 lb each. Rest are just few ounces each. When I add one product (2.75 lb) in my cart, it still shows 5 lbs. In configuration screen under Admin, I have Package Tare weight. as 2lb.

 

Why does this happen and how can I make it to calculate actual weight total for getting correct shipping charges?

 

Many thanks again JanZ and to all who supports this community..

SHAH

Link to comment
Share on other sites

Why does this happen

UPS wants the weight rounded to one decimal (and it does go to them this way) but the total weight shown to the customer on checkout is rounded to zero decimals. So you can't check the accuracy of the weight this way (you would need to check the log).

Link to comment
Share on other sites

UPS wants the weight rounded to one decimal (and it does go to them this way) but the total weight shown to the customer on checkout is rounded to zero decimals. So you can't check the accuracy of the weight this way (you would need to check the log).

 

But I just added one product which is 2.75 lb. So even if they round it, it should round it to 3 lbs. right...?

Link to comment
Share on other sites

Is there anyway to take a country out of upsxml? I don't want to offer UPS shipping to customers from Canada. Any ideas on how I could accomplish this?

 

Thanks,

David Henderson

Link to comment
Share on other sites

Is there anyway to take a country out of upsxml? I don't want to offer UPS shipping to customers from Canada. Any ideas on how I could accomplish this?

You could probably do that using the zones stuff in osC and excluding Canada from the rest of the world as a zone. I don't know how that works in the admin, but this is the piece of code that is in every shipping module that controls if a shipping module is loaded or not depending on the zone (around line 110 in the upsxml.php file).

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

As you will notice there is the variable $check_flag that is set to false in the beginning and then a check is done on the zone and $order->delivery['zone_id']. Canada has 38 as a countries_id so I assume you can figure out what I want to point out.

Link to comment
Share on other sites

There are 10 different types of boxes that can be used for the site I'm working on. For some of the products, ice packs also need to be included. Which box and how many ice packs used is based on pounds of total product. I not only need to add a handling fee (price of specific box and number of ice packs) dynamically, but I also need to add the weight of the packaging to the total weight of the items in the shopping cart prior to receiving the quote from UPS (have to pay to ship the weight of the box). Does anyone know of a way to do this? Tare weight isn't quite what I need. I have played around with the Admin->Tools->Packaging option, but don't really know what it does or is supposed to do.

 

Thank you!

Link to comment
Share on other sites

Does anyone know of a way to do this? Tare weight isn't quite what I need.

You would need to add custom fields to the database (to figure out those products that need special packaging) and custom coding to the packaging routines in upsxml.php to separate those special products, do the special calculations on it etcetera. This is not found in the contributions.

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