Welcome, Guest
Username: Password: Remember me

TOPIC: Not allow to post ads on first level category

Not allow to post ads on first level category 3 years 3 months ago #5026

Hi,
Is there a way to not allow users to not select a subcategory on Post Ad form? I mean, I don't like users to post ads on the first level categories.

Thanks,

Jackson
The administrator has disabled public write access.

Not allow to post ads on first level category 3 years 3 months ago #5038

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2941
  • Thank you received: 336
  • Karma: 45
Dear Customer,

The feature to restrict your users from posting ad to your parent category is not available in Jomclassifieds. But you can achieve this by making your sub-category field as mandatory field.

To make subcategory field mandatory :

Open your html.php file from the below path:
Root -> Components -> com_jomclassifieds -> etc -> html.php

1. Find the below code in the function "ListChildCategories"
$options[] = JHTML::_('select.option', $parent, '- ' . JText::_('SUB_CATEGORIES') . ' -');

And change it as following code
$options[] = JHTML::_('select.option', '-1', '- ' . JText::_('SUB_CATEGORIES') . ' -');

2. Find the below code in the function "ListChildCategories"
$attr .= '';

Add the below code after the above code
$attr .= "class='required validate-list'";

That's it. Now save the file and check your site.

Thanks.
The administrator has disabled public write access.

Not allow to post ads on first level category 3 years 2 months ago #5107

  • ekavet
  • ekavet's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Karma: 0
Ok this will restrict to post an advert to main category.

But what if i have Main category>1Sub Category>2Sub Category>3rd Sub Category or god knows how many there will be more sub category's.

How can i restrict to post in a sub category if there is more sub catorys in it?
The administrator has disabled public write access.
Time to create page: 0.285 seconds

Contact us

  No.2/A, Venkateshwara Nagar,
1st Main Road, 100 Feet Road, SBM Towers, Velachery,Chennai - 600 042,India.
 skype.jomclassifieds
 
 
Copyright © 2013-2018 Jomclassifieds.com. All rights reserved. The Joomla! name, and logo are used under a limited license granted in the United States and other countries.

We accept cookies to provide you the best viewing experience. By using our services, you agree to our use of cookies