This tutorial explains how to add custom field to Classifieds website using Classibase script. Classifieds sites can have different custom fields for different categories.
For example on “Flats and houses for sale” category you should have property custom fields like number of rooms, floor, area, address, price etc. For “Cars for sale” category you should use car related custom fields like engine type, fuel type, transmission type, color, year, make, model etc.
On Classibase classifieds script you can add as many custom fields to any number of categories.
Custom fields can be displayed on category listing pages and can be searched with custom search. For example if you enable search for custom field “Number of rooms” for “Flats and houses for sale” category, when visitor visits that category custom search form will have field for filtering “Number of rooms”.
In this tutorial we will show how to create address custom field with name “Address” and add it to “Flats and houses for sale” category. Similar steps should be completed for adding any custom field to any category.
How to add custom field to classifieds website?
There are 2 steps to add custom fields.
- Create custom field.
- Assign custom field to a category. Ads in that category will have those custom fields.
Create address custom field
Complete following steps for creating custom field of any type: text, price, number, address, select box, check box, radio box etc. We will display how to create address custom field.
- Navigate to “Manage” → “Custom fields” on admin panel.
- Check type column if you have address field defined. If yes then skip to adding custom field to category.
- In case address custom field is not defined then click on “Add new” button at the top.
- Select type Address from drop down list.
- Enter name for Custom field for example “Address”. This will be displayed before address on ad page and as field name when posting an ad.
- Click “Submit” button and save new custom field.
Add address custom field to category
- Navigate to “Manage” → “Category custom fields” page on admin.
- Click “Add new” button at the top.
- Select location if you want to make this custom field to appear only for selected location. Generally “All locations” option used because we want to display address for property category in all locations.
- Select category from drop down list. In our case we select “Flats and houses for sale”. You can select parent category “Property” as well but we have different custom fields for property sale, property for rent, commercial property, so it is preferred to define custom fields separately for each of them. In other words custom fields defined for sub category will overwrite custom fields defined for parent category.
- Click “Submit” button. New page will load all available custom fields and previously defined custom fields for selected category and location combination.
- Drag “Address” custom field from “Available fields” area to “Submit Form” area in order that you want it to appear. We put it after price field at the end of form.
- Optionally you can make custom field displayed on category listing by clicking “L” button next to custom field. We do not need it for address field; it is useful for price, floor, number of rooms fields.
- Optionally you can make it searchable in “custom search form” by clicking “S” button next to custom field. We do not need it for address field.
- Click “Save” button.
Now we created custom field and added it to “Flats and houses for sale” category.
If you added address custom field to category then you probably want to display address on the map. To display address on the map follow instruction on Display street address on Google map tutorial.
You can add custom fields to any category and / or any location as well.
For example classifieds website for United Kingdom, and want to display “Zone” 1-6 for London only but no other city in UK then you can select location “London”, category “Flats and houses for sale” and add custom field “Zone” with all other custom fields. Then again select location “All locations”, category “Flats and houses for sale” and add all custom fields but not “Zone”.
Types of Custom Fields
- Number — used for adding fields like year, floor, total floors, space, milage etc. Has an optional property "unit" like: m², m³, km, kg etc.
- Price — adds price field to ads. You can name and add multiple price fields like: price, price per month, price per year, price for 10+ unites etc.
- Text — regular free form text field. Users will be able write additional plain text to ads. For example: car model, city area, extra info about location etc.
- Video URL — for YouTube videos. Embeds YouTube player to ads with video.
- Address — For adding precise address like street, building and apartment number. When google maps enabled this field can be user to show address on map.
- URL — for adding website URLs to ads. For example: website, URL to pdf, URL to application form etc.
- Email — additional email field
- Checkbox — select one or multiple options from predefined checkboxes. For additional features for house: parking, pool, garden, balcony etc.
- Radio — select one option from multiple radio choices.
- Dropdown — select one option from multiple choices from dropdown select box.
You can add as many custom fields as you want to ads.
Custom fields also used to find related ads. For example it will prioritize ads with similar number of rooms, floor, price etc.
Use custom fields for navigation
You can use custom fields in category widget for navigation as a further drill down inside a category.
Classibase allows you to have website structure with categories and custom fields. You can choose to have every detail as category or use custom fields for ad details.
With "custom field drill down" option, radio and dropdown custom fields will be displayed as links. Similar to category links in widget, to narrow down your search results.
Custom field drill down navigation with ad count is also used in popular Russian classifieds website Avito.ru.
For example you have category Cars, and car make, engine type, engine volume are dropdown for that category.
Cars (category)
→ Car make (custom field)
→ Engine type (custom field)
→ Engine volume (custom field)
.
When you navigate to cars category you will see first dropdown custom field values as links to choose. In our example it will be the list of "car makes" with number of ads in them. When you click on any "car make" for example BMW you will see "engine type" as links, clicking on "engine type" you will see "engine volume" etc..
With each level down your results will reduce leaving only listings that you are interested in. Custom field drill down works well with search, by preserving search term inside drill down links.
Custom field drill down can be enabled in category widgets, separately for each widget. (view how to add widgets).
Steps to use custom fields as drill down navigation:
Custom fields will be shown inside category widget for further navigation.
- Add or edit existing "Category" widget. Preferred widget location for such drill down is "before content".
- Select "Display mode" as "Fixed 1 level".
- Optionally check "Display ad count".
- Check "Custom field drill down" option. Also check "Hide empty records" and "Related to active category".
- To test navigate to category with custom fields. Must be custom fields with type "checkbox", "radio", "dropdown". You will see custom fields displayed similar to sub categories.
Order of custom fields will be same as defined in “Manage” → “Category custom fields” page.
FAQ
To add new filter search by price range
How to add filter search for searching by price on adds page?
— Maroof kazi
--
Dear:
I needed and advanced search option, which has the following fields: Search text, Max/Min price, Currency, and location.
This search box would fit below the Search box, in the minimalist theme, Is this possible? Is this easily customizable at all? Thanks.— Ravi
Add Price custom field to related (or all) categories as described in current article, from “Manage” → “Category custom fields” page.
To display min/max price fields for search form follow above explained tutorial and activate “display in search form” option by clicking “S” button next to price custom field.
Look at following picture for more info. (In later versions this screen changed a little bit. Functionality is still the same.)
How to show price for all categories except for "Lost/found" category?
- Add "Price" custom field to "All locations" + "All categories" combination from “Manage” → “Category custom fields” page.
- Create new "Category custom field" for "All locations" + "Lost/found" category. And do not add any custom field there. So this should be empty.
How this works?
Price will be added to all categories first. It will be added by sub categories as well.
Then for "Lost/found" category we create empty "Category custom field" record. This will overwrite any custom fields added to parent categories.
This means in "Lost/found" category there should not be any custom fields. Price custom field will not be shown in this category.
Dual price setup
If I create an ad say for a set of headphones and set the price at £1.99.
Can it be set to offer UK Free Delivery, thus only taking the purchase price of £1.99.
And set an overseas postage price of say £2.15, thus the overseas customer would have to pay £1.99 + £2.15 totalling £4.14
All within the same ad setup?
— Dean
Answer:
Ok, there is no direct way of doing it as you describe. You can accomplish in 2 ways that will somehow mimic your request.
1. way: Add regular “Price” custom field and other “Delivery overseas” custom field with input type “price”. This will display both prices in your ad page but will not sum them. It will display as
Price: £1.99 Delivery overseas: £2.15
If you think it will confuse customers the you can name second price field as “Price + delivery to overseas” and first price as “Price with delivery to UK” Then it will display as
Price with delivery to UK: £1.99 Price + delivery to overseas: £4.14
In this case ad author have to post calculate price + delivery for overseas delivery.
To learn how to setup custom fields read this tutorial.
2. way: If delivery price fixed for all items to overseas you can display delivery price as regular text below or above ad on every ad page by using text widget.
Read this tutorial to learn how to add text widget https://classibase.com/display-total-number-ads-classifieds-website/ in your case it will be regular text not PHP.
I know that both ways may not be ideal for you. Also research opencart (which is shopping cart script) they have such feature for delivery but not sure if it can be as classifieds website enabling to post items by users.
Regards.
Custom Date field
Hi, Looking for Custom Date field in the Custom fields but there is no date option, Will this be available in future versions or is there an addon available to do this. Need for people to show date room is available from and for travelers to show date traveling. Would also be great if searchable by date and results can be orgainised in date order.
Thanks
— Steve
Answer:
We do not have date custom field which is used in rental sites. It is a bit complicated feature. We are not planning to add rental features.
Alternatively you can use regular text field for showing date, it will not check date validity but good for displaying for example date property will be available from – to.
Also we use number custom field for cars to display production year like 2013.
Sorting results by custom fields is also not available. Ads are sorted by posted date descending by default and not changeable in options.
How to remove links in custom fields?
Tough one problem within olxer theme, if I do drop down for custom field, it creates links and it is notttt likeable!..:-))
I am not against the links but too many links can create great a mess up!.. for the link, I would rather keep it clean. That is the way I want to have. Is that possible remove the link options from drop down listing?
— Cumhur
Answer:
No, it is not possible to remove links from dropdown custom field. They are helpful for listing items with same custom field values. For example all 3 room apartments, 4 door cars, all ads by owners etc.
How to change video link place in posting form?
Hi Classibase,
I would like to change video custom field place to top of the image upload form place. Is that possible to do that?
I also have suggestion if someone will upload video, what is the best way to make invisible image upload browse buttons? I mean if someone will upload video, image browse format must be invisible, if upload image then video insert must be invisible, both is not good within same time I believe. Like giving choices as video or image.
— Cumhur
Answer:
We have “video url” custom field, which accepts YouTube video URLs. So, there is no option to upload video.
You can change order of custom field by rearranging them in "Category custom field" page. But this will not move custom field above images.
Regards.
Can ad posters add their URL?
There are 2 ways for adding URL to ads: using URL custom field and converting URLs inside description to clickable links. Check tutorial for adding custom URLs to ads.
--
What is next:
- Create classifieds website with custom fields only (without categories).
- Use address custom field with map.
- Add YouTube video using custom field.
- Learn to add links to ads. (custom field or text in description)
- Learn to add widgets.