Thursday, March 08, 2012

Hide products in stock for unregistered users

To hide the product availability information on the flypage from non-registered customers, make a copy of, then edit your flypage, typically this file:
     components/com_virtuemart/themes/your_theme_name/templates/product_details/flypage.tpl.php

Find this code:
Code: [Select]
if( $this->get_cfg( 'showAvailability' )) {
 echo $product_availability; 
}
and change the first line so it looks like this:
Code: [Select]
if( $this->get_cfg( 'showAvailability' ) && $auth['is_registered_customer'] == 1 ) {
 echo $product_availability; 
}

Save and test.

No comments: