I am using both the marketplace extension and booking extension on the experthive theme, and there seems to be conflict between the two in the listing form.
When the booking extension is activated, the purchase note item field for the categories selected for selling is not displayed, instead, the security deposit field is displayed.
Also, the discount, extras, and security deposit item fields are displayed for ordinary listing categories that have not been selected for booking or selling.
I would like that this be corrected, and let the booking item field be only displayed for categories selected for booking without interfering with the functions of the marketplace extension.
Meanwhile, kindly provide a code snippet that I can use to hide the security deposit, extras, and discount item fields in the listing form for selected categories (categories not selected for selling or booking). And also a code snippet that I can use to display the purchase note item field in the listing form for categories selected for selling. Please note, the purchase note item field is always displayed when the booking extension is deactivated, it only disappears when the booking extension is activated.
Please note that the feature of restricting selling categories works only for Marketplace, it will not work for Bookings. For Bookings, you can only use this feature: How to restrict booking to specific listing categories - HivePress Help Center. However, as a workaround, we can provide a temporary fix to hide the price field for listings of a specific category in the add listing form. Let me know if this works for you.
I have done as directed in the help post you referenced in the link, it restrict some specific booking item fields to the selected category except security deposit, extras, and discounts. It also removes purchase note item field in the listing form for categories selected for selling.
Please I would really appreciate a temporary fix while you work to fix the issue.
Replace 1,2,3 with category ID where you want to hide the security deposit, price extras and discounts, for other categories the purchase note will be hidden.
Please note that further customizations may be required, as some features may rely on the removed fields.
Iâve done this, and the code doesnât work. I replaced the â1,2,3â with the category IDs for the main category and even to the last subcategories, it doesnât still work, the âsecurity depositâ, âdiscountâ, and âextrasâ fields are still displayed in the listing form for the categories.
By the way, I wasnât looking to hide the purchase note field. I wanted it the purchase not field to be displayed for categories that have been selected for selling, even when the booking extension is activated.
In general, I hope youâve taken into consideration that these issues occur only when the booking extension is activated.
It will hide the price extras, discounts, and security deposit fields for categories 1,2,3, and hide the purchase note field for categories with 4,5,6 IDs. Please adjust these IDs to match the existing settings.
Thank you very much. The first part of the code works perfectly well to hide the âPrice Extrasâ, âDiscountsâ, and âSecurity Depositâ fields in the listing form for selected categories.
However, concerning the second part of the code as copied thus:
if ( array_intersect( [ 4,5,6 ], (array) $listing->get_categories__id() ) ) {
unset( $form_args[âfieldsâ][âpurchase_noteâ] );
it seems you didnât understand the issue.
As you have stated, this part of the code hides the âpurchase noteâ field from the listing form for selected categories. However, this is the opposite of what I needed. Currently, with the activation of the booking extension, the purchase note field is not displayed for the categories selected for selling in the Hivepress Listing settings. I wanted a code snippet that would allow or set the âpurchase notâ field to be displayed for the selected categories, not the one that will hide or unset the âpurchase noteâ field.
The only issue was that it is displayed as âBooking Noteâ, but I have used the Loco translate plugin to change the label to âOrder Noteâ, and description to something about order instead of just booking.