Answer the question
In order to leave comments, you need to log in
How to output the number of identical product brand names in a category?
Here is such a thing.
The brand name is given in the tv field.
Answer the question
In order to leave comments, you need to log in
1. Display all brands using pdoResources
2. In the chunk for each brand, call a custom snippet, passing as a parameter the name of the brand (if it is just text set in TV), which counts the number, something like this:
<p><span><a href="">[ ]</a></span></p>
<?php
$c = $modx->newQuery('modTemplateVarResource');
$c->leftJoin('modResource', 'Resource', array(
'Resource.id = modTemplateVarResource.contentid'
));
$c->where(array(
'modTemplateVarResource.tmplvarid' => XX, //XX - ID вашего TV
'modTemplateVarResource.value' => $value
));
return $modx->getCount('modTemplateVarResource', $c);
return $total;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question