Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CB9TOIIIA/5eacd0b97cf5055d1101ac426bfb7954 to your computer and use it in GitHub Desktop.
Save CB9TOIIIA/5eacd0b97cf5055d1101ac426bfb7954 to your computer and use it in GitHub Desktop.
Цена для групп пользователей JBZoo
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