Heres my code:
$blocks['membership_package_information'] = array( 'info' => "Membership Package Information", 'visibility' => BLOCK_VISIBILITY_PHP, 'pages' => membership_block_visibility(), ); function membership_block_visibility() { if(arg(0) == 'checkout' && arg(2) == null) { return true; } else { return false; } }
I'm trying to limit the block to only show on the first page of the drupal commerce checkout page (checkout/[order-id]) and not the second (checkout/[order-id]/review) but its not working. When I put this code in the PHP visibility section of the block UI page, it works. I'd rather it be in my module, why wont it work? It seems that the UI settings are being picked up and not whats in my block.