close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Show the type of shipping option instead of the number

Thread began 5/01/2009 12:20 pm by robert329616 | Last modified 5/07/2009 12:48 pm by robert329616 | 7761 views | 9 replies |

robert329616

Show the type of shipping option instead of the number

Hello.

I am now adding multiple shipping options. I followed a solution (see below) that was posted in a previous thread which worked perfectly. On the confirmation page I would like to have Shipping: Shipping type (Ground etc) for the customer to see.
I then added the following code to the confirm.php page:
<td class="eC_SummaryLabel">Shipping: <?php echo((isset($_POST["shipping_options"]))?$_POST["shipping_options"]:"") ?></td>
This shows as; Shipping: 03 (for ground). Is there a way to actually post as Ground instead of 03?

Here is the solution I followed:
On the checkout page in the shipping part of the form you will need to add a new select list. The name does not matter so much as the options and values in it. After the select list is in place use these for the options:
<option value="01">Next Day Air</option>
<option value="02">2nd Day Air</option>
<option value="03">Ground</option>
<option value="07">Worldwide Express</option>
<option value="08">Worldwide Expedited</option>
<option value="11">Standard</option>
<option value="12">3 Day Select</option>
<option value="13">Next Day Air Saver</option>
<option value="14">Next Day Air Early AM</option>
<option value="54">Worldwide Express Plus</option>
<option value="59">2nd Day Air AM</option>
<option value="65">Express Saver</option>
Once this is in place you will need to edit the UPS shipping server behavior that is on the confirm page. In here you will use the lightning bolt for the service type and choose this new select list that you put in the checkout form.

You may also need to know...
On your confirm page you may need to go to Bindings > Form Data and select your checkout page to get the form bindings available on this page. After you do this you should see the form from the checkout page, on my confirm page it is eCart_checkout_form.

Thanks!

Regards,
Rob

Sign in to reply to this post

Ray BorduinWebAssist

There is no way to get it to post as Ground instead of 03 without breaking it. Your shipping provider needs it to say 03 to work right.

Your options are to either move the text to a hidden form element so you can have both, or to add them to a database table so you can look the text up based on the number, or to use a series of if statement to set the correct value into a session variable.

Sign in to reply to this post
Did this help? Tips are appreciated...

robert329616

OK, thanks Ray!

Regards,
Rob

Sign in to reply to this post

robert329616

Ray,

I have tried for the last few days to figure out how to create the hidden form element (from checkout.php) so I can show shipping: "ground" in the summary (confirm.php) instead of the number. I am also trying to show it in the hidden form (freight) so I can pass that through to Authorize.net as what type of shipping should be used.

Is there a solution recipe I could follow?

Thanks for your help.

Regards,
Rob

Sign in to reply to this post

Ray BorduinWebAssist

not sure if there is a solution recipe... try:

<input type="hidden" name="shipTypeText" id="shipTypeText" value="Ground">
<select name="shipType" onChange="document.getElementById("shipTypeText").value = this.options[this.selectedIndex].text;">
<option value="01">Next Day Air</option>
<option value="02">2nd Day Air</option>
<option value="03" selected>Ground</option>
<option value="07">Worldwide Express</option>
<option value="08">Worldwide Expedited</option>
<option value="11">Standard</option>
<option value="12">3 Day Select</option>
<option value="13">Next Day Air Saver</option>
<option value="14">Next Day Air Early AM</option>
<option value="54">Worldwide Express Plus</option>
<option value="59">2nd Day Air AM</option>
<option value="65">Express Saver</option>

Sign in to reply to this post
Did this help? Tips are appreciated...

robert329616

Ray,

Thanks for the help.

I added the code to my page:

<th>Please select:</th>
<td>
<input type="hidden" name="shipTypeText" id="shipTypeText" value="Ground">
<select name="shipType" onChange="document.getElementById("shipTypeText"). value = this.options[this.selectedIndex].text;">
<option value="01">Next Day Air</option>
<option value="02">2nd Day Air</option>
<option value="03" selected>Ground</option>
<option value="07">Worldwide Express</option>
<option value="08">Worldwide Expedited</option>
<option value="11">Standard</option>
<option value="12">3 Day Select</option>
<option value="13">Next Day Air Saver</option>
<option value="14">Next Day Air Early AM</option>
<option value="54">Worldwide Express Plus</option>
<option value="59">2nd Day Air AM</option>
<option value="65">Express Saver</option>
</select></td>

I receive the following error when I check out (shipping quote):
Missing/Illegal Service/Code.

Is there something I am missing?

Thanks again for your help.

Regards,
Rob

Sign in to reply to this post

Ray BorduinWebAssist

I used the wrong form element name.

Find and replace "shipType" with: "shipping_options", since that was the name of the form element originally... or vice versa to use the form element name I used. The problem is it is out of synch.

Sign in to reply to this post
Did this help? Tips are appreciated...

robert329616

Ray,

That worked, I am now able to get the quote and it shows ground. I have a problem that when I select another shipping option the price changes but it still says ground.

I apologize, I am having a hard time getting my mind around this one. Do I need to create a hidden field for each shipping option?

Thanks.

Rob

Sign in to reply to this post

robert329616

Ray,

I was trying to google the code. Do I need a Java Script in the page to make this work?
Or should it work as is with maybe adding more hidde fields?

Thanks for all your help with this.

Regards,
Rob

Sign in to reply to this post

robert329616

Ray,

I called out to a friend who is good with javascript and came up with this solution:

JS:
<script type="text/javascript">
function setPrice(selObj){
document.forms['ecart_checkout_form'].price.value = selObj.options[selObj.options.selectedIndex].value;
document.forms['ecart_checkout_form'].pricetext.value = selObj.options[selObj.options.selectedIndex].text;
}
</script>

Form:
<select name="shipping_options" onchange='javascript: setPrice(this);'>
<option value=''>Select an option</option>
<option value="01">Next Day Air</option>
<option value="02">2nd Day Air</option>
<option value="03" selected="selected">Ground</option>
<option value="07">Worldwide Express</option>
<option value="08">Worldwide Expedited</option>
<option value="11">Standard</option>
<option value="12">3 Day Select</option>
<option value="13">Next Day Air Saver</option>
<option value="14">Next Day Air Early AM</option>
<option value="54">Worldwide Express Plus</option>
<option value="59">2nd Day Air AM</option>
<option value="65">Express Saver</option>
</select>
<input name="price" type="hidden" value="03" />
<input name="pricetext" type="hidden" value="Ground" />

Thanks again for all your help! This forum is great.

Regards,
Rob

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...