close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PayPal Error: the total of items in the cart did not match the total of all items

Thread began 4/26/2011 9:26 am by Dave Buchholz | Last modified 4/26/2011 2:05 pm by Jason Byrnes | 893 views | 3 replies |

Dave BuchholzBeta Tester

PayPal Error: the total of items in the cart did not match the total of all items

I have this issue with the cart I am currently completing, the price of each item is made of of several components some of which are flat rate and some of which are a cost multiplied by the qty ordered, the following code is the result of an order which includes an extra which is 20 cents x the qty i.e. $6 which as you can see is the difference between the total of the paymentdetailsitem and itemtotal

<paymentdetails>
<ordertotal currencyid="USD">149.36</ordertotal>
<shippingtotal currencyid="USD">98.36</shippingtotal>
<itemtotal currencyid="USD">51</itemtotal>
<buttonsource>WebAssist.eCartPHP.Pro.DP</buttonsource>
<paymentdetailsitem>
<name>SW-00033</name>
<amount currencyid="USD">1.5</amount>
<quantity>30</quantity>
<number>10033</number>
</paymentdetailsitem>
</paymentdetails>



my question is would I be better passing the line total and hard coding the qty to one in this code block

while ( !$eCart1->EOF() )      {
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Amount" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("Price") ."";
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Name" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("Name") ."";
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Number" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("ID") ."";
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Quantity" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("Quantity") ."";

$eCart1->MoveNext();
$cartIndex ++;
}



or is there a better way to do this, maybe create a new column with a custom calculation to fill it ?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

this depends on how you are managing the price.

Are you setting the item price using a calculation?

Normally, I would create a calculation named realPrice to calculate the price total

then modify the TotalPrice calculation. in the total price calculation, replace:
[Price]

with:
(realPrice calculation code)


then in the code that paces the item price to paypal:

$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("Price") ."";

use the realPrice instead:
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("realPrice") ."";

Sign in to reply to this post

Dave BuchholzBeta Tester

yep I am using a calculation to create the price so I think your suggestion is the way to go

thanks

Sign in to reply to this post

Jason ByrnesWebAssist

You're welcome.

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