show field in list if != 0

prophoto

Active Member
In my 'park' site I have a list with multiple items, some items have more than one price depending on size (small, medium, large in separate fields). Large prices will always show, but how do I hide medium and small prices if they do not equal 0?
 
What do you mean by "hide"? Where? On a form? In the list?

BTW, I don't seem to be able to log in to the 'park' site with the usual credentials.

-- hugh
 
Basically there is only a price if the item is available in that size. I don't want any of the 0.00 prices shown on the list page (div template).
 
You'd probably have to clone the div template, and customize it. In default_row.php ...

In default.php change line 21 to set $this->showEmpty = false.

In default_row.php change ...

Code:
        if (isset($this->showEmpty) && $this->showEmpty === false  && trim(strip_tags($d == ''))) :
            continue;
        endif;?>

... to ...

Code:
        $dtest = trim(strip_tags($d));
        if (isset($this->showEmpty) && $this->showEmpty === false  && empty($dtest)) :
            continue;
        endif;?>

That may not work, as I can't recall if PHP considers "0.00" to be empty. I know "0.0" is, but never actually tries "0.00". If it doesn't we can fix that.

-- hugh
 
Applied all changes, not working for 0.00. I chose the new template in the menu item so that I can still use the bootstrap list template in the backend and in a separate list for frontend editing.
 
By default do the labels get turned off when using group by? I have them turned on in the list and in the group but I can't find out why they are not displaying.
 
Set showLabels to true in default.php. It's set to false out-of-box.

The div template isn't really meant to be a complete out-of-box solution, except for the simplest of needs. It's intended to use a basis for customization.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top