close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart crashing when discount added

Thread began 3/15/2016 9:23 am by jlowery | Last modified 3/15/2016 2:02 pm by Ray Borduin | 1037 views | 5 replies |

jlowery

eCart crashing when discount added

I'm getting a consistent crash when adding a discount rule to eCart. I'm running version 5.0.7 on DW CS6. I'm trying to give 15% off the sub-total if one of 3 different items is in the cart.
My steps:
1. Open eCart object.
2. On Discount tab, name discount "Flash Sale" (I also tried "Flash-Sale")
3. For triggers choose when specific item is in cart. Use OR to identify items with ID # 1, 2, and 3.
4. For calculation, choose Apply to subtotal. Make is Minus 15%. (I also tried times .15)
5. Click OK.

The edit dialog disappears and I see the beach-ball for about 30 seconds and then a crash. I'm 3 for 3 now.

What to do? If possible, I'd rather not upgrade to version 6 at this time - just looking for a quick fix to get this up and running for client.

Thanks!

Sign in to reply to this post

Ray BorduinWebAssist

Try adding the rule named "Flash Sale" with simple calculations and triggers... just one line, make it as simple as possible so that hopefully it will apply.

Then manually go into the cart object .php file and update the rule manually using the code I've provided below:

//eCart Rule
function WAEC_eCart1_FlashSale() {
$totalDiscount = 0;
if (true && (($this->InCart("1") == true) || ($this->InCart("2") == true) || ($this->InCart("3") == true))) {
$totalDiscount += ($this->TotalColumn("TotalPrice") * 0.15);//Result
}
return WA_eCart_FormatNumber($totalDiscount, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
Sign in to reply to this post
Did this help? Tips are appreciated...

jlowery

It's crashing just after adding a new discount named "Flash Sale" and accepting the default entries. Can I just add that code block to the eCart object .php file? I've included the current one, just in case there's something hinky there.

Attached Files
muirhead_PHP.php
Sign in to reply to this post

Ray BorduinWebAssist

Yes, you can just add that code, but you would also have to add this on line 79:

$this->Discounts[] = new WA_eCart_Rule(urldecode("Flash%20Sale"), true, "WAEC_eCart1_FlashSale");

Sign in to reply to this post
Did this help? Tips are appreciated...

jlowery

Thanks, Ray - that did it. So, if I upgrade to eCart 6, will I have to redo any of the cart I did in eCart 5?

Sign in to reply to this post

Ray BorduinWebAssist

If you update the cart object you also have to update the cart display... or at least the updatable fields in your cart. I did confirm that I was able to open and edit your cart in eCart 6.

Sign in to reply to this post
Did this help? Tips are appreciated...

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