tdr170 Posted January 31, 2015 Share Posted January 31, 2015 (edited) As you can see from the code below I am getting 4 decimal places showing in the item amount which leads to PayPal error. Price shows correct in back office, blockcart and shopping cart. The link you have used to enter the PayPal system contains an incorrectly formatted item amount. This is the code from Chrome inspector as you can see the item amount shows 4 decimal places while the total does not. I don't really think this is a PayPal issue as I tried with 1.3.3 and 1.3.8 with same result. Anyone else seen or heard of this issue. (removed sensitive info) <p class="payment_module"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="charset" value="utf8"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="custom" value="854;1"> <input type="hidden" name="amount" value="488.95"> <input type="hidden" name="address_override" value="1"> <input type="hidden" name="item_name_1" value="Velox V10 "Pro" 2014"> <input type="hidden" name="amount_1" value="450.0045"> <input type="hidden" name="quantity_1" value="1"> <input type="hidden" name="item_name_2" value="Shipping"> <input type="hidden" name="amount_2" value="11.95"> <input type="hidden" name="quantity_2" value="1"> <input type="hidden" name="tax_cart" value="27"> Edited January 31, 2015 by tdr170 (see edit history) Link to comment Share on other sites More sharing options...
tdr170 Posted January 31, 2015 Author Share Posted January 31, 2015 Found the issue it is the classes/cart.php file changed to version from 1.6.0.9 and the amount is correct however now the order goes through to PayPal, log in, make payment but when you return to site items are still in cart. The order does show in my PayPal account but not in the back office, so I can not use 1.6 as none of the Payment modules work what the Hell. Link to comment Share on other sites More sharing options...
El Patron Posted January 31, 2015 Share Posted January 31, 2015 just a guess here, in back office preferences, (new rounding methods applied) there is setting for number of decimal places, maybe something there like '4'. Link to comment Share on other sites More sharing options...
tdr170 Posted February 2, 2015 Author Share Posted February 2, 2015 Nope I had checked that and was set correctly, the only way I have been able to fix is to change the cart php file. Still not able to use as the order is placed but not recorded in BO. 1 Link to comment Share on other sites More sharing options...
finlanderid Posted April 8, 2015 Share Posted April 8, 2015 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}" /> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now