Created
May 24, 2017 15:06
-
-
Save CB9TOIIIA/5eacd0b97cf5055d1101ac426bfb7954 to your computer and use it in GitHub Desktop.
Цена для групп пользователей JBZoo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($this->checkPosition('list')) { | |
$juser=JFactory::getUser(); | |
$groups = $juser->get('groups'); | |
if (!in_array('10', $groups)) {/** если пользователь НЕ ВХОДИТ в группу ПРОФЕССИОНАЛЫ **/ | |
/** ID переменной определяющей скрывать ли цену для непрофессионалов **/ | |
switch ($item->type) { | |
case "cosmetic-lanza"; | |
$CB_price = 'a0b1155b-8224-40f5-845b-ca81da5c2351'; | |
break; | |
case "cosmetic-insight": | |
$CB_price = 'fca32c48-0ffc-478f-8549-d22b7f4a4d10'; | |
break; | |
case "cosmetic-innovatis": | |
$CB_price = '4b486488-f08e-4cba-8897-f3971f5e2223'; | |
break; | |
} | |
$Quest = (array)$item->getElement($CB_price)->data()['option']; | |
$Key= $Quest[0]; | |
if ($Key=='net') { /** net - отсутствие ограничений на показ цены **/ | |
echo '<div>'; | |
echo $this->renderPosition('list'); | |
echo '</div>'; | |
} | |
else { | |
echo "<a class='need-get-price' href='/full-access'> Узнать цену </a>"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment