Post by m3ndi3 » Tue Jul 26, 2011 7:02 am

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?

Attachments

paypal.png

Paypal inconsistencies - paypal.png (211.52 KiB) Viewed 11985 times


Newbie

Posts

Joined
Thu Jun 16, 2011 5:21 pm

Post by Qphoria » Tue Jul 26, 2011 9:31 am

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

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by m3ndi3 » Fri Jul 29, 2011 6:52 am

Did you find out how to fix this yet??

Newbie

Posts

Joined
Thu Jun 16, 2011 5:21 pm

Post by caleb » Wed Aug 03, 2011 10:55 am

Has there been any update on this? I'm having this same issue.

New member

Posts

Joined
Mon Dec 20, 2010 2:03 am

Post by teratyke » Sun Aug 07, 2011 9:18 pm

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

Attachments

simple mod to pass the cart total only to paypal


Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by caleb » Tue Aug 09, 2011 1:55 am

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.

New member

Posts

Joined
Mon Dec 20, 2010 2:03 am

Post by m3ndi3 » Tue Aug 09, 2011 6:35 am

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

Newbie

Posts

Joined
Thu Jun 16, 2011 5:21 pm

Post by m3ndi3 » Tue Aug 09, 2011 6:59 am

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!

Newbie

Posts

Joined
Thu Jun 16, 2011 5:21 pm

Post by jossoway » Thu Aug 11, 2011 9:35 pm

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!
:(

New member

Posts

Joined
Fri May 27, 2011 4:51 pm

Post by caleb » Thu Aug 11, 2011 10:46 pm

I'm on 1.5.1.1 and it's still happening so no, it's not fixed in 1.5.1.

New member

Posts

Joined
Mon Dec 20, 2010 2:03 am

Post by teratyke » Thu Aug 11, 2011 11:05 pm

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

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by m3ndi3 » Fri Aug 12, 2011 12:11 pm

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!

Newbie

Posts

Joined
Thu Jun 16, 2011 5:21 pm

Post by caleb » Tue Aug 16, 2011 5:21 am

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

New member

Posts

Joined
Mon Dec 20, 2010 2:03 am

Post by terrier » Mon Sep 19, 2011 7:00 pm

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?

New member

Posts

Joined
Wed Aug 31, 2011 7:05 pm

Post by Arvedui » Fri Mar 02, 2012 6:44 am

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)

Newbie

Posts

Joined
Fri Mar 02, 2012 6:40 am

Post by cdamianou » Thu Mar 29, 2012 6:58 pm

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?

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by Qphoria » Thu Mar 29, 2012 10:07 pm

this is likely not compatible with the current version of opencart

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by largooon » Fri Apr 06, 2012 6:27 pm

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

Newbie

Posts

Joined
Fri Apr 06, 2012 6:22 pm

Post by markman-b » Fri Apr 06, 2012 6:37 pm

I suggest we finally get a fix for this shit problem, instead of using tricks and/or a vqmod.

OC version 1.5.4.1


Active Member

Posts

Joined
Wed Aug 24, 2011 7:13 pm

Post by cdamianou » Wed Jun 06, 2012 11:35 pm

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.

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm
Who is online

Users browsing this forum: No registered users and 5 guests