Page 1 of 2

Paypal Standard Total Incorrect

Posted: Tue Jul 26, 2011 7:02 am
by m3ndi3
For some reason, the order totals are sometimes not being translated to the Paypal Totals. Sometimes the shipping and discounts will be applied, but more often then not, Paypal will only calculate the price of the Sub-Total. I feel something is going on when paypal is being called... Somewhere in the code, the order totals for discount, shipping, etc. are being ignored. Please help!!

*After more playing around with why it would work only sometimes, I found that if the discount/reward point is greater than the shipping (in paypal the part that would say "shipping, handling, discounts &tax would become a negative), then paypal will ignore it and not insert it into the totals. Meaning that paypal will not include a negative to its totals. Is there a way to change this?? Can it be simplified in only allowing the Total of the cart to be transferred and ignore the items (does not need to put individual items onto paypal summary). Or can I simply allow paypal to include negative values?

Re: Paypal Standard Total Incorrect

Posted: Tue Jul 26, 2011 9:31 am
by Qphoria
I will look into this.. something seems to have changed with the calculations in 1.5.x and when you try to pass discount values that aren't correct, instead of throwing an error, paypal just ignores them because they are a terrible company with a terrible gateway... but I digress

Re: Paypal Standard Total Incorrect

Posted: Fri Jul 29, 2011 6:52 am
by m3ndi3
Did you find out how to fix this yet??

Re: Paypal Standard Total Incorrect

Posted: Wed Aug 03, 2011 10:55 am
by caleb
Has there been any update on this? I'm having this same issue.

Re: Paypal Standard Total Incorrect

Posted: Sun Aug 07, 2011 9:18 pm
by teratyke
Hi
I've been having problems with PayPal too, I'm not sure if this is the same problem as you are posting in this thread.
I've decided that as a temporary work around (and this could be a terrible idea), to pass the cart total to PayPal as one item rather than passing each separate item/discount. Definitely a backwards step, but preferable to passing the wrong total to PayPal.

I wrote a vqmod that comments out the code that generates each line/item and instead gets the cart total - this is passed to paypal with the store name as the item description and the quantity as 1.

This is for the default template and opencart version 1.5.1.1.

I'm not using this in a production environment yet, and I'm not totally confident I've done this the best way, however if anyone could take a look and let me know if there are any major problems that would be great.

Until a fix/better solution is found I see this as the best way forwards..
Apologies if this isn't relevant to this thread.

Thanks
Rob

Re: Paypal Standard Total Incorrect

Posted: Tue Aug 09, 2011 1:55 am
by caleb
According to the Open Cart powers that be, this isn't a problem ::)

http://code.google.com/p/opencart/issue ... &start=400

Thanks for posting your temporary fix, atleast this allows me to continue to use Open Cart. I was forced to switch back to a working cart system (Magento) for a few days once this was discovered by one of my customers.

Re: Paypal Standard Total Incorrect

Posted: Tue Aug 09, 2011 6:35 am
by m3ndi3
teratyke wrote:Hi
I've been having problems with PayPal too, I'm not sure if this is the same problem as you are posting in this thread.
I've decided that as a temporary work around (and this could be a terrible idea), to pass the cart total to PayPal as one item rather than passing each separate item/discount. Definitely a backwards step, but preferable to passing the wrong total to PayPal.

I wrote a vqmod that comments out the code that generates each line/item and instead gets the cart total - this is passed to paypal with the store name as the item description and the quantity as 1.

This is for the default template and opencart version 1.5.1.1.

I'm not using this in a production environment yet, and I'm not totally confident I've done this the best way, however if anyone could take a look and let me know if there are any major problems that would be great.

Until a fix/better solution is found I see this as the best way forwards..
Apologies if this isn't relevant to this thread.

Thanks
Rob
Thanks for this post! I'll try this temporary fix right away and tell how it goes...

Re: Paypal Standard Total Incorrect

Posted: Tue Aug 09, 2011 6:59 am
by m3ndi3
OMG!!! IT WORKS!!! kjadkfjaklejrq THANK YOU SOOO MUCH teratyke!!! I really don't need the items and specifics to show on the paypal side, just the total, and that's exactly what it does! Yay!

Re: Paypal Standard Total Incorrect

Posted: Thu Aug 11, 2011 9:35 pm
by jossoway
Hi - I have just posted about what I think is the same issue here: http://forum.opencart.com/viewtopic.php?f=20&t=38307

Is there a fix for this? I read that the minus amounts thing being passed to PayPal had been fixed in version 1.5.1
http://www.opencart.com/index.php?route ... blog_id=30

I don't know how to implement that vqmod xml thing and am not sure if it will work if you pass zero to PayPal. Can anyone explain to me how to use it and if it will work with 1.5.1?

I have a client website going live in a week and have just discovered this problem. It only occurs if the total passed to PayPal is zero (i.e. the client is paying with a gift voucher that completely covers the cost of the purchase).

Help!
:(

Re: Paypal Standard Total Incorrect

Posted: Thu Aug 11, 2011 10:46 pm
by caleb
I'm on 1.5.1.1 and it's still happening so no, it's not fixed in 1.5.1.

Re: Paypal Standard Total Incorrect

Posted: Thu Aug 11, 2011 11:05 pm
by teratyke
I have a client website going live in a week and have just discovered this problem. It only occurs if the total passed to PayPal is zero (i.e. the client is paying with a gift voucher that completely covers the cost of the purchase).
Should you be going to paypal if the order total is 0? Do you have free checkout enabled?

edit: Working with Opencart will be difficult without vqmod - its a free add-on to opencart just search for it in the forum. I think most on here would recommend its use.

edit: several new threads on this subject - this probably isn't the best place to continue..

Re: Paypal Standard Total Incorrect

Posted: Fri Aug 12, 2011 12:11 pm
by m3ndi3
jossoway wrote:Hi - I have just posted about what I think is the same issue here: http://forum.opencart.com/viewtopic.php?f=20&t=38307

Is there a fix for this? I read that the minus amounts thing being passed to PayPal had been fixed in version 1.5.1
http://www.opencart.com/index.php?route ... blog_id=30

I don't know how to implement that vqmod xml thing and am not sure if it will work if you pass zero to PayPal. Can anyone explain to me how to use it and if it will work with 1.5.1?

I have a client website going live in a week and have just discovered this problem. It only occurs if the total passed to PayPal is zero (i.e. the client is paying with a gift voucher that completely covers the cost of the purchase).

Help!
:(
Hey jossoway, I don't know how to work vqmod either, but I just opened the xml file and looked where to physically make the changes... Lemme go through with you step by step.. it's really easy! (Be sure you have access to these files directly!!)

First go to this file:
catalog/controller/payment/pp_standard.php

find:

Code: Select all

$this->data['products'] = array();
and add

Code: Select all

/*

before it.
next find:

Code: Select all

$this->data['currency_code'] = $currency;
and add

Code: Select all

*/
$this->data['storename'] = $this->config->get('config_name');
$this->data['ppAmount'] = $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false);
before it.

next go to this file:
catalog/view/theme/default/template/payment/pp_standard.tpl
(replace "default" with whatever theme you are using)
find:

Code: Select all

<?php $i = 1; ?>
and add

Code: Select all

<!--
before it.
Lastly, find:

Code: Select all

<input type="hidden" name="currency_code" value="<?php echo $currency_code; ?>" />
and add

Code: Select all

-->
  <input type="hidden" name="item_name_1" value="<?php echo $storename; ?>" />
  <input type="hidden" name="amount_1" value="<?php echo $ppAmount; ?>" />
  <input type="hidden" name="quantity_1" value="1" />
before it.

SAVE and FTP (if needed) both files! And it's fixed :) Thanks again to teratyke for the fix!

Re: Paypal Standard Total Incorrect

Posted: Tue Aug 16, 2011 5:21 am
by caleb
FWIW guys, I'd take the 5 minutes it takes and learn how to use vqmod. Otherwise when you go to upgrade, you are going to loose all of your modifications...probably breaking your store (I speak from personal experience here :) ).

Re: Paypal Standard Total Incorrect

Posted: Mon Sep 19, 2011 7:00 pm
by terrier
weird.. im using oc1.5.1.1

i loaded the xml file and tried paying by paypal. I got SyntaxError: Unexpected token <

anyone know this?

Re: Paypal Standard Total Incorrect

Posted: Fri Mar 02, 2012 6:44 am
by Arvedui
could anybody please translate the jossoway fix to 1.4.9 version...

im just a beginner and the pp_standard.php file for 1.4.9 seems to have some serious differences respect to that of 1.5.1
thanks in advance! :)


edit -> i did it by myself ^^

in case you are in my same case, i did it this way:

open catalog controller payment pp_standard.php

put /* before #get itemized product total
and */ before #finish the rest of the form

just after the */ add
$this->data['fields']['item_name_1'] = $this->config->get('config_name');
$this->data['fields']['amount_1'] = $this->currency->format($total, $currency, false, false);
$this->data['fields']['quantity_1'] = 1;
$this->data['fields']['shipping_1'] = '0.00';
$this->data['fields']['tax_cart'] = '0.00';
$this->data['fields']['handling_1'] = '0.00';
$this->data['fields']['handling_cart'] = '0.00';


no need to change the tpl file


that way you only send 1 item to paypal, whose total price includes the shipping, taxes, discounts, handlings and everything else
paypal wont need to calculate anything, and thus you wont experience problems with discounts or wrong calculated handling fees

on the other hand, you lose the items list in paypal :/

anyways, maybe it is not the most elegant way to solve my problem, but a working one
not bad for a beginner, isnt it ;)
greets!

