Include listing price extras in subtotal

Would it be possible for 1 of 2 things to happen (or both)?

  1. Would it be possible to include the product add-ons on RentalHive in the Sub-total? It’s being added afterwards and this is preventing me from adding a custom service fee. I have the PHP and its added my Service Charge, but it isn’t including the product add-ons.

  2. The code I need to call the product add-ons and add it into my calculation for calculating the service fee?

Hopefully that’s possible. No matter what way I’ve tried to add the cart totals, it will not include the product add-on.

Happy to include the PHP.

And I guess a 3rd thing, how can I add my PHP so it won’t be erased when I update a plug-in? It’s currently sitting in /theme/rentalhive/function.php

It works this way if price extras are not per-booking or per-order.
We are planning to add more settings in the future update.

I guess I don’t understand; they are per-booking? So, what you’re saying doesn’t make sense to me :thinking: hopefully you can explain further?

What about questions 2 and 3?

The ability to charge the peraon a Service Fee is the last step I need for this platform to work.

Please clarify which pricing extras you mean, with Bookings there are a few types of them (per day, per place per day, per booking, per place…). Those that are per-booking (so added to the payment total regardless of the number of days, time slots or places, they are just fixed fees per booking) may not be included to the tax calculation base, but we’re working on this to add more control over this.

If you keep all the code snippets outside the theme/plugin folder (e.g. via the Code Snippets plugin, or via Appearance/Customize/Additional CSS for CSS snippets), or override template parts via a child theme (without direct changes in the main theme files) then any customizations will be safe from updates.

Right, these are applied per booking regardless of days, the fee is a fixed price - example, Delivery Fee = $100, regardless of number of days the booking is for.

I’ve tried searching the theme for any add_action or add_filter’s that affect the Woocommerce cart total and can’t find it. Does the RentalHive theme or Booking extensions modify that part of the calculation?

As I originally stated, if there’s a hook or filter for the price-extras or that is affecting the way the total is being calculated, I think I could use that in my custom PHP to add a custom service fee.

I’m trying to figure this out, so hopefully this makes sense. Thanks for your attention on this matter!

Yes, if you’re familiar with PHP basics please try using this filter hook:


You can add custom fees (to be included in the taxable base) by adding another item to the “fees” parameter of the filtered array.

Thank you, @ihor! I’ll try to figure out where and how to implement that code. I wouldn’t say I’m familiar, but I am trying to figure this out so we can launch our business.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.