I’m checking to see if a check box has been checked on a search form. If that box has been checked, the value it outputs will be “No”.
So if the value is “No”, then I want to use an If statement to echo some PHP. The problem is, the PHP that I want to echo is an actual If statement itself.
Here’s my code right now:
$showoutofstock = $_SESSION['showoutofstock'];
if ( $showoutofstock == "No" ) {
}
if($_product->isSaleable()): {
}
You can’t really “echo some PHP”. PHP is processed on the server-side, and the result is usually HTML that the browser client reads and displays.
It’s not clear what you’re actually trying to accomplish. Can you clarify a bit?
This might help though — it’s simply showing how to nest if statements, which may be all that you’re asking for: