close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

cart voucher issues and wrong info sent to paypal..

Thread began 4/17/2012 4:11 pm by Christopher West | Last modified 4/20/2012 2:40 pm by Christopher West | 1356 views | 14 replies

Christopher WestCommunity Expert

...spoke to soon....After many variations of testing different products. I found a few problems....

1. PayPal wasnt detecting product option costs so was giving wrong amounts. I did come to a workaround - but not sure if its totally secure until much more testing...Im attaching a screenshot of the work around as after invetigating....

I found that ecart like "TotalPrice ([Price] + [OptionsPrice]) * [Quantity]
But PayPal doesnt like it because it doesnt calculate the OptionsPrice
....However if I changed the above to just [Price] + [OptionsPrice] then PayPal likes it and displays the calculation....but then ecart doesnt like it and doesnt do correct calculation....then I figured to create a new column on ecart object, which you can see from the attached screenshot...I then changed the confirm.php bottom code to:

--------------------------------------------------------------------------------------

<?php //WA eCart Validation
if ((WA_eCart_FormatNumber($DinkyCart->DisplayInfo("TotalPrice") - (($DinkyCart->DisplayInfo("TotalPrice")/$DinkyCart->TotalColumn("TotalOptionPrice")) * $DinkyCart->GetDiscounts()), false, 2) > 0)) {
?>
<input type="hidden" name="amount_<?php echo $DinkyCart_Index+1; ?>" id="amount_<?php echo $DinkyCart_Index+1; ?>" value="<?php echo WA_eCart_FormatNumber($DinkyCart->DisplayInfo("TotalOptionPrice"), false, 2) ?>" />

--------------------------------------------------------------------------------------

Which seems to work (for some reason I had a few problems on my localhost as sometimes it didnt do correct calculations and if i return to my website from paypal without entering any card details the website logs me out automatically which was a bit odd!

I uploaded to my testing hosting and no errors so far...except........if I add a product of £35 to my cart then use a voucher code for £35 and keep shipping of £7 it comes up with cart empty on paypal...if i do same test but do not include £7 shipping then its a success...I can see from the code that the reason is because the IF statement is calculating from GrandTotal (which on the ecart the shipping is part of the grandtotal.

<?php if(isset($_SESSION['PromoAmount']) && $_SESSION['PromoAmount'] != "" && $DinkyCart->GrandTotal() < 0.01) { ?>

...but this is where im stomped. because obviously there is money that a customer would still need to pay (the shipping) but obviously paypal wont let them do that because it sees the cart being empty.

So any thoughts on this?

Was my approach to the workaround i described above with creating a new ecart column the correct approach or will it has consequences on some calculations?

Im sorry im such a pain with the same old questions :-/

Chris

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