close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Custom Calculations

Thread began 11/02/2012 9:27 am by psychobilly1165508 | Last modified 11/06/2012 1:23 pm by Jason Byrnes | 1862 views | 7 replies |

psychobilly1165508

Custom Calculations

Have have this custom calculation for shipping.

totalshipping = abs([Shipableitem] == 1) * ([Price] * [Quantity])

How can I subtract all discounts?

Basically I have Free shipping triggered if totalshipping is over $50.00 dollars.

This does not take into account any discounts.

How can I trigger Free Shipping if over $50.00 after discounts?

Here's my Free Shipping Rule:

//eCart Rule
function WAEC_ssdcart_FreeShipping() {
$totalDiscount = 0;
if (true && (($this->TotalColumn("totalshipping") >= 50.00) && ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "US") && ((isset($_SESSION['eCartCheckoutForm_shipping_type'])?$_SESSION['eCartCheckoutForm_shipping_type']:"") == "ST"))) {
$totalDiscount += $this->GetShipping();//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

your free shipping rule is a discount. subtracting all Discounts would also subtract the free shipping discount. that would go into an endless loop.

Discounts cannot be referenced in the calculation.

how are the other discounts set up?

I need more details on exactly what you want to subtract from the Total Shipping calculation.

Sign in to reply to this post

psychobilly1165508

I have 2 other types of discounts:
Coupons and conditional discounts.

Basically just need to trigger free shipping on the discounted total > $50.00.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

i need more details on how those other discounts are configured

Sign in to reply to this post

psychobilly1165508

I've attached my cart object file. Thanks

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

psychobilly1165508

This post has been deleted.

psychobilly1165508

I going to remove my Free Shipping as a discount and use my flat rate shipping to trigger Free Shipping. This will solve my PayPal issue here: showthread.php?t=29016

So, for Free shipping on the actual Grand Total (After all discounts) I think I need to add another condition.

I tried to add "AND GrandTotal is less then 49.99"

What would the proper syntax be? I tried few variations but no luck..

Thanks

Sign in to reply to this post

psychobilly1165508

How can I check the GrandTotal from the shipping calculation?

Sign in to reply to this post

Jason ByrnesWebAssist

I think you would need to use a custom condition and enter the following code for the condition:
($this->TotalColumn("TotalPrice") - $this->GetDiscounts()) < 49.99

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