Welcome, Guest. Please login or register.
Login with username, password and session length


VirtueMart 1.1.8 - [SECURITY RELEASE] is available! Read more....

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
VirtueMart ForumVirtueMart Dev/Coding CentralDevelopment Projects, Modifications, Hacks & TweaksShipping Modules (Moderator: koltz)UPS Shipping Module Hacks: Set Shipping Methods & Override Vendor Zip
Pages: [1]   Go Down
Print
Author Topic: UPS Shipping Module Hacks: Set Shipping Methods & Override Vendor Zip  (Read 5204 times)
Daniel Wagner
Newbie
*
Posts: 41


« on: March 25, 2006, 14: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.

  • 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.
  • UPS Shipping Method - I am using the UPS Online Tools to retrieve shipping rates, but I do not want customers to be able to select some of the methods that are returned from UPS. So, these too can now be set in the Shipping Module Configuration. There are simply check boxes for each of the available shipping methods and you may select which to allow a customer to choose from.

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.

* ups.php.gz (6.3 KB - downloaded 288 times.)
Logged

Dan
deneb
Hero Member
*****
Posts: 654


« Reply #1 on: April 27, 2006, 15: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:
Code:
<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'
Logged
Daniel Wagner
Newbie
*
Posts: 41


« Reply #2 on: May 14, 2006, 19:55:37 PM »

Deneb,

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

Thanks again!
Logged

Dan
Elkaholic
Jr. Member
**
Posts: 81



WWW
« Reply #3 on: May 22, 2006, 23:10:42 PM »

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?

Logged

VirtueMart Is a Great Product,

Thanks!!
bgstovall
Newbie
*
Posts: 34


« Reply #4 on: January 31, 2008, 01:29:57 AM »

BUMP
Logged
Simon A.
Sr. Member
****
Posts: 336



WWW
« Reply #5 on: January 31, 2008, 12: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.
Logged

Pages: [1]   Go Up
Print
Jump to: