Zen Cart Logo
Forums / All Other Contributions/Addons / UPS Worldship XML Export

UPS Worldship XML Export

Locked

Views: 4,659

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
17 Feb 2008, 2:25 AM
#1
cryogenicz avatar

cryogenicz

New Zenner

Join Date:
Apr 2007
Posts:
12
Plugin Contributions:
0

UPS Worldship XML Export

I installed this wonderful mod, and it all seems to work except it is not adding the proper weight to UPS.

I was thinking, it would be good for this program to either enter the proper weight (it is only adding each Item's weight once, even if there is multiple items)
or a way to make it enter 0 for every weight and all orders go into the pending shipment so I can manually enter all weights, and process the shipment.

Any help would be AMAZING!

15 Dec 2008, 6:23 PM
#2
ctopher avatar

ctopher

New Zenner

Join Date:
Nov 2006
Posts:
24
Plugin Contributions:
0

Re: UPS Worldship XML Export

You got no help?

I had the same problem because we use a prefix to our SQL table names. That is, our orders table is actually called pre_orders where pre_ is the table prefix.

To fix this chage from hard coded table names to zen cart variable names in print_ups_xml.php. So change line 44 in print_ups_xml.php from:

  $query = mysql_query("SELECT * FROM `products` wHERE `products_id` = ".$order->products[$i]['id']. " LIMIT 1");
```to:

$query = mysql_query("SELECT * FROM ".TABLE_PRODUCTS." WHERE products_id = ".$order->products[$i]['id']. " LIMIT 1");


You also need to make a similar change to line 52. From:

$query = mysql_query("SELECT `shipping_method` FROM `orders` WHERE `orders_id` = ".$oID." LIMIT 1");

$query = mysql_query("SELECT `shipping_method` FROM ".TABLE_ORDERS." WHERE `orders_id` = ".$oID." LIMIT 1");

Chris
28 Jan 2009, 8:18 PM
#3
chuckienorton avatar

chuckienorton

New Zenner

Join Date:
Dec 2007
Posts:
54
Plugin Contributions:
0

Re: UPS Worldship XML Export

I'm having same probs... I just added this update, ctopher, and it didn't fix it. What is that update supposed to do?

(using version 9 at the moment)
Thanks,
Chuck

20 Feb 2009, 10:02 PM
#4
ctopher avatar

ctopher

New Zenner

Join Date:
Nov 2006
Posts:
24
Plugin Contributions:
0

Re: UPS Worldship XML Export

The changes I suggested made the module more friendly to carts that use a prefix in their table names.

When installing Zen Cart, you could, at the Database Setup screen, set a string as the "Store Identifier (Table-Prefix)". If you didn't leave this blank, then the table names in your database would use this string as a prefix.

http://www.installationwiki.org/images/9/9f/1175_02_10.png

For example if you put "Zen_" as the Store Identifier, then your "products" table will actually be called "Zen_products". If this is the case there will be no "products" table and the Worldship Export module's query will fail because the table doesn't exist. All I did was replace the hard coded table names with the Zen Cart variable names which will automatically use the Store Identifier.

What problems are you having?

13 Dec 2010, 6:33 AM
#5
sweettraders avatar

sweettraders

New Zenner

Join Date:
Nov 2008
Posts:
11
Plugin Contributions:
0

Re: UPS Worldship XML Export

My prefix is zen. Change line 42 to 50 in print_ups_xml.php to the code below which will multiply weight with quantity per product ordered.

while (!empty($order->products[$i])) {

  $query = mysql_query("SELECT * FROM `zen_products` wHERE `products_id` = ".$order->products[$i]['id']. " LIMIT 1");
  $result = mysql_fetch_array($query);
  $query2 = mysql_query("SELECT * FROM `zen_orders_products`  WHERE `orders_id` = ".$oID." AND `products_id` = ".$order->products[$i]['id']. " LIMIT 1");
  $result2 = mysql_fetch_array($query2);
  $weight = $weight + $result2['products_quantity'] * $result['products_weight'];
  $i++;
  }