Hi there,
I have come across a curious coding issue which may just be curious to me... but I wondered if any\one has come across it and could shed any light.
Ok here goes.... the code below
works as expected and stops the code running on checkout_shipping.php, checkout_payment.php and checkout_confirmation.php
function isEnabled() {
global $PHP_SELF;
if (($PHP_SELF == 'checkout_shipping.php')|| ($PHP_SELF == 'checkout_payment.php') || ($PHP_SELF == 'checkout_confirmation.php')) {
$this->enabled = false;
}
return $this->enabled;
}
Then i tried the code below to allow the code to run on checkout_shipping.php, checkout_payment.php and checkout_confirmation.php but no where else
however it does not work and the code runs nowhere.
function isEnabled() {
global $PHP_SELF;
if (($PHP_SELF != 'checkout_shipping.php')|| ($PHP_SELF != 'checkout_payment.php') || ($PHP_SELF != 'checkout_confirmation.php')) {
$this->enabled = false;
}
return $this->enabled;
}
then I tried this (see below and it works perfectly. Only allowing the code to run on checkout_shipping.php, checkout_payment.php and checkout_confirmation.php
function isEnabled() {
global $PHP_SELF;
if (($PHP_SELF != 'checkout_shipping.php')&& ($PHP_SELF != 'checkout_payment.php') && ($PHP_SELF != 'checkout_confirmation.php')) {
$this->enabled = false;
}
return $this->enabled;
}
I thought that if I added && then all the conditions had to be correct at the same time?
Why does the || not work?
Any light that can be shed would be appreciated