close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

add new shipping rule for overnight

Thread began 6/29/2010 11:54 am by watercolor346374 | Last modified 7/12/2010 10:31 am by Jason Byrnes | 776 views | 3 replies |

watercolor346374

add new shipping rule for overnight

I have already set up my shipping rules for parcel post shipping to the US and outside US. Now the client wants to add overnight. Not sure how to proceed with this using ecart. I added a check box on the check out form for overnight in US only it is named:<input type="checkbox" name="next_day_ship" id="next_day_ship" />
What are the next steps in the confirm.php that I need to implement so if the box is checked overnight shipping overrides my other rules for the US. In my shipping rules I am using the session variable: $_SESSION["eCartCheckoutForm_country"]
the overnight shipping will be a flat rate of 20.00
Thank you,
K

Sign in to reply to this post

Jason ByrnesWebAssist

the checkbox needs to have a checked value:

php:
<input type="checkbox" name="next_day_ship" id="next_day_ship" value="1" />



on the confirm page, add a hidden form element that has same name to capture the value posted from the checkout page:

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



also on the confirm page, near the top is a collection of code groups to set session variables to capture the form information form the checkout page, add a new one for next day shipping:

php:
<?php

if (!session_id()) session_start();
if(
$_SERVER["REQUEST_METHOD"] == "POST")     {
  
$_SESSION["next_day_ship"] = "".((isset($_POST["next_day_ship"]))?$_POST["next_day_ship"]:"")  ."";
}
?>




In your existing shipping rules, add a new trigger:
Based on Session Variable Value
if the session variable 'next_day_ship' is '!=' a value of '1'

for the next day shipping rule, use the trigger:
Based on Session Variable Value
if the session variable 'next_day_ship' is '=' a value of '1'

Sign in to reply to this post

watercolor346374

overnight shipping rule was working now it is not

Hi,
Everything was working perfectly, nothing was changed and now the next day shipping does not show up. I have checked and rechecked the shipping rules and the scripts. when I check the box on the checkout.php page to engage the next day shipping rule, no shipping shows up on the confirm page. The regular shipping shows up if the box is not checked and that is how it should be. I have included my files. Also have the site live in a test folder. On the live site there are some gliches with header messages and I have submitted on those. If you type checkout.php in the browser while in the cart you can see what I mean.
Thank you,
K

Attached Files
overnight shippin.zip
Sign in to reply to this post

Jason ByrnesWebAssist

when creating the Bassed on session session variable value trigger for the rule, you added an extra space in the name of the session variable.


The code of the trigger is:
if (true && (((isset($_SESSION[' next_day_ship'])?$_SESSION[' next_day_ship']:"") == "1"))) {

it should be:
if (true && (((isset($_SESSION['next_day_ship'])?$_SESSION['next_day_ship']:"") == "1"))) {


see the following page for information on the cause and fixing the headers already sent error:
148/

Sign in to reply to this post

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