Add title in front of 'price'

  • Posts: 4
  • Thank you received: 0
12 years 5 months ago #51653

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.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 5 months ago #51720

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.

  • Posts: 4
  • Thank you received: 0
12 years 5 months ago #51753

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.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 5 months ago #51828

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.

  • Posts: 4
  • Thank you received: 0
12 years 5 months ago #51867

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.

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 5 months ago #51935

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.059 seconds
Powered by Kunena Forum