close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

cart voucher issues and wrong info sent to paypal..

Thread began 4/17/2012 1:11 pm by Christopher West | Last modified 4/20/2012 11:40 am by Jason Byrnes | 3177 views | 14 replies |

Christopher WestCommunity Expert

cart voucher issues and wrong info sent to paypal..

Hi I have a few concerns with coding a voucher system:

lets say a customer, has a voucher for £20 and the product they are ordering costs £10 - so if they use this voucher on their order then the grand total for the order will be -£10 - So how will that reflect on purchasing through paypal? How can a calcuation be set up in ecart that will deduct the voucher amount BUT not below 0 (so that there are no negative values in the grand total that gets sent to paypal?

....also another issue I had which I cannot remember how it happened...but I think it had something to do with a customer getting free delivery...if they select for free delivery when the order gets posted to paypal, I noticed that paypal creates a made up delivery charge of £2.99 and once it made a delivery charge of £9.99 which is odd as i havent set up any delivery charges for both thoses values (I only set up £7 and 99pence). So how would paypal get £2.99 and £9.99!? very confusing.

lastly, when a voucher has been used...when it gets sent to paypal, the correct grand total is displayed on the paypal page..however the product costs are halved. so its odd that paypal seems to half the product costs. the main point is that the customer is paying the correct "grand total" amount in paypal. it just may confuse them that the products on paypal screen will show as half the cost.

Chris

Sign in to reply to this post

Christopher WestCommunity Expert

after testing last night these issues are becoming a nightmare, as it seems my shopping cart on website is displaying correct info but the data being sent to paypal is being calcuated all wrong (for example on the website is a customer decides to change quantity of the product the cost per item is doubled rather then the total for the quanity of products - sending screenshots of both cart and pay pay for same product to illustrate.

also as I need vouchers, and client doesnt want to list loads of voucher on product page, i tried to put the values of the vouchers into product options - which means i would need to set the main product value to ZERO since it be the product options that store the price - the website displays all correctly BUT paypal wont display since it states the shopping cart is empty (this only happens on the vouchers).

also if I use a voucher code of say £10 on a product that costs £10 that would bring down the grand total to ZERO so paypal wont accept this.

its a nightmare and these issues have only just arisen before deadline :(

please help

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

Christopher WestCommunity Expert

thanks will check my account area :)

Sign in to reply to this post

Christopher WestCommunity Expert

Thank you Jason for all your continued help and support with my projects. Perhaps with regard to PayPal changing slightly their approach to displaying discounts that this could be addressed in a sticky on the forum in case other uses have simular issues with discounts :)

Best regards as always

Chris

Sign in to reply to this post

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

Sign in to reply to this post

Jason ByrnesWebAssist

I'm going to have to look into these issues with you again in a connect session. send me a message when you see that we are both online.

Sign in to reply to this post

Christopher WestCommunity Expert

with my continued problem that I faced in my previous message (I havent tried just yet) but Im thinking because PayPal sees my cart is empty (only if I use a shipping cost in cart) then surely to correct this issue would be to do a calculation to make sure the page([GrandTotal] - [Shipping])

in this line of code:

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

I need to keep doigng further testing but at the moment it all works if I dont provide a shipping cost in the order. So I do understand why it only works that way because even though shipping is added to GrandTotal - paypal still thinks the cart is empty because there are no "product items" with any money value.

am I on the right track with this solution? or do i have it completely wrong and the problem is somehwere else in my code?

Sign in to reply to this post

Christopher WestCommunity Expert

....banging my head agaisnt the wall here...the problem seems to have gone away before I did anything...its ood as last night the problem kept happening on testing (even closing the browser clearing cache etc). but how can it just disappear when I was having the problem last night - its kinda worrying :(

Sign in to reply to this post

Jason ByrnesWebAssist

like i said previously:

I'm going to have to look into these issues with you again in a connect session. send me a message when you see that we are both online.

Sign in to reply to this post
loading

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