Auspost Regular and Express
I currently have my cart setup to calculate Australia Post Regular, is there a way I can make an option to choose Australia Post Express as well?
you would need to add a select list on the checkout page with the service type options:
<select name="AusPost_ServiceType" id="AusPostService">
and add a hidden form element on the confirm page to capture the selection:
<input name="AusPost_ServiceType" type="hidden" id="AusPost_ServiceType" value="<?php echo((isset($_POST["AusPost_ServiceType"]))?$_POST["AusPost_ServiceType"]:"") ?>">
then on the confirm page, go to the server behaviors panel and click the plus button. Select eCart -> General -> Set Session Value.
set the trigger to any form post.
set the name to AusPost_ServiceType
for the value, click the lightning bolt and select the AusPost_ServiceType element from the form collection.
Now edit the Autralia post lookup server behavior, click the lightning bolt next to service type and select the AusPost_ServiceType session variable.
you're welcome, glad to hear it is working.
Just another question on the same page..
I have a PayPal Express option at the top of the check out page, now if you take the paypal option, it skips the whole postage calculation step, so the customer is charged without the addition of postage & handling..
How can I get around this?
you would need to add the Australia post shipping lookup behavior to the pp_confirm.php page.
when the user selects to use paypal express, they go to the paypal site and set the payment method, then paypal directs them back to your site at the pp_confirm page. you can calculate shipping on this page.
OK, looks like it is already setup this way..
Perhaps I should move the standard/express option back to the shopping cart..
I'll give it a try..
The test I just did timed out on return from paypal, loading pp_confirm.php it just timed out..
Hopefully it's a domain thing, as it is setup to redirect back to the live domain, it should work once it goes live... i hope..
I moved the standard/express option back to the cart instead.. everything was running smoothly so I've gone live with it..
Now on the live site, the shipping quote fails every time (when it didn't before)..
I have it setup to return a default value of $12 shipping on failure of a quote, so it's not a huge problem, but i do still need to get it working..
Why would it be working before and not now?
we would need to see the full request and full response being sent to Australia post.
add the following code to your page to return the full request and full response from Australia post, this should help identify why it is failing:
<?php if(!session_id()) session_start(); ?>
Full Requesst: <?php echo $_SESSION["eCart4_AusPost_FullRequest"]; ?><br />
Full Response: <?php echo $_SESSION["eCart4_AusPost_FullResponse"]; ?><br />
NOTE: you will need to change "eCart4" to the name of your eCart object.
It appears to be working now.
It seems customers so far haven't had any problems with it, except international (which i have set to default to a set amount)..
I think it had something to do with that fact my cart contents were stored in a cookie from a previous day.
I cleared my cookies, then tried again with the code that you posted, and it calculated the postage fine.
It didn't give anything for full request and response.. I put that code on the pp_confirm.php page.. (edit... my bad, i had the eCart object name wrong)
I just ran through an order for an international address and here is the response.
Full Requesst: Pickup_Postcode=5046&Destination_Postcode=90211&Country=US&Service_Type=STANDARD&Weight=45&Length=100&Width=100&Height=100&Quantity=1.0
Full Response: charge=0 days=0 err_msg=Standard Postage Rates not available for areas outside Australia
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.