(notice i'm using new_pp_standard_1494.2 and it may vary respect to the 1.4.9 "old" implementation)

Re: Paypal Standard Total Incorrect

Posted: Thu Mar 29, 2012 6:58 pm
by cdamianou
Hi

I tried this VQMOD but when we get to paypal is brings up a message saying

Error Detected

Your shopping cart is empty.

Any Ideas?

Re: Paypal Standard Total Incorrect

Posted: Thu Mar 29, 2012 10:07 pm
by Qphoria
this is likely not compatible with the current version of opencart

Re: Paypal Standard Total Incorrect

Posted: Fri Apr 06, 2012 6:27 pm
by largooon
Hi Guys,

Does anyone know how to implement this solution (sending total only to PayPal) in Open Cart 1.5.2.1 R990? I would appreciate your help on this matter.

Thank you in advance

Re: Paypal Standard Total Incorrect

Posted: Fri Apr 06, 2012 6:37 pm
by markman-b
I suggest we finally get a fix for this shit problem, instead of using tricks and/or a vqmod.

Re: Paypal Standard Total Incorrect

Posted: Wed Jun 06, 2012 11:35 pm
by cdamianou
Any solution. This is frustrating as we cannot give out discount codes etc due to them not being redeemed during checkout. Your help is much appreciated.