Jump to content
Dom Sudan II

Paypal Error: The link you have used to enter the PayPal system contains an incorrectly formatted it

Recommended Posts

I have installed the Paypal module.  I am getting this error:

 

The link you have used to enter the PayPal system contains an incorrectly formatted item amount.

 

When I go to click the checkout button and expect to be take to the Paypal page.

 

My analysis leaves me to believe that the Paypal module or cart.php code has a bug in it and requires a fix.

 

For every product that has PRICE RULES (aka Discounts) on products, this error is happening.

 

Prestashop version is 1.6.0.11

PayPal USA, Canada v1.3.8

 

Any assistance would be greatly appreciated.

 

 

Share this post


Link to post
Share on other sites

This issue still exist in the just released 1.6.0.13 have bug reports but no one seems to be in a hurry to fix it.

Share this post


Link to post
Share on other sites

This issue occurred for me with % discount in volume pricing.

Changing to fixed discount worked.

I haven't yet tested % coupons to see if it behaves the same way.

 

 

Share this post


Link to post
Share on other sites

I originally posted a solution here but that solution with combined issues with express check out, it creates more problems with the final order status. So I am removing it.

Edited by lecairelinens (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

I have the same issue on PS 1.6.0.14 any leads on this problem ?

Share this post


Link to post
Share on other sites

My shop is in USA. PS 1.6.0.14 clean install, everything working fine. Using default PayPal USA module that came with PS 1.6.0.14. 

 

I allow GBP and EURO in the shop, in addition to USD. I only get this error if the customer transfers to PayPal with GBP or EURO. If the customer transfers to PayPal with USD in the cart, everything is fine. Also, it doesn't matter if the item in the cart is discounted or not. The error on GBP and EURO occurs for all items. The error does not occur for USD on any items.

 

The error must have something to do with the PayPal USA module being designed for USD. Even though a customer in a foreign country (non-USA country) can pay with his own currency after arriving at PayPal, the transfer has to be done in USD. There must be some restriction placed on the transferring currency. 

 

The PayPal Europe module does not place a restriction on the transferring currency. However, an older PayPal Europe module that I used with PS 1.4.11.0 added the state sales tax to the item sub-total, rather than making it a separate line-item. No big deal, but having the tax on a separate line, after the customer arrives at PayPal, was nice.

 

So, either disable GBP and EURO in my shop, and use the PayPal USA module that line-items tax, OR revert to the PayPal Europe module, keep GBP and EURO in the shop, and lose separate line-item for tax after transfer to PayPal.

 

Does anyone know if the PS developers are working on a fix?

Edited by finlanderid (see edit history)

Share this post


Link to post
Share on other sites

In standard.tpl, about line 45, just use Smarty to format the float to two decimal places. Tested and worked flawlessly with USD, GBP and EUR, both to and from paypal.com (including purchase).

Remember to re-compile or else you won't see the effect.

 

Change this:

<input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.price|floatval}" />

To this:

<input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.price|floatval|number_format:2}" />
Edited by finlanderid (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

 

In standard.tpl, about line 45, just use Smarty to format the float to two decimal places. Tested and worked flawlessly with USD, GBP and EUR, both to and from paypal.com (including purchase).

Remember to re-compile or else you won't see the effect.

 

Change this:

<input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.price|floatval}" />

To this:

<input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.price|floatval|number_format:2}" />

Works perfectly thanks for the fix !

  • Like 1

Share this post


Link to post
Share on other sites

change this code In modules/paypalusa/views/templates/hook/standard.tpl,

just use Smarty to format the float to two decimal places. Tested and worked with USD, GBP and EUR.

 

Change this:

<input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.price|floatval}" />

To this:

<input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.price|floatval|number_format:2}" />

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More