Jump to content

UPS Shipping SORTED


kinetic

Recommended Posts

Ive had a few clients ask me "Why does the UPS shipping drop down go from highest to lowest? some of our customer just zip thru checkout and dont take a look at the shipping options available to them (dumb I know but people are busy...)

Ive even put in big h1 tags "Make sure you Review your Shipping Option before Checking Out!!" right above the shipping drop down (edited /skins/YOURSKIN/styleTemplates/content/cart.tpl) Which still doesnt help and people still get hit with the highest shipping amount offered by the store (usually next day air)

So I set about to see if this could be sorted

the big problem is that we cant do a order by shippingPrice ASC in a db query because we arent querying our DB for these amounts but rather querying UPS to get their rate quotes for each shipping type we have set to ENABLED In cubeCart Admin >Shipping Methods > UPS

I first tried editing: modules/shipping/UPS/calc.php and moving the case sections into the order I wanted (putting GND first

which didnt work at all

then I looked to modules/shipping/UPS/admin/index.inc.php

and reordered the table rows that give us the different shipping types from UPS (putting the GND row first

and voila wouldnt ya know it it worked....

UPS Ground became the very first shipping option on the cart side of things when I did a test order

Why this worked I still have no clue but it does...

Why I tried this:

I noticed when I was in admin that the order of the shipping types we had enabled was the same as the order they were in the drop down box for shipping in the cart so I gave it a shot and it worked!

Here's the specific steps to follow with code to find and swap

Open: /modules/shipping/UPS/admin/index.inc.php

To make ground the first one FIND:

	<tr>

	  <td align="left" class="tdText"><strong>Ground</strong></td>

	  <td class="tdText"><select name="module[productGND]">

		<option value="1" <?php if($module['productGND']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productGND']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>


and highlight it all and CUT IT (Ctrl+X)

then scroll up till you find this:


  <tr>

	<td colspan="2" class="tdTitle">UPS Products</td>

  </tr>


PASTE your cut code AFTER the </tr>  but BEFORE:


<td align="left" class="tdText"><strong>Next Day Air Early AM</strong></td>


(I also noticed that next day air early am was missing its opening <tr> so I added it... (sloppy html there devillion...)



My code before my edits:


  <tr>

	<td colspan="2" class="tdTitle">UPS Products</td>

  </tr>

	<td align="left" class="tdText"><strong>Next Day Air Early AM</strong></td>

	  <td class="tdText"><select name="module[product1DM]">

		<option value="1" <?php if($module['product1DM']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product1DM']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr><tr>

	  <td align="left" class="tdText"><strong>Next Day Air</strong></td>

	  <td class="tdText"><select name="module[product1DA]">

		<option value="1" <?php if($module['product1DA']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product1DA']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Next Day Air Saver</strong></td>

	  <td class="tdText"><select name="module[product1DP]">

		<option value="1" <?php if($module['product1DP']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product1DP']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>2nd Day Air Early AM</strong></td>

	  <td class="tdText"><select name="module[product2DM]">

		<option value="1" <?php if($module['product2DM']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product2DM']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>2nd Day Air</strong></td>

	  <td class="tdText"><select name="module[product2DA]">

		<option value="1" <?php if($module['product2DA']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product2DA']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>3 Day Select</strong></td>

	  <td class="tdText"><select name="module[product3DS]">

		<option value="1" <?php if($module['product3DS']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product3DS']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Ground</strong></td>

	  <td class="tdText"><select name="module[productGND]">

		<option value="1" <?php if($module['productGND']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productGND']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Canada Standard</strong></td>

	  <td class="tdText"><select name="module[productSTD]">

		<option value="1" <?php if($module['productSTD']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productSTD']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Worldwide Express</strong></td>

	  <td class="tdText"><select name="module[productXPR]">

		<option value="1" <?php if($module['productXPR']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productXPR']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Worldwide Express Plus</strong></td>

	  <td class="tdText"><select name="module[productXDM]">

		<option value="1" <?php if($module['productXDM']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productXDM']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Worldwide Expedited</strong></td>

	  <td class="tdText"><select name="module[productXPD]">

		<option value="1" <?php if($module['productXPD']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productXPD']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

  <tr>

	<td align="right" class="tdText">&nbsp;</td>

	<td class="tdText"><input type="submit" class="submit" value="Edit Config" /></td>

  </tr>

</table>




My code AFTER my EDITS:


  <tr>

	<td colspan="2" class="tdTitle">UPS Products</td>

  </tr>

	<tr>

	  <td align="left" class="tdText"><strong>Ground</strong></td>

	  <td class="tdText"><select name="module[productGND]">

		<option value="1" <?php if($module['productGND']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productGND']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	<td align="left" class="tdText"><strong>Next Day Air Early AM</strong></td>

	  <td class="tdText"><select name="module[product1DM]">

		<option value="1" <?php if($module['product1DM']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product1DM']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr><tr>

	  <td align="left" class="tdText"><strong>Next Day Air</strong></td>

	  <td class="tdText"><select name="module[product1DA]">

		<option value="1" <?php if($module['product1DA']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product1DA']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Next Day Air Saver</strong></td>

	  <td class="tdText"><select name="module[product1DP]">

		<option value="1" <?php if($module['product1DP']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product1DP']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>2nd Day Air Early AM</strong></td>

	  <td class="tdText"><select name="module[product2DM]">

		<option value="1" <?php if($module['product2DM']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product2DM']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>2nd Day Air</strong></td>

	  <td class="tdText"><select name="module[product2DA]">

		<option value="1" <?php if($module['product2DA']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product2DA']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>3 Day Select</strong></td>

	  <td class="tdText"><select name="module[product3DS]">

		<option value="1" <?php if($module['product3DS']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['product3DS']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Canada Standard</strong></td>

	  <td class="tdText"><select name="module[productSTD]">

		<option value="1" <?php if($module['productSTD']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productSTD']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Worldwide Express</strong></td>

	  <td class="tdText"><select name="module[productXPR]">

		<option value="1" <?php if($module['productXPR']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productXPR']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Worldwide Express Plus</strong></td>

	  <td class="tdText"><select name="module[productXDM]">

		<option value="1" <?php if($module['productXDM']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productXDM']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

	<tr>

	  <td align="left" class="tdText"><strong>Worldwide Expedited</strong></td>

	  <td class="tdText"><select name="module[productXPD]">

		<option value="1" <?php if($module['productXPD']==1) echo "selected='selected'"; ?>>Enabled</option>

		<option value="0" <?php if($module['productXPD']==0) echo "selected='selected'"; ?>>Disabled</option>

	  </select></td>

	</tr>

  <tr>

	<td align="right" class="tdText">&nbsp;</td>

	<td class="tdText"><input type="submit" class="submit" value="Edit Config" /></td>

  </tr>

</table>

You can swap these table rows around in any order you wish depending how you want them to appear in the shipping drop down in a customers cart

this hack only shows me swapping ground to the top option instead of 5th from the bottom...

This hack was performed on a CCv4.1.1

and a CCv4.2.3 stores and works across the board...

Kinetic :yeahhh:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...