Jump to content

New PayPal Express Checkout button from official module not working


gartenflix

Recommended Posts

To whom it may concern,
 
recently the Prestashop PayPal module was updated to Version 4.2.1. which comes with an integrated PayPal Express Checkout Shortcut toggle
button that allows to place an Express Checkout button on any product site. 
 
It is a great feature that was added but unfortunately this button is not working on my website.
When you click on the Express Checkout button "Zahlen mit PayPal" nothing is happening.
According to the theme developer it is a bug of the module and not of the theme itself.
 
For that reason I would appreciate if you could let me know if you make the same experiences or it is related to my site.
Any hints that could help to resolve the problem are greatly appreciated.
The standard checkout over the basket is working well. 
 
I am using this module in combination with Prestashop 1.7.2.4
that runs on a PHP 7.0 Linux server.
Further details of my server you'll find here: https://gartenflix.de/test_2.php
 
Best regards
 
Andreas
Link to comment
Share on other sites

At the end good to know that others have the same problem.
So I assume the issue is coming from the module itself.
 
In my installation with the warehouse theme the Shortcut toggle button is working well.
The button is displayed on my website but with no functionality.
Unfortunately I have not found so long any solution to fix the problem.
 
I contacted the PayPal support but they say they are not he developer of this module
why they don't take over any responsibility in bugfixing the module.
Link to comment
Share on other sites

I found out meanwhile that for some reason I don't know the input fields are not wrapped by the form element as showed in the EC_shortcut.tpl
 

<form id="paypal_payment_form_cart" class="paypal_payment_form" action="{$action_url|escape:'htmlall':'UTF-8'}" title="{l s='Pay with PayPal' mod='paypal'}" method="post" data-ajax="false">

</form>


The element is left out.

For that reason the $('#paypal_payment_form_cart').submit() of ec_shortcut.js cannot work.
Has anybody any idea to resolve it.

Link to comment
Share on other sites

@ gartenflix - It's not a bug of the theme, neither the module. The checkout from product site is not allowed in Germany. You need to checkout from a cart summary site before. This is German law. Disable express checkout if the button does not redirect before to your cart.

For the others writing here, they should check their laws in country of use. The Express Checkout is not possible/allowed by laws in all countries of the world.

Link to comment
Share on other sites

From what I can see on the source of gartenflix.de the template called by this button should be: /modules/paypal/views/templates/hook/EC_shortcut.tpl.

On older paypal module it was order_confirmation.tpl.

Perhaps the template EC_shortcut.tpl is not available on new paypal module. I cannot test, cause I have the older version installed.

I would say: disable the express checkout and add the problem to the debug tracker on forge: http://forge.prestashop.com/

Link to comment
Share on other sites

@selectshop.at   This was one of my first considerartions what I thought, too. When looking to the code I have so long not seen a country restriction related to my issue. I believe most programmers would disable the toggle button for the shortcut and not display it in the frontend if they implement a country restriction.

A bit strange to me seems also that EC_shortcut.tpl is there and loaded with all input elements but solely the form-element is not loaded.
Strange or isn't it?
This is the from the EC_shortcut.tpl. When you compare it with my image you see the form element missing
<div id="container_express_checkout" style="float:right; margin: 10px 40px 0 0">
    <form id="paypal_payment_form_cart" class="paypal_payment_form" action="{$action_url|escape:'htmlall':'UTF-8'}" title="{l s='Pay with PayPal' mod='paypal'}" method="post" data-ajax="false">
        <input type="hidden" name="id_product" value="{$smarty.get.id_product|intval}" />
        <input type="hidden" name="quantity" id="paypal_quantity" value=""/>
        <input type="hidden" name="combination" value="" id="paypal_combination"/>
        <input type="hidden" name="express_checkout" value="{$PayPal_payment_type|escape:'htmlall':'UTF-8'}"/>
        <input type="hidden" name="current_shop_url" id="paypal_url_page" value="" />
        <input type="hidden" name="bn" value="{$PayPal_tracking_code|escape:'htmlall':'UTF-8'}" />
        <input type="hidden" id="in_context_checkout_enabled" value="0">
        <img id="payment_paypal_express_checkout" src="{$PayPal_img_esc|escape:'htmlall':'UTF-8'}" alt="{l s='PayPal' mod='paypal'}" style="cursor:pointer;" onclick="setInput();return false"/>
    </form>
</div>
form_element_missing.PNG.d056f6fd56c3e042f25f7d5ab9b3d0b2.PNG


I am aware that in Germany the laws are different than in other countries but thought.
with a few additional lines of jQuery I can make it conform to the German laws.
Therefore I first need to solve my Problem.
Link to comment
Share on other sites

The country restriction comes from the API and not the module. Nevertheless Express Checkout for Germany is already implemented on Paypal itself. So it is available for Germany as well. BUT this is not the point of the problem. The problem is the checkout process coded for Germany on the module in use. On older paypal module versions there were different templates available, controlled in the code of the module. From what I can see on source on your page, there is only one template. This does not fit for Germany, you have to extend. This is of course a case for the debug tracker. It does not help that you adapt the code for you. There are several other users needing this. Not only German users. Some other few countries (but this paypal developers already know) are affected by this more steps checkout.

The only thing what I can presume, is that as for the past the EC was not available for Germany, so the developers of the module didn't pay attention on this and it is not finished.

Link to comment
Share on other sites

 Okay, thank you for your advice. I understood it's better to report it officially as a bug as this helps all others with the same issue.
I thought I cannot do it as you can read in the instruction before you post a bug, only bugs with the default template will be considered.

 

Link to comment
Share on other sites

Bug issue could be resolved. I once again looked with the theme develooper over the product.tpl.
Although we were firstly convinced it is an module bug we found now out it had to do how the block 'hook_display_reassurance' was positioned.

The left side shows the updated product.tpl with the block 'hook_display_reassurance' now outside positioned of the

<form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh">

...

</form>.

Paypal express checkout solved.PNG

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
On 30/12/2017 at 7:28 PM, mazat dice:

gartenflix thank you! it works great on product page,

but do you have any idea how to show PayPall Express Checkout button also in shopping cart?

Hallo, me too have the same problem:

- on product page the button £pay with paypal" works.

- on cart page, doesn't work. 

I tryed to modify some templates, but nothing works :-(

Every body can help me?

Thank you.

Link to comment
Share on other sites

  • 3 weeks later...
On 27/12/2017 at 3:04 AM, cool cellphone case said:

 

make sure it is hooked to displayreainsurance hook then it will works, you can have a look at my site  http://www.devicessmart.com/

 

 

Hi,

 

I`m running prestashop version 1.7.2.4 - where is the "displayreainsurance" hook you mention?  I cant seem to find it.

 

Many thanks in advance.

 

Iain

Link to comment
Share on other sites

  • 2 months later...

i'm also having a problem with this. The paypal module is hooked to displayReassurance. i'm using version 1.7.3.0 and paypal module 4.3.2. Like @mazat the button only works on the product page. But it doesn't show up in cart.

 

EDIT: i just checked my product.tpl and the {hook h='displayReassurance'} is already outside the Form. so it shows up on the product page without a problem.

On the cart page the reassurance block shows up, but the paypal button does not. i will try to change the default Country in the options to see if it make a difference.

Edited by patuga (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...