Jump to content
torinwalker

New UPS XML Shipping Module available

Recommended Posts

Having a problem with this Shipping Module. Its been installed for a while but it just came to my attention that it is charging TAX on the shipping even with the setting disabled in the admin section. In addition to that it is charging DOUBLE tax on the shipping!?!? For example a $1.00 item plus $10.00 shipping at 7% sales tax is being charged $1.47 in sales tax. So its charging tax on $21 and not $11 like it should.

 

Any idea what could be going on here??

Not a clue. As you can see in the function quote in the upsxml.php shipping module the only thing this module does with tax is adding it to the array of quotes:

 

           if ($this->tax_class > 0) {
               $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

 

It sends that to checkout_shipping which then adds the tax (e.g. around line 343) for informing the customer about the tax:

 

                    <td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>

 

However, the class shipping that stores this information does not retain the information on tax, only the shipping cost. I don't know where this is calculated. There is some reference in the class order.php where in $order['info'] the shipping method and cost is set up with (initially I presume) zero tax:

 

     $this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,
                         'currency' => $currency,
                         'currency_value' => $currencies->currencies[$currency]['value'],
                         'payment_method' => $payment,
                         'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),
                         'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),
                         'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),
                         'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),
                         'shipping_method' => $shipping['title'],
                         'shipping_cost' => $shipping['cost'],
                         'subtotal' => 0,
                         'tax' => 0,
                         'tax_groups' => array(),
                         'comments' => (isset($GLOBALS['comments']) ? $GLOBALS['comments'] : ''));

 

So the UPS or any shipping module has nothing to do with the tax calculated in the checkout process later than checkout_shipping. Must be something in your tax setup where shipping is said to be taxed.

Share this post


Link to post
Share on other sites

thanks for the info. The only reason i think its related is that if i checkout at item that has FREE shipping the tax is calculated correctly. Its only the tax on the shipping amount that gets messed up.

Share this post


Link to post
Share on other sites

