- Posts: 4
- Thank you received: 0
Add title in front of 'price'
14 years 4 months ago #51653
by Yos
Add title in front of 'price' was created 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?
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.
14 years 4 months ago #51720
by nicolas
Replied by nicolas on topic Re: Add title in front of 'price'
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);
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.
14 years 4 months ago #51753
by Yos
Replied by Yos on topic Re: Add title in front of 'price'
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?
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.
14 years 4 months ago #51828
by nicolas
Replied by nicolas on topic Re: Add title in front of 'price'
For Joomla 1.5, you can use that code:
$user =& JFactory::getUser();
if($user->gid==XX){
echo "text1";
}else{
echo "text2";
}
$user =& JFactory::getUser();
if($user->gid==XX){
echo "text1";
}else{
echo "text2";
}
Please Log in or Create an account to join the conversation.
14 years 4 months ago #51867
by Yos
Replied by Yos on topic Re: Add title in front of 'price'
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.
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.
14 years 4 months ago #51935
by nicolas
Replied by nicolas on topic Re: Add title in front of 'price'
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