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