Breezer: THANK YOU, THANK YOU!
I was unsure of what arguments to pass to isMemberOfWebGroup() function.. it’s not listed on the documentation yet. It is now working as it should except for one pretty big detail: pagination. I have to call the [[showPrices]] snippet uncached to get Ditto to paginate.
I’m using a Ditto call that requires pagination... there are 72 products spread over 5 pages. The prices now toggle on and off based on my login group status BUT... I lose the pagination because Ditto needs to be called cached and I uncached my page to accommodate that.
Help! I’m sure there is someone out there who understands this better than I do.
Here is my code:
<?php
if($modx->isMemberOfWebGroup(array('Retailers'))){
$dittoOutput = $modx->runSnippet("Ditto", array('parents' => 5, 'tpl' => 'tpl-catalog-ws', 'display' => 15, 'paginate' => 1, 'showInMenuOnly' => 0, 'paginateAlwaysShowLinks' => 1, 'orderBy' => 'menuindex asc', 'filter' => 'type,reference,2'));
} else {
// Page visitor is not logged in as a Retailer.
$dittoOutput = $modx->runSnippet("Ditto", array('parents' => 5, 'tpl' => 'tpl-catalog-noe', 'display' => 15, 'paginate' => 1, 'showInMenuOnly' => 0, 'paginateAlwaysShowLinks' => 1, 'orderBy' => 'menuindex asc', 'filter' => 'type,reference,2'));
}
return $dittoOutput;
?>
Again, many thanks.