close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Flat Rate and Shipping Provider Options

Thread began 5/14/2010 2:48 pm by mrobben375515 | Last modified 5/18/2010 7:45 am by Jason Byrnes | 2866 views | 11 replies |

mrobben375515

Flat Rate and Shipping Provider Options

I need to have a flat rate (Local Delivery) and one UPS option for my customers. So it would be nice to have a drop down menu in the checkout section with both options. Can you give me a detailed step by step process of doing that or give me a link to a thread where you explain how to do this?

Sign in to reply to this post

Jason ByrnesWebAssist

the keys to this working are:
1- Select it in a form element on the checkout page.

2- capture the selection in hidden form element on the confirm page.

3- capture the selection in a session variable on the confirm page.

4- Use the session variable value in the triggers for the shipping rules.


on the checkout page create your select list:

<select name="shipType" id="shipType">
<option value="Local Pickup">Local Pickup</option>
<option value="UPS">UPS</option>
</select>




on the confirm page, create a hidden form element of the same name, and set it to capture the value posted from the checkout page:

php:
<input name="shipType" type="hidden" id="shipType" value="<?php echo((isset($_POST["shipType"]))?$_POST["shipType"]:""?>" />




Now add a Set Session Value server behavior.On the server behaviors panel, click the plus button and select eCart -> General Set Session Value.

Set the Name to shipType.

Set the trigger to any form post

for the value, click the lightning bolt and select the shipType form element.


Now in the eCart object, set the trigger for the local shipping rule to be Based on session variable value:
If the session variable "shipType" has a value "=" to "Local Pickup"

and set the trigger for UPS shipping to be Based on session variable value:
If the session variable "shipType" has a value "=" to "UPS"

Sign in to reply to this post

mrobben375515

I followed your instructions but have a few questions. I wasn't able to get it working, and now when I go through the checkout process there's no shipping calculated. When you said to "create a hidden form element of the same name, and set it to capture the value posted from the checkout page" and then gave me the code to put into the page, does that php string in the code capture the value or did I need to do something extra.

Also, in a help session with jason he mentioned that eCart has some problems when you edit it. Do I need to go download any kind of fix? Right now I have USPS Shipping, FedEx Shipping, UPS Shipping, and then the two options Local Delivery and UPS Second Day Air as rules in the shipping tab of the eCart Object. Please tell me if this is wrong.

I've attached confirm and checkout pages just in case. Thanks for your time..

Attached Files
checkout.zip
confirm.zip
Sign in to reply to this post

Jason ByrnesWebAssist

If you are adding in the additional shipping options, you should remove the existing UPS, FedEx and USPS shipping rules that came in power store.


the shipping rule is not working because you added the set session value serve behavior to the checkout page, it needs to be added to the confirm page.

also the hidden form element on the confirm page needs to be added with the rest of the hidden form elements down around line 1707

Sign in to reply to this post

mrobben375515

Gotcha, thought I did it right. I made the changes and now I'm getting this error having to due with the new session variable...

Parse error: syntax error, unexpected T_STRING in /home/content/o/n/e/onetooneweb/html/confirm.php on line 19

I've attached the confirm.php page. Thanks again for the quick responses...

Attached Files
confirm.zip
Sign in to reply to this post

Jason ByrnesWebAssist

not sure how you got this code:
if((any form post != "")) {


but it needs to be changed to:
if($_SERVER["REQUEST_METHOD"] == "POST") {

Sign in to reply to this post

mrobben375515

The Local Delivery flat rate option works now, but when I select the UPS option it doesn't calculate the shipping. The UPS shipping rule is set to "if session variable shipType==UPS" and calculation is "based UPS shipping quote value". I've attached the two pages...not sure what to change

Attached Files
checkout.zip
confirm.zip
Sign in to reply to this post

Jason ByrnesWebAssist

try moving this code:
<?php
if (!session_id()) session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION["shipType"] = "".((isset($_POST["shipType"]))?$_POST["shipType"]:"") ."";
}
?>


down the page to be just before the doctype tag. probably a code order issue.

Sign in to reply to this post

mrobben375515

Same thing, local delivery works...UPS doesn't. Any other ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

make sure that shipping is enabled in the Admin panel and that you have selected UPS. The ups shipping look up code is still dependent on what you set in the admin

Also send a copy of the WA_Store_Cart_PHP.php file

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...