Hi,
I'm trying to exlude items in category_items view.
I can't use category filtering option because i have a single value field (id 40), and i need to display every items with field value different from 0.
This is for a catalogue, i'm trying to hide items that are no more in stock.
My field is a simple text field with quantity value in it.
So I tried using PHP for that, here is what I wrote:
Code:
foreach ($this->items as $i => $item) :
if ($this->items[$i]->fieldvalues[40][0] == 0{ unset($this->items[$i]); }
endforeach;
It works fine, but pagination isn't good. It load 6 items, then create page with 6 item, then page render only X items and display 'items 1-6'.
Where can I unset items[$i] before category_items.php or category.php ?
Or maybe i load 1 more items each time I unset one?
If I'm totally wrong, how can I do to display only items where field 40 is different from 0, with a good pagination?
Thanks for your help