Forum Moderators: open
Widgets 5 .99Subtotal 4.95
Dropdown Shipping Choices (1st Class $3, Priority $6, Express $22, etc)
Total ?.?
Ideally a user would select a drop down option, and the total would be updated in place of the ?.?.
Possible? Is this AJAX?
If you have a set array of shipping served up by your PHP, you could get the array before outputting the form and store the values in JS variables or arrays. This would allow you to just use client-side Javascript. It would be a bit complex, as you'd have to store a good deal of values, but it would work.
If you are good at Ajax, you can do the same thing by doing an http request at run time to your database.
But if you're connecting to one of the API's (presuming USPS by your examples) this requires an XML string sent to the API, which returns an XML string that needs to be parsed to get a result. I'm sure there is an Ajax solution for this, but it seems to me the time spent in the request from your page to the API might be just as slow as adding another page.
We use the following method and we have FOUR simple steps. At any point - Add to cart, click cart link, or checkout:
- The first is a summary of the current cart, and below is "Enter your shipping destination" - Country for non-us, or zip code for default, US.
- Then next step you'd skip. We check order for in-stock items and ask them what they want to do (keep entire order until all items come in, ship what's in stock and the rest when they come in at no extra charge, remove out of stock items from order.) A lot of stores don't display out of stock items. We get LOTS of sales for out of stock items (maybe because our description of out of stock is accurate, describing how long it will delay the order.)
- Next we connect with the shipping API for the adjusted order, and present a link to ALL possible shipping with detailed values:
First Class: (if it's light enough) $2.00 (5-7 business days)
Priority: $5.00 (3-5 Business days)
Express: $20 (1-3 Business days)
- The final page is CC, shipping, and billing info. At the upper right is an OPTIONAL login box for returning customers if they want to populate the form.