VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Shipping Modules => Topic started by: Daniel Wagner on March 25, 2006, 21:09:40 PM

Title: UPS Shipping Module Hacks: Set Shipping Methods & Override Vendor Zip
Post by: Daniel Wagner on March 25, 2006, 21:09:40 PM
I have made a few modifications to the UPS Shipping module:

Source Zip Code - I needed to be able to set a ship from (source) zip code that is different from the Vendor's zip code (products are shipped from a fulfillment center in a different city). A Ship From Zip Code can now be set in the Shipping Module Configuration and if set will override the Vendor's zip code.


note: I removed the UPS Worldwide Expedited SM shipping method from the list (actually just commented out in the attached file) because for some reason, no matter what I did, this shipping method was always checked in the configuration...really pretty strange. I must have made a silly mistake, but I was unable to figure it out. If someone is able to figure out what I did wrong please let me know!

Updated ups.php file is attached. I have placed comments around all of my changes to the original code. I hope that someone else finds this useful.

[attachment cleanup by admin]
Title: Re: UPS Shipping Module Hacks: Set Shipping Method
Post by: deneb on April 27, 2006, 22:19:04 PM
Hey Dan,
awesome contribution!

I was fiddling around with this hack and found that the UPS Worldwide Expedited SM-is-always-checked issue is indeed weird! As you have coded it, if you uncheck the UPS Worldwide Express SM option...then the Expedited option would be shown unchecked. So, I thought maybe there was a typo in the php IF statement for that option. well...it all looked good.

My only solution is to enclose the value in single quotes so it tests to see if it matches a string instead of a number. This works!

here is the modded html row:
<tr>
  <td>&nbsp;</td>
  <td>
<input type="checkbox" name="UPS_WORLDWIDE_EXPEDITED_SM" class="inputbox" <?php if (UPS_WORLDWIDE_EXPEDITED_SM == '08') echo "checked=\"checked\""?> value="08" />UPS Worldwide Expedited SM
  </td>
  <td>&nbsp;
  </td>
</tr>


key changes:

UPS_WW_EXPEDITED_SM ---> UPS_WORLDWIDE_EXPEDITED_SM

and

08 ---> '08'
Title: Re: UPS Shipping Module Hacks: Set Shipping Methods & Override Vendor Zip
Post by: Daniel Wagner on May 15, 2006, 02:55:37 AM
Deneb,

Thanks so much for figuring this out! This was driving me nuts...I wasted so much time on this.

Thanks again!
Title: Re: UPS Shipping Module Hacks: Set Shipping Methods & Override Vendor Zip
Post by: Elkaholic on May 23, 2006, 06:10:42 AM
Will this hack allow for multiple vendor shipping address "Ship from". I will be setting up a site that will have several drop ship categories and would like each category, or even item to have the item calculate shipping charges based on the vendors location. I know at checkout time this is where things could get tricky and I am looking at attacking this type of mod, unless it's already been done?

Title: Re: UPS Shipping Module Hacks: Set Shipping Methods & Override Vendor Zip
Post by: bgstovall on January 31, 2008, 08:29:57 AM
BUMP
Title: Re: UPS Shipping Module Hacks: Set Shipping Methods & Override Vendor Zip
Post by: Simon A. on January 31, 2008, 19:20:24 PM
You'd somehow have to have a ZIP associated with each item, so I'd say this probably doesn't do that.