Welcome, Guest
Username: Password: Remember me

TOPIC: Category and subcategory.

Category and subcategory. 5 years 1 month ago #3497

  • Shomty
  • Shomty's Avatar
  • Offline
  • Senior Boarder
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Hi Hung,

What is the easiest way to add subcategory to our webiste?
We are running 1.9.0 for almost 3 years now but we need to modernize this.

Could you be so kind, as always, and point us in right direction.

Example: Category Travel, should have subcategory: Local, Europe, Far East ...
Once we add Deal to Any of child category it should also be in Parent cat.

Thanks in advance.
The administrator has disabled public write access.

Category and subcategory. 5 years 1 month ago #3498

  • hungtran
  • hungtran's Avatar
  • Offline
  • Moderator
  • Posts: 1636
  • Thank you received: 245
  • Karma: 27
Hi Shomty

I'm afraid it is difficult to do this, you will need many customizations in database, and PHP code, that is the only way.

If you are familiar with PHP, I can let you know what files you may need to customize, however you will need to do your customizations by yourself with your PHP skills.

Regards,
Hung
The administrator has disabled public write access.
The following user(s) said Thank You: Shomty

Category and subcategory. 5 years 1 month ago #3499

  • Shomty
  • Shomty's Avatar
  • Offline
  • Senior Boarder
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Yes - i have developer beside me, but in order to save time we need your knowledge of code base.
I know it is "big change" but we are not afraid to do it ;)

You can reach me on my private mail, or PM - or here if anyone else wish to make same.
The administrator has disabled public write access.

Category and subcategory. 5 years 1 month ago #3500

  • Shomty
  • Shomty's Avatar
  • Offline
  • Senior Boarder
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Hi Hung,

We made some modification, but please tell me how do you save modification to #__cmgroupbuying_categories
The administrator has disabled public write access.

Category and subcategory. 5 years 1 month ago #3501

  • hungtran
  • hungtran's Avatar
  • Offline
  • Moderator
  • Posts: 1636
  • Thank you received: 245
  • Karma: 27
Hi Shomty,

It seems you almost get it. Have you add a new column in cmgroupbuying_categories table to store parent category yet? If not, you need to add one, let say its name is "parent_id". This column helps us define what the parent category of the current category is, like "Europe" is the parent category of "France" category.

In administrator/components/com_cmgroupbuying/models/forms/category.xml you add a new field "parent_id", then Joomla will automatically save this field into database.

The name of the column in database must be the same with the name of the field in category.xml.

Regards,
Hung
The administrator has disabled public write access.