Re: Re: Hide price unless Logged in?

Posts: 67
Joined: 08/10/2007

ok, so I used this in my uc_product.module and it works fine (hides the price/add to cart):

function uc_product_nodeapi(&$node, $op, $arg3, $arg4){
  global $user;
  $node->content['display_price']['#access'] = $node->content['display_price']['#access'] && $user->uid;
  $node->content['sell_price']['#access'] = $node->content['sell_price']['#access'] && $user->uid;
  $node->content['add_to_cart']['#access'] = $node->content['add_to_cart']['#access'] && $user->uid;
}

now, how would I edit that code so to add an updated value instead of the display price/sell price/add to cart and display a link to user registration pages instead in order to view the prices/add to cart.

also, would this same process work in uc_catalog.module too, for catalog views too?

Hide price unless Logged in? By: Miso (19 replies) Wed, 09/26/2007 - 20:41