202ecommerce / paypal

This repository is for developpers only. To install and upgrade the module in a production shop please install the package via PrestaShop Marketplace by following this link:
https://addons.prestashop.com/fr/paiement-carte-wallet/1748-paypal-officiel.html
Academic Free License v3.0
20 stars 31 forks source link

PayPal method payment not visible for not logged customers #329

Closed albert28 closed 2 months ago

albert28 commented 4 months ago

Describe the bug and add screenshots

Hi,

In the last version of the module - 6.30 - there's this change:

if (!$this->context->customer->isLogged() && !$this->context->customer->is_guest) { return []; }

image

This hides the Paypal payment method if customers are not logged in. What is the reason for this change? Is it correct?

Expected behavior

No response

Steps to reproduce

Go to checkout page without a logged in customer

PrestaShop version(s) where the bug happened

1.7.8.11

PHP version(s) where the bug happened

No response

joserubicon commented 3 months ago

I also had this issue.

Just try reset the module to logout and login and voilà.

ryoga64 commented 2 months ago

Hi, i have the same issue. can you help? thanks

albert28 commented 2 months ago

Hi, i have the same issue. can you help? thanks

You can delete these lines in paypal.php:


if (!$this->context->customer->isLogged() && !$this->context->customer->is_guest) {
    return [];
}
kgleizes commented 2 months ago

Hi, thank you for your feedback with this issue.

At the last payment step, current customer displaying the checkout page should be : Logged OR Guest

If the customer is not logged so it should be guest.

These lines were added to resolve a conflict between the shortcut on auth page and the payment option itself.

@albert28 : Do you have one module loading payment options (for example one page checkout or thecheckout) ? Did you try it on a fresh prestashop installation ?

At this moment, you could add an override for this hook to bypass this check, if you do not have the shortcut to pay on the auth page too.

This issue is probably linked to a bad context while loading payment option because current customer displaying the checkout page should be logged OR guest (the condition check both of cases).

I cannot reproduce this issue on a fresh install of PrestaShop 1.7.8.11.

So please could you tell us the PHP version, module version you used with PS 1.7.8.11.

Thank you.

albert28 commented 2 months ago

Hi @kgleizes ,

After resetting the module, the problem has been solved for me. No need for my override then. I don't use the checkout modules you have listed.

ryoga64 commented 2 months ago

We use PS 8.1 and "the checkout" module

kgleizes commented 2 months ago

@albert28 , @ryoga64 ,

Thank you for your feedbacks.

Unfortunately, depending configuration, the PayPal's module should not be compatible with the modules changing the behaviour on the checkout (for example the checkout).

One advice i can give to you, if you want to use them, is to keep the configuration of "MODE" to "REDIRECT" instead of "IN CONTEXT" (on our module's configuration).

The redirect mode will use "old" payment options in checkout and should be more compatible.

If you want more, please contact these module's editor to make them compatible with our solution.

Feel free to open this issue again if you have more questions or another case linked to this one.

Thank you.