I have some questions after installing UPS XML 1.3.7. As far as I know I installed the dimensional support (it wouldn't work until I did). Am I supposed to be able to turn this on and off through the admin? I see no setting for it.

 

Because I saw no settings for this I tried to configure it. I set up a package at 9.25 X 6.25 X 3. I went into a test product and gave it a weight of .25 and dimensions of 9 X 6 X 1. So three of these items should fit into that box.

 

NO MATTER what I do it always says the dimensional weight is 4 pounds and the rates it gives are high for shipping one t-shirt...

 

Any insight to this contrib would be greatly appreciated!

 

Thanks,

 

Tom

Share this post


Link to post
Share on other sites

I have some questions after installing UPS XML 1.3.7. As far as I know I installed the dimensional support (it wouldn't work until I did). Am I supposed to be able to turn this on and off through the admin? I see no setting for it.

From the install.txt that came with the contribution:

 

--------
STEP 1
--------
BACKUP your database and any files that will be amended before beginning

Run the three queries found in (or use the file itself) the included sql file: configuration_shipping.sql to add 
three configuration keys to the table configuration. Then configure them in Admin->Configuration->Shipping/Packaging:

Dimensions Support (leave at No for the time being, read install_dimensional_support.txt in the folder dimensional_support 
for further info)
Unit Weight (change the default LBS to KGS if needed)
Unit Length (change the default IN to CM if needed)

So you will have to enable Dimensions Support in Admin->Configuration->Shipping/Packaging for it to actually kick in when checking out.

Share this post


Link to post
Share on other sites

Oh my gosh! I can't believe I overlooked that. It looks like I ran the SQL twice. Can I just use the uninstall then reload the SQL to get ri of the extra fields I see under shipping/packaging?

 

THANK YOU SO MUCH FOR THE CONTRIB AND THE HELP!

Edited by DeanDesign

Share this post


Link to post
Share on other sites

It looks like I ran the SQL twice. Can I just use the uninstall then reload the SQL to get ri of the extra fields I see under shipping/packaging?

Yes, run the uninstall:

 

delete from configuration where configuration_key in ('SHIPPING_DIMENSIONS_SUPPORT', 'SHIPPING_UNIT_WEIGHT', 'SHIPPING_UNIT_LENGTH');

 

and then the configuration_shipping.sql again.

Share this post


Link to post
Share on other sites

I got It... I just went into phpmyadmin and searched out the duplicates... Still a little confused on how to use this. It looks like its working but I'm not sure if I have it set up right.

 

I have 2 packages set up 12.25x17.25x3 and 11.25x8.75x2. I have tshirts set up as weighing .25 with a LxWxH of 5x4x1. The smaller box can hold around 4 shirts...Am I DOING THIS RIGHT? :thumbsup:

 

Thanks! :thumbsup:

Share this post


Link to post
Share on other sites

I have 2 packages set up 12.25x17.25x3 and 11.25x8.75x2. I have tshirts set up as weighing .25 with a LxWxH of 5x4x1. The smaller box can hold around 4 shirts...Am I DOING THIS RIGHT? :thumbsup:

No. 5 x 4 x 1 will fit in the small box but has a volume of 20.

11.25x8.75x2 = 196.875

196.875: 20 = 9.84 so that box will fit 9 t-shirts.

 

Besides, even in real-life with these dimensions it will fit 8 units. So no, you are not doing this right.

Share this post


Link to post
Share on other sites

I have UPS XML working just fine, but when I enable Onepage Checkout it doesn't and comes back with this error code

110206: Missing/Illegal ShipTo/Address/StateProvinceCode

 

I posted a similar question on the Onepage Checkout thread (with a screenshot) also.

 

It seems to be a conflict with onepage checkout, but they want to charge for a fix, I think the fix can be found here on this topic, I just have yet to find it.


Life Is Too Short,

Enjoy Your Coffee!

Pete

Share this post


Link to post
Share on other sites

I just disabled negotiated rates and it now works.

That doesn't make sense. Must be a coincidence not related to it.

 

If you look at the upsxml.php code, function quote() you will notice that state is derived from $order->delivery['state']

 

I don't know if that contribution delivers that value and in what form (WI like UPS wants it or Wisconsin?)

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites

I uploaded the files to my ftp and I don't see anything in the modules > shipping

 

 

I'm not even sure if I even added the sql to the host database correctly. i'm freakin frustrated with modules.

Share this post


Link to post
Share on other sites

I uploaded the files to my ftp and I don't see anything in the modules > shipping

 

 

I'm not even sure if I even added the sql to the host database correctly. i'm freakin frustrated with modules.

You'll have to be more descriptive in what you did and what you don't see because this sounds like whining but doesn't tell us anything useful.

 

For example: "I dont seen anything". Do you mean you only see part of the page, you see the whole page but UPS doesn't show up in the list, do you only see a white page. In short: not enough information.

Share this post


Link to post
Share on other sites

You'll have to be more descriptive in what you did and what you don't see because this sounds like whining but doesn't tell us anything useful.

 

For example: "I dont seen anything". Do you mean you only see part of the page, you see the whole page but UPS doesn't show up in the list, do you only see a white page. In short: not enough information.

 

I was and still am whining..hah.

 

I see the OScommerce administration page, I go to modules then to shipping, and I don't see anything listed. I'm not positive if I entered in the configuration shipping.sql into the sql database correctly. This is my first time messing with this stuff.

Share this post


Link to post
Share on other sites

I see the OScommerce administration page, I go to modules then to shipping, and I don't see anything listed. I'm not positive if I entered in the configuration shipping.sql into the sql database correctly. This is my first time messing with this stuff.

I'm not 100% sure but I think that even if you didn't run the sql (which you can check in Configuration->Shipping/Packaging) the module assumes no dimensional support and the American units (inch, pounds) to be set without giving an error.

 

Without the actual error it is almost impossible to tell you how to fix it. So if you don't know where the error log is, you can make one with these instructions.

 

Perhaps even a view source of the web page will show the error in the page source but not show on the page iself.

 

Something is really important with dealing with modules. If there is a PHP file in one of the modules directory (order, shipping, order_total) there should be a php file with the same name in the language(s) directory. At least in the language directory of the language you use in the admin. If there is a file without a file with the same name (languages versus module directory or vice versa) this will result in an error.

 

So renaming a file e.g. to upsxml_old_version.php and putting in a new one upsxml.php will mysteriously result in a fatal error.

Share this post


Link to post
Share on other sites

I have UPS XML installed for the past two months and it works fine. Or almost fine. All the products that I ship require additional handling (having irregular shapes) - $8 in UPS books. I cannot increase the price onsite with $8 because I would be no more competitive ... however - the UPS module handling charge goes per total cart - not per item. IS there any way that I can change this - or even hard code - to add $8/item ?

Thank you so much for your help - I realy need this.

Share this post


Link to post
Share on other sites

Actually I did it .... I changed upsxml.php to:

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

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

HELLO again all, update,

 

I Uncommented again the two lines from

 

// uncomment the next line if you get curl error 60: error setting certificate verify locations

// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

// uncommenting the next line is most likely not necessary in case of error 60

// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

 

even though I was not getting a cURL 60 error.

 

I then got the Package type was not valid from your countries ( I think it was 112112 or something like that) so I went through and chagned the types of package to only the ones avalable from an EU Origin country ( I am in the UK shipping to the US and Canada only) and now I get the 111057: This measurement system is not valid for the selected country.

 

I have swapped between Kgs and Lbs and still get the same problem.

 

Any help greatly apprecated and the price of the beer is going up now!!!

Share this post


Link to post
Share on other sites

Any help greatly apprecated and the price of the beer is going up now!!!

In the install instructions there is an explanation how to set up the logging of the XML request that the shop sends to UPS and what UPS returns. Then you can check if a request for quote is sent with imperial measurements or metric which seems to be the issue.

Share this post


Link to post
Share on other sites

In the install instructions there is an explanation how to set up the logging of the XML request that the shop sends to UPS and what UPS returns. Then you can check if a request for quote is sent with imperial measurements or metric which seems to be the issue.

 

Thanks for that I was already in the process of getting that set up. It always seems to be shipping in Lbs, even though I have changed in the configuration data from LBs to Kgs. Does the upsxml pull the weight from anywhere else of could it be some bizarre cacheing issue.

 

Thanks for your help

Share this post


Link to post
Share on other sites

Thanks for that I was already in the process of getting that set up. It always seems to be shipping in Lbs, even though I have changed in the configuration data from LBs to Kgs. Does the upsxml pull the weight from anywhere else of could it be some bizarre cacheing issue.

It's not cached. Weight in osC 2.2 is "unit acnostic", it's just a number. The upsxml module looks for the setting in the table configuration but falls back on inches and pounds if it cannot find these (around line 59-73):

 

// the variables for unit weight, unit length, and dimensions support were moved to
// shop admin -> Configuration -> Shipping/Packaging in
// version 1.3.0. Run the configuration_shipping.sql to add these to your configuration
       if (defined('SHIPPING_UNIT_WEIGHT')) {
       $this->unit_weight = SHIPPING_UNIT_WEIGHT;
       } else {
// for those who will undoubtedly forget or not know how to run the configuration_shipping.sql
// we will set the default to pounds (LBS) and inches (IN)
       $this->unit_weight = 'LBS';
       }
       if (defined('SHIPPING_UNIT_LENGTH')) {
       $this->unit_length = SHIPPING_UNIT_LENGTH;
       } else {
         $this->unit_length = 'IN';
       }

Of course you can hard code it there if you want :)

Share this post


Link to post
Share on other sites

It's not cached. Weight in osC 2.2 is "unit acnostic", it's just a number. The upsxml module looks for the setting in the table configuration but falls back on inches and pounds if it cannot find these (around line 59-73):

 

// the variables for unit weight, unit length, and dimensions support were moved to
// shop admin -> Configuration -> Shipping/Packaging in
// version 1.3.0. Run the configuration_shipping.sql to add these to your configuration
       if (defined('SHIPPING_UNIT_WEIGHT')) {
       $this->unit_weight = SHIPPING_UNIT_WEIGHT;
       } else {
// for those who will undoubtedly forget or not know how to run the configuration_shipping.sql
// we will set the default to pounds (LBS) and inches (IN)
       $this->unit_weight = 'LBS';
       }
       if (defined('SHIPPING_UNIT_LENGTH')) {
       $this->unit_length = SHIPPING_UNIT_LENGTH;
       } else {
         $this->unit_length = 'IN';
       }

Of course you can hard code it there if you want :)

 

 

