Skip to main content

Add title in front of 'price'

More
14 years 4 months ago #51653 by Yos
Hi,
I have different price for different user level in each product.
I want to add different title in the beginning of the 'price' so that it display public price and member price.
How should i do it?

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #51720 by nicolas
You will have to edit the file "listing_price" of the view "product" via the menu Display->Views.
There you can easily get the groups of the user via that line of code on Joomla 2.5:
$userGroups = JAccess::getGroupsByUser($user_id, true);

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #51753 by Yos
Hi,
I could not find the line of coding that you mention.
Is it because I'm running joomla 1.5?
What would be the fix for this?

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #51828 by nicolas
For Joomla 1.5, you can use that code:
$user =& JFactory::getUser();

if($user->gid==XX){
echo "text1";
}else{
echo "text2";
}

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #51867 by Yos
Hi,
Where would I put that line of code?
And what would be XX means? User group?
Could you tell me in more detail?
Thanks in advance.

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #51935 by nicolas
XXX is the id of the user group. You could put it at the beginning, after the first <?php tag for example.

Please Log in or Create an account to join the conversation.

Time to create page: 0.227 seconds
Powered by Kunena Forum