Totally Zenned
- Join Date:
- Apr 2007
- Location:
- Vancouver, Canada
- Posts:
- 1,572
- Plugin Contributions:
- 60
[Done v1.5.0] PayPal Express Checkout Button does not display
In the configuration you have the option to disable showing the PayPal Express Checkout button from displaying.
Turning this to false will cause the button to not display on the shopping cart. However, on the login page it will still show the other text and tell the user to click the button below, which of course is not there at all.
The problem is in includes/modules/login/header_php.php this is no check for whether the button is enabled or not, only the following code:
// Check for PayPal express checkout button suitability:
$paypalec_enabled = (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True');
// Check for express checkout button suitability:
$ec_button_enabled = ($paypalec_enabled && ($_SESSION['cart']->count_contents() > 0 && $_SESSION['cart']->total > 0));
But in includes/modules/payment/paypal/tpl_ec_button.php you have:
$paypalec_enabled = (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True');
$ecs_off = (defined('MODULE_PAYMENT_PAYPALWPP_ECS_BUTTON') && MODULE_PAYMENT_PAYPALWPP_ECS_BUTTON == 'Off');
if ($ecs_off) $paypalec_enabled = FALSE;
By this point the other text has already been added to the document so this check for...```php
(defined('MODULE_PAYMENT_PAYPALWPP_ECS_BUTTON') && MODULE_PAYMENT_PAYPALWPP_ECS_BUTTON == 'Off')
...needs to be in the header_php.php file like this:
```php
$ec_button_enabled = ($paypalec_enabled && (defined('MODULE_PAYMENT_PAYPALWPP_ECS_BUTTON') && MODULE_PAYMENT_PAYPALWPP_ECS_BUTTON == 'Off') && ($_SESSION['cart']->count_contents() > 0 && $_SESSION['cart']->total > 0));
Then those redundant conditions inside tpl_ec_button.php can be removed and only used when loading from the shopping_cart page.