Fantastic ! Hard coded it and it worked. Then found out that for some reason the DB had Shipping_unit_weight as Shipping_unit Weight in the configuration options and that seemed to be causing the problems.

Share this post


Link to post
Share on other sites

Don't know where I went wrong but after installing UPSXML I go to admin/modules/shipping and there is no UPSXML there but there is United Parcel Service that has been there from the beginning. I double checked to make sure I installed all the files and the only problem was catalog/admin/categories.php already existed and I could not see what to modify so I did not install it, catalog/admin/includes/languages/english/categories.php was there also but I found the code that was different and changed mine.

 

I am a complete novice and I just want a better shipping module that I now have.

Share this post


Link to post
Share on other sites

Don't know where I went wrong but after installing UPSXML I go to admin/modules/shipping and there is no UPSXML there but there is United Parcel Service that has been there from the beginning. I double checked to make sure I installed all the files and the only problem was catalog/admin/categories.php already existed and I could not see what to modify so I did not install it, catalog/admin/includes/languages/english/categories.php was there also but I found the code that was different and changed mine.

Shipping modules are "recognized" by admin->modules->shipping by reading the directory containing the shipping files and then reading the corresponding language files. The UPSXML module has the same description as the "old" ups module. Since this was no longer included in the osC installation for several years and the same description used in the checkout_shipping and the "XML" addition in the description not functional for customers it seemed safe to drop the "XML" in the description.

 

So if you still have the old module you should now see two UPS shipping modules. One of which will be the UPSXML one.

 

Apart from running an sql command and a change in admin/modules.php (step 3 in the install.txt) there is no need to change anything in your shop files if you just want to use the UPSXML shipping module. If you want to add more bells and whistles (dimensional support) then you would need to change more.

Edited by Jan Zonjee

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

×