Okay, Phillipe has engaged me to provide this solution, Thanks.
This is how you can hide prices to anyone that is not a member.
First of all you need to make this modification in your custom module. Here is my tutorial on doing so if you have not done so already:
http://kb.x-cart.com/display/XDD/Creating+a+module+for+X-Cart+5%3A+Tutorial+by+Mike+White
The you need to decorate the class Alex referenced above:
classes/XLite/Controller/AController.php
This is demonstrated well here:
http://kb.x-cart.com/display/XDD/Step+3+-+applying+logic+changes
Inside your new decorator class place this method:
Code:
/**
* Check if current user is a member
*
* @return boolean
*/
public function isMember()
{
$isMember = false;
if($this->isLogged()) {
$id = \XLite\Core\Auth::getInstance()->getMembershipId();
if ($id > 0)
$isMember = true;
}
return $isMember;
}
Now override the templates in your custom skin module. If you need help here is another tutorial on custom skins:
http://xcartguru.com/tutorials/x-cart-5-tutorials/building-a-custom-skin-in-x-cart-5/
Override skins/default/en/product/details/parts/common.price.tpl with this:
Code:
{if:isMember()}
<widget class="\XLite\View\Price" product="{product}" />
{else:}
Must be a member to see prices!
{end:}
Override skins/default/en/items_list/product/parts/common.product-price.tpl with this:
Code:
{if:isMember()}
<widget class="\XLite\View\Price" product="{product}" displayOnlyPrice="true" />
{else:}
Must be a member to see prices!
{end:}
Rebuild cache.