We have 213 guests online
OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
Display number of vehicles in parent catagory (1 viewing) (1) Guest
VehicleManager component support
Go to bottom Favoured: 0
TOPIC: Display number of vehicles in parent catagory
#1359
Howardeco (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Display number of vehicles in parent catagory 1 Year, 5 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.
#1365
admin (Admin)
Admin
Posts: 1679
graph
User Offline Click here to see the profile of this user
Re:Display number of vehicles in parent catagory 1 Year, 5 Months ago Karma: 17  
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.
#1373
Howardeco (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Re:Display number of vehicles in parent catagory 1 Year, 5 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