close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Change in Shipping Charge

Thread began 1/02/2012 3:49 pm by James L | Last modified 1/11/2012 12:52 pm by James L | 963 views | 8 replies |

James L

Change in Shipping Charge

My client's site has been functioning fine for almost a year using U.S. Postal Service lookup for calculating shipping, however he now wants to change it so that 1 or 2 items still use the USPS calculation, but if they buy 3 items the shipping is free (i.e. 0). I can't seem to figure out how to do this.
I tried the following code, but it doesn't work:

//eCart Rule
function WAEC_new_ProRes_USPSShipping() {
$totalShipping = 0;
if (true && (("USPS"=="USPS")&&(isset($_SESSION["new_ProRes_USPS_Quote"]))&&(floatval($_SESSION["new_ProRes_USPS_Quote"]) != 0) || (sizeof($this->Items) == 3))) {
$totalShipping += 0;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Please help me fix this code.
Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

dont edit the code, use the eCart object editor to modify the shipping rule.

open the confirm page or any other page that has eCart applied to it, then open the server behaviors panel (Window -> Server behaviors).

in the list of server behaviors, double click the eCart object server behavior.

in the eCart object editor, go to the shipping tab and edit the USPS Shipping rule.


add a new trigger to the rule:
"Subtotal For Any Column"
If the subtotal of column "Quantity" is "<=" a value of "2"

Sign in to reply to this post

James L

Change in shipping charge

Thanks for the answer but it seems truncated. This starts with "IF" therefore shouldn't there be something that goes after: "If the subtotal of column "Quantity" is "<=" a value of "2" "?

Sign in to reply to this post

Jason ByrnesWebAssist

In the eCart Shipping rules, the trigger section is the if statement.

the calculation section defines the rule that will be applied if the trigger condition is met.


you already have the calculation in place, your question was basically how to change the conditions that need to be met for the calculation to be applied. you do this by adding the additional trigger.

Sign in to reply to this post

James L

I can't seem to make this work

Help! I tried to apply this to the site but something is so screwed up now I had to shut down the cart function (client not happy).
I've attached a screen cap of the e-cart shipping rule I used, and also a screen cap of the error message.

What I'm trying to do is for a quantity of 1 or 2, shipping charge comes from the USPS lookup, but for a quantity of 3 there is to be no shipping charge.

Sign in to reply to this post

Jason ByrnesWebAssist

instead of adding the new trigger, you replaced the old trigger with the new one.

you need to have 2 triggers:

Based on USPS Shipping quote value > 0

AND
Subtotal of Column quantity <= 2

Sign in to reply to this post

James L

still have errors

i'm still getting the errors for quantities 1 & 2, but not for 3.
I've attached 2 screen caps one for each setting. Please tell me what I'm doing wrong.

Sign in to reply to this post

Jason ByrnesWebAssist

you are not using the correct triggers.

your triggers are:
Subtotal of Column quantity > 0

AND
Subtotal of Column quantity <= 2



you need to use the triggers:
Based on USPS Shipping quote value > 0

AND
Subtotal of Column quantity <= 2



the first trigger needs to be:
Based on USPS Shipping quote value > 0

not:
Subtotal of Column quantity > 0

Sign in to reply to this post

James L

Yeaaaa! It works!

Finally! Thank you so much for your help.

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