Flakkak Posted June 19, 2014 Share Posted June 19, 2014 (edited) Hi everyone, As my shop is almost ready to open, I am facing this problem when offering a discount to customers. The checkout cart is all good, but when the customer goes to the Paypal Checkout page to process to the payment, Paypal adds the taxes again. This only occurs when offering a promo-code. When there is no discount, everything is fine and Paypal doesn't charge the tax twice. Prestashop 1.5.4.1 Paypal Usa, Canada v.1.3.4 You can see the screenshots to understand what the problem is or try it yourself on my website with the promo code: www.kayakdetail.com promo code: kdouverture I searched on forum to find a solution to this, but all I found was some code manipulations to problems when Paypal was always doubling taxes, which is not the case here. Thanks a lot for your help !! Edited July 22, 2014 by Flakkak (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted June 19, 2014 Share Posted June 19, 2014 Have you tried the solution documented here? http://www.prestashop.com/forums/topic/288786-solution-paypal-charging-tax-per-line-and-total-tax/?p=1491958 Link to comment Share on other sites More sharing options...
Flakkak Posted June 19, 2014 Author Share Posted June 19, 2014 Yes I have. It solves the Vouchers problem. But with this fix, when there is no CartRule / Vouchers, there is no tax applied on a 'normal' order. Link to comment Share on other sites More sharing options...
Flakkak Posted June 19, 2014 Author Share Posted June 19, 2014 Sorry it wasn't really clear. But no, it doesn't fix the problem as it brings another one. --> No tax at all. Help would be much appreciated. Link to comment Share on other sites More sharing options...
bellini13 Posted June 20, 2014 Share Posted June 20, 2014 looks like the module code has changed since that solution was posted In v1.3.4 of paypalusa, the module does not include taxes in the product prices, so if you remove the tax line then taxes will not be sent to paypal Below are the important code snippets. 1) This is from Prestashop's FrontController, which calculates the "show_taxes" variable used by the smarty template engine. 'PS_TAX' determines if taxes are enabled in your store 'PS_TAX_DISPLAY' determines if taxes are displayed as a separate line item in the cart For your store, both are configured to true so 'show_taxes' will evaluate to true. This is used by the paypalusa module. 'show_taxes' => (int)(Configuration::get('PS_TAX_DISPLAY') == 1 && (int)Configuration::get('PS_TAX')), 2) The if statement determines what information is sent to paypal, if there are 'vouchers' or 'no vouchers'. If there are no vouchers, then the module sends each product in the cart as an "item". Since the module no longer uses "_wt" in the "amount" field, this means that taxes are not being included in the product price. This is good because you have taxes to be displayed as a separate line item. 3) If there are discounts, then the module ignores all the products and sends a single "item" which represents the total cart amount. This amount will include taxes because for your store "show_taxes" will be true. 4) Shipping will always include taxes because they are using true when calculating the shipping cost. {if $paypal_usa_total_discounts == 0} {foreach from=$cart->getProducts() item=paypal_usa_product name="paypal_usa_products"} <input type="hidden" name="item_name_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.name|escape:'htmlall':'UTF-8'}" /> <input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.price|floatval}" /> <input type="hidden" name="quantity_{$smarty.foreach.paypal_usa_products.index+1|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_product.quantity|intval}" /> {/foreach} {assign var="paypal_usa_total_shipping" value=$cart->getOrderTotal(true, Cart::ONLY_SHIPPING)} {if $paypal_usa_total_shipping} <input type="hidden" name="item_name_{$smarty.foreach.paypal_usa_products.index+2|escape:'htmlall':'UTF-8'}" value="{l s='Shipping' mod='paypalusa'}" /> <input type="hidden" name="amount_{$smarty.foreach.paypal_usa_products.index+2|escape:'htmlall':'UTF-8'}" value="{$paypal_usa_total_shipping|floatval}" /> <input type="hidden" name="quantity_{$smarty.foreach.paypal_usa_products.index+2|escape:'htmlall':'UTF-8'}" value="1"> {/if} {else} <input type="hidden" name="item_name_1" value="{l s="Your order" mod="paypalusa"}" /> <input type="hidden" name="amount_1" value="{$cart->getOrderTotal(!$show_taxes)|floatval}" /> {/if} 5) This is the tax line, it is always sent separately regardless of there being vouchers. <input type="hidden" name="tax_cart" value="{$paypal_usa_total_tax|floatval}" /> So to summarize, 1) taxes are always being sent separately to paypal. 2) taxes are no longer being sent within the product prices 3) taxes will be sent twice to paypal, only if there are vouchers and 'show_taxes' are true for you store. 4) shipping will always include taxes Possible solution: So what I might suggest you do is change the ELSE block code so that when a voucher exists, the order total ignores your 'show_taxes' variable and instead always excludes taxes. This is because the module always sends taxes separately, why bother looking show_taxes. Change !$show_taxes to false. (this should be line 56 of standard.tpl) <input type="hidden" name="amount_1" value="{$cart->getOrderTotal(false)|floatval}" /> Link to comment Share on other sites More sharing options...
Flakkak Posted June 27, 2014 Author Share Posted June 27, 2014 Thanks for the answer. I was away for a few days and will try that as soon as I get home ! Link to comment Share on other sites More sharing options...
Flakkak Posted July 22, 2014 Author Share Posted July 22, 2014 Thanks for the help. The problem was solved by enabling «Display Taxes in shopping Cart» under Localisation/Taxes 1 Link to comment Share on other sites More sharing options...
J.Sahu Posted September 15, 2014 Share Posted September 15, 2014 Thanks KD it worked. Link to comment Share on other sites More sharing options...
abdulk Posted September 28, 2014 Share Posted September 28, 2014 (edited) I was having this exact same problem. However, it seemed that random PP orders were not being created in PS, although the PP transactions were coming through. The first thing I confirmed is that the PP IPNs were coming through and my access_log confirmed they were. Next, hours of comparing PP payments that worked (PS order created) vs those that did not (PS order NOT created) revealed that I only had issues with PP transactions that included sales tax AND had a voucher/cart rule applied. I was also able to recreate the issue after this discovery (previously I could not). Flakkak, your solution to enable "Display Taxes in shopping Cart" did the trick! I've been struggling with this issue ever since bellini13 helped me with my previous PP issue. Thanks to both of you! Someone should report this as a bug, no? Edited September 28, 2014 by abdulk (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted September 28, 2014 Share Posted September 28, 2014 I believe I did about a month ago, Prestashop has just not accepted the change and released a new version of the module. 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