OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
Display number of vehicles in parent catagory (0 viewing) 

VehicleManager component support

Go to bottom Favoured: 0

Display number of vehicles in parent catagory

Howardeco (Visitor)
Posts: 0
graphgraph
User Offline
Display number of vehicles in parent catagory 13 Years, 4 Months ago
Karma: 0  
Hi

I have created sub-catagories in VM populated with vehicles however the parent catagory only displays "0" ie not the sum of all the sub-catagories - I have turned off "show sub-catagory" as tree is too long. Is there anyway I can show total number of vehicles as table looks a bit "sad" otherwise?

Thanks in anticipation
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8243
graph
User Offline Click here to see the profile of this user
Re:Display number of vehicles in parent catagory 13 Years, 4 Months ago
Karma: 101  
Hello,

What you say if we propose for you so variant: if some category not have cars in it will show not "0"- will show nothing.

You need go to {yours host}/components/com_vehiclemanager
find file vehiclemanager.php, do it backup

in it through whole file please find code:
Code:

      if($cat_item1->id === $cat_item2->id  ){
        $cat_item1->vehicles = $cat_item2->vehicles;
      }



and change it to:
Code:

      if($cat_item1->id === $cat_item2->id  ){
        $cat_item1->vehicles = $cat_item2->vehicles;
        if($cat_item1->vehicles ===0 ) $cat_item1->vehicles = "";
      }

Logged Logged
The administrator has disabled public write access.
Howardeco (Visitor)
Posts: 0
graphgraph
User Offline
Re:Display number of vehicles in parent catagory 13 Years, 4 Months ago
Karma: 0  
Hi Admin

Had a go to see the result.

Perhaps not the "perfect" solution but I will keep a copy of the vehiclemanager.php with this code in it for future reference.

At the moment I have deleted the sub-catagories and just left the remaining main catagories. I will look into this again when these catagories become too full of vehicles - if ever!

Thanks for your response
Logged Logged
The administrator has disabled public write access.
Go to top
»