Join our new community forum for support & discussion
Join NowHome › Support › Extensions › Bookings › Bookings (button appear and payments)
Bookings (button appear and payments)
-
AuthorPosts
-
Bemay1 1 year, 4 months ago
Hi, I’m thinking about getting booking extension… my questions are:
1 – The button will appear on all listings?
2 – Can I make it appear only on a certain category?
3 – When user books something he pays at that moment or is only the request?
4 – Is it possible to book only if pays at the moment?
Thank you!Hi,
1. Yes.
2. It’s possible, but with a custom code snippet https://hivepress.io/support/topic/hide-bookings-extension-price-attribute-for-certain-categories-sub-categories/#post-20132
3. It’s only the request, but it’s possible to enable online payments with the Marketplace extension.
4. Yes, if you want to process payments immediately and approve a paid booking automatically it’s possible with the Marketplace extension.Bemay1 1 year, 3 months agoSo I tried the snippet but it does not match my needs;
– I need bookings working on only two categories;
– The others I need to stay the normal marketplace “Buy now” button!
– And also it is not displaying the prices with the snippet.Yes, the snippets just disabled bookings on selected categories, it doesn’t bring the Buy Now form back since it’s overridden by the booking form. This would require more customizations.
Sorry, the Bookings/Marketplace extensions are not specific to categories, these are global but we’ll try to find a solution for this in future updates.Bemay1 1 year, 3 months agoHi, there is news on this? This is so important!
Sorry, there’s no category-specific option for Bookings yet. If it’s urgent we can customize this directly on your site until the Bookings update with this feature is released https://hivepress.io/customization/
Bemay1 1 year, 2 months agoHi, how is the progress on this important and needed feature?
It’s not available yet, but we’ll add it as soon as possible. There were 2 updates for Bookings this week and we’re working on more improvements.
Yes, we’re working on it but there’s no ETA yet (there are a few urgent updates required for other extensions). Please let me know if the only requirement (in addition to the suggested snippet) is showing the Buy Now button in categories where bookings are disabled, we can try to provide a temporary code snippet for this.
Bemay1 1 year, 1 month agoYes, is only that!
Please try this PHP snippet. Just change numbers in
$categories = [1,2,3];
on categories where you want to show Buy Now buttonadd_filter( 'hivepress/v1/templates/listing_view_page/blocks', function( $blocks, $template ) { $listing = $template->get_context( 'listing' ); $categories = [1,2,3]; if ( $listing && array_intersect( $categories, (array) $listing->get_categories__id() ) ) { $blocks = hivepress()->helper->merge_trees( [ 'blocks' => $blocks ], [ 'blocks' => [ 'listing_actions_primary' => [ 'blocks' => [ 'listing_buy_form' => [ 'type' => 'form', 'form' => 'listing_buy', '_order' => 5, 'attributes' => [ 'class' => [ 'hp-form--narrow' ], ], ], ], ], ], ] )['blocks']; } return $blocks; }, 1000, 2 );
Bemay1 1 year, 1 month agoSo close, the only problem is that the “book now” button still appears… So we have the two buttons on the category… Can you just remove if there is buy now, remove “book now”
Efim 1 year, 1 month agoIs it possible to use other filters, for example the listing with attachment?
Bemay1 1 year, 1 month agoFinally, is done!!! I used the snippet on this one to complement https://hivepress.io/support/topic/hide-bookings-extension-price-attribute-for-certain-categories-sub-categories/#post-20146
Thank you, thank you!!!!Efim 1 year, 1 month agoThis code selects by category
$categories = [1,2,3]; if ( $listing && array_intersect( $categories, (array) $listing->get_categories__id() ) )
how to select listings with attachments?
If it’s a custom attachment attribute you can check its value by the attribute name this way:
$listing->get_attributename__id()
Efim 1 year, 1 month agoGood! This snippet hides button “book now” and shows button “buy now” if it is a digital product:
add_filter( 'hivepress/v1/templates/listing_view_page/blocks', function( $blocks, $template ) { $listing = $template->get_context( 'listing' ); if ( $listing && $listing->get_attachments__id() ) { $blocks = hivepress()->helper->merge_trees( [ 'blocks' => $blocks ], [ 'blocks' => [ 'listing_actions_primary' => [ 'blocks' => [ 'listing_buy_form' => [ 'type' => 'form', 'form' => 'listing_buy', '_order' => 5, 'attributes' => [ 'class' => [ 'hp-form--narrow' ], ], ], ], ], 'booking_make_form' => [ 'type' => 'content', ], ], ] )['blocks']; } return $blocks; }, 1000, 2 );
Thanks for posting the solution!
-
AuthorPosts
New Reply
This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.