close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart with variable delivery charges

Thread began 4/03/2012 12:04 pm by kenbower434352 | Last modified 4/10/2012 8:23 am by Jason Byrnes | 2533 views | 12 replies |

kenbower434352

eCart with variable delivery charges

Hello,

I need to set up my delivery charges on my eCart based on two variables. First, there are different minimum purchase requirements for each of 7 postal zones in order to receive free shipping. Second, there are different shipping charges that are related to each postal zone if the minimum is not met.

I have set up a table as follows:
postalZone
deliveryMinimum
deliveryRate

I have also set up a "select list" on the checkout page for all the available "postalzones". I plan to use this as the trigger telling the shopping cart which delivery charge to use.

I would like the appropriate delivery rate to be added to the confirm page if the minimum order total is not met ("deliveryMinimum" from table).


Can you please show me how to set this up?

Thanks, Ken Bower

Sign in to reply to this post

Jason ByrnesWebAssist

the ecart checkout page already has a foprm element for entering the shipping zip code named "shipping_postcode":

<input type="text" name="shipping_postcode" id="shipping_postcode" value="" />




when you replace this with the select list, make sure to use the same name for the select list.

The selected zip code will be stored in a session variable named:
eCartCheckoutForm_shipping_postcode

create a recordset on the confirm page to look up the selected post code. set the filtering section to filter the postalZone column equal to the Session variable eCartCheckoutForm_shipping_postcode

still on the confirm page, add a set session value server behavior (on the server behaviors panel, click the plus button and select eCart -> General -> Set Session Value). for the trigger and value, click the lightning bolt icon and select the deliveryMinimum column from the recordset. set the name of the session to "deliveryMinimum"

Repeat that step to create another session, this time select the deliveryRate column and name the session "deliveryRate"


now create the shipping change in the eCart object, set the triggers as:
"Session Variable Exists"
Session Variable Name 'deliveryMinimum'

AND
"Session Variable Exists"
Session Variable Name 'deliveryRate'

AND
"Subtotal For the entire Cart Contents"
If the Subtotal price for the cart is '<' a value of '$_SESSION['deliveryRate']'

Calculation:
Flat rate change of '$_SESSION['deliveryRate']'

Sign in to reply to this post

kenbower434352

Hi Jason, thank you so much for helping me out with. I feel like I'm getting close but I'm not getting the expected result but feel I have followed your instructions correctly.

Not sure if this makes a difference but my site is not live. I'm testing this out on my local server using MAMP.

I'm in Canada and our postal codes are in two groups - eg "L5G 3W6". The first group is the zone and the second group is the street location. The first group is what I use as my "postalZone" value. In this case "L5G".

For the purpose of getting this to work I tried using the "Shipping postal code" field exactly as is without any changes and use it to enter the "postalZone" in the text box.

As a test I create a shopping cart with a total less than the "deliverMinimum" for L5G (It shows me Sub-total, Tax and Grand Total but no line for Shipping) and hit "checkout" taking me to the checkout page. I then type "L5G" in the text box for "Shipping postal code" and hit "checkout" taking me to the confirm page. What I expect to see at this point is a "shipping" line to appear adding the "deliveryRate" for L5G.

There is no change that includes the shipping on the order confirmation.

I noticed that one of the instructions you gave for the eCart reads:

AND
"Subtotal For the entire Cart Contents"
If the Subtotal price for the cart is '<' a value of '$_SESSION['deliveryRate']'

Correct me if I'm wrong but shouldn't it be: '$_SESSION['deliveryMinimum']'?

I tried it both ways with the same result. I noticed that the eCart object shows no columns or calculations for Shipping.

I also tried both "store in Session" and "store in Cookie".

Any suggestions?

Thanks again for your help.

Ken

Sign in to reply to this post

Jason ByrnesWebAssist

i'lll need to see a copy of the confirm page to see what is going wrong, it could be that the recordset for the shipping lookup is before the code that sets the eCartCheckoutForm_shipping_postcode session variable.


  Correct me if I'm wrong but shouldn't it be: '$_SESSION['deliveryMinimum']'?  




yes, you are correct.

Sign in to reply to this post

kenbower434352

Yes, the code for the recordset was before the code for the shipping. I moved the code so it is now after:

eCart Set Session Value (eCartCheckoutForm_shipping_postcode)
rsPostalZoneLookup

I've attached the confirm page as requested.

Thanks,

Ken

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

Jason ByrnesWebAssist

the code for setting the deliveryRate and deliveryMinimum session variables also needs to be moved so it comes after the recordset code.

Sign in to reply to this post

kenbower434352

Yes, that did the trick! Thanks so much.

I notice when I click the "Modify Information" on the confirm page, all the previously entered information is erased. Is there a way to keep this information displayed when this button is clicked so that the customer doesn't have to re-enter it again?

Thanks again,

Ken

Sign in to reply to this post

Jason ByrnesWebAssist

on the checkout page, elect each form element, in the property inspector, click the lightning bolt icon next to initial value and select the corresponding session variable.

Sign in to reply to this post

kenbower434352

Ok great Jason. Thanks. I really appreciated your help on this.

Ken

Sign in to reply to this post

kenbower434352

Hi Jason. Thanks again for your help. Although my shopping cart now shows the correct delivery charges, I'm no longer able to go from the "confirm" page to the "checkout_success" page. When I click on the "Submit order" button on the confirm page, the web page goes completely white.

Any ideas? I've attached the confirm page.

Thanks,

Ken

Attached Files
confirm.php.zip
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...