Directory field
-
Hi,
I would like to upgrade my site with a directory.
I made a first test and I have a problem with the form.
For example, I want to list the different hospitals in the region.
I don’t need the price field to be present.
I would also like to reorganize the different fields.
Is this possible?
Thank you.
-
Yes, we have settings to enable/disable price and also possible to reorganize fields but need to customize to reorganize listing form.
Thank You
Hi,
Regarding the deactivation of the price, I think you are referring to settings / moderation / Hide form fields / price, am I right?
The problem is that I also have a classifieds site and it is impossible to remove the price, you understand.
So I would like to keep the price for the classifieds ads and remove it for the directory.
Thank you.
-
This reply was modified 3 years, 10 months ago by
walid91.
Yes, you are right. In that case, you can disable price during post ad https://prnt.sc/UpA8xaPRmRaw
On the other hand, you can disable price for specific ‘Ad Type’ or ‘Category’ by customize it.Thank You
Hi,
I don’t want to disable the price for ads, but just for one type of ad.
Let’s forget about the classified ads since I don’t want to make any changes.
How do I disable the price for an ad type?
Thank you for your help.
You have to override listing from template. Modify this template using child theme plugins\classified-listing\templates\listing-form\information.php
Add condition for this ad type in line 54 https://prnt.sc/mi7vUw5gRQFw
Thank You
Hi,
I did several tests with my staging site and it appears a fatal error.
Should I put the type of ad or the name of the category instead of “needle”?
Please look here:
Did I make a mistake?
Yes, you did mistake to write code.
First, you have to retrieve ad type using slug then need to add condition. We stored ad type in option table.
Thank You
Hi,
I tried but I don’t understand the steps.
If you can detail more.
I know it may look like customization but it will prevent me from installing another plugin.
Thank you.
Okay. You can target one if category ‘bibi’ exist under ad type ‘bia’
Will I write code to disable price for ad type ‘bia’?
https://ibb.co/0DdPfp1Hi,
Small precision concerning :
I know it may look like customization but it will prevent me from installing another plugin.
This concerns the directory, regarding the classified ads I still use your plugin.
Okay. You can target one if category ‘bibi’ exist under ad type ‘bia’
Will I write code to disable price for ad type ‘bia’?
https://ibb.co/0DdPfp1Still not understood, too bad.
Please, follow below steps to achieve it –
1. Copy this template from plugins/classified-listing/templates/listing-form/information.php
2. Paste it in themes/your-child-theme/classified-listing/information.php
3. Replace 54 no line with this https://codeshare.io/vwp4oL https://prnt.sc/_k27T02qgDdhThank You
-
This reply was modified 3 years, 10 months ago by
Muhammad Ali Akbar.
Hi,
Indeed, with the code you sent, the price is disabled with a specific category.
I had not understood that it was necessary to rewrite the code, something I do not have the ability to do.
Last question: if I want to add several categories for which I want to deactivate the price should I write :
<?php if ( ‘bia’ , ‘other category’ !== $selected_type && !in_array( ‘price’, $hidden_fields ) ):
or
<?php if ( ‘bia’ !== $selected_type && !in_array( ‘price’, $hidden_fields ) ):
<?php if ( ‘other category’ !== $selected_type && !in_array( ‘price’, $hidden_fields ) ):Or neither of them.
Thank you.
-
This reply was modified 3 years, 10 months ago by
walid91.
No, your code will not work. You have to know code to do it.
It will work for all category which is under ad type ‘bia’, don’t need to modify mentioned above code.
Thank You
Hi,
I made a mistake in the question, I meant to say:
Last question: if I want to add several Listing Types
for which I want to deactivate the price should I write :<?php if ( ‘bia’ , ‘other Listing Types’ !== $selected_type && !in_array( ‘price’, $hidden_fields ) ):
or
<?php if ( ‘bia’ !== $selected_type && !in_array( ‘price’, $hidden_fields ) ):
<?php if ( ‘other Listing Types’ !== $selected_type && !in_array( ‘price’, $hidden_fields ) ):Thank you.
For multiple types, will write following way https://codeshare.io/vwp4oL (see line 4 and 7) https://prnt.sc/Ir5zvagfgQLE
Thank You
-
This reply was modified 3 years, 10 months ago by
The topic ‘Directory field’ is closed to new replies.