Jan Zonjee Posted July 30, 2007 Share Posted July 30, 2007 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!) Quote Link to comment Share on other sites More sharing options...
AndreaFahy Posted August 2, 2007 Share Posted August 2, 2007 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. Quote Kindly, Andrea Fahy Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 2, 2007 Share Posted August 2, 2007 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. Quote Link to comment Share on other sites More sharing options...
AndreaFahy Posted August 2, 2007 Share Posted August 2, 2007 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 :) Quote Kindly, Andrea Fahy Link to comment Share on other sites More sharing options...
Guest Posted August 15, 2007 Share Posted August 15, 2007 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 Quote Link to comment Share on other sites More sharing options...
mbsig Posted August 16, 2007 Share Posted August 16, 2007 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. Quote Link to comment Share on other sites More sharing options...
Nyte_Prowler Posted August 18, 2007 Share Posted August 18, 2007 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? Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 18, 2007 Share Posted August 18, 2007 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'); Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 18, 2007 Share Posted August 18, 2007 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? Quote Link to comment Share on other sites More sharing options...
Nyte_Prowler Posted August 18, 2007 Share Posted August 18, 2007 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? Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 18, 2007 Share Posted August 18, 2007 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... Quote Link to comment Share on other sites More sharing options...
Nyte_Prowler Posted August 18, 2007 Share Posted August 18, 2007 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? Quote Link to comment Share on other sites More sharing options...
ukgoods Posted August 21, 2007 Share Posted August 21, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 21, 2007 Share Posted August 21, 2007 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... Quote Link to comment Share on other sites More sharing options...
kdsnu03 Posted August 24, 2007 Share Posted August 24, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 24, 2007 Share Posted August 24, 2007 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. Quote Link to comment Share on other sites More sharing options...
kdsnu03 Posted August 24, 2007 Share Posted August 24, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 24, 2007 Share Posted August 24, 2007 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). Quote Link to comment Share on other sites More sharing options...
kdsnu03 Posted August 24, 2007 Share Posted August 24, 2007 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...? Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 24, 2007 Share Posted August 24, 2007 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...? Wrong: I have Package Tare weight. as 2lb. Read the docs in the knowledge base if you would like to know how osC handles shipping weight. 2.75 + 2 = 4.75 => 5 Quote Link to comment Share on other sites More sharing options...
kdsnu03 Posted August 24, 2007 Share Posted August 24, 2007 Wrong: Read the docs in the knowledge base if you would like to know how osC handles shipping weight. 2.75 + 2 = 4.75 => 5 I apologize. You rock..... It works.. Thanks JanZ.. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 28, 2007 Share Posted August 28, 2007 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 Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 28, 2007 Share Posted August 28, 2007 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted August 28, 2007 Share Posted August 28, 2007 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! Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted August 28, 2007 Share Posted August 28, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.