# Change the total booking price format

**URL:** <https://community.hivepress.io/t/change-the-total-booking-price-format/9521>\
**Category:** Bookings\
**Tags:** code\
**Created:** [February 2, 2024, 8:40am UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521 "2024-02-02T08:40:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![muslimbnb](https://community.hivepress.io/user_avatar/community.hivepress.io/muslimbnb/32/3235_2.png) [@muslimbnb](https://community.hivepress.io/u/muslimbnb)\
**Post date:** [February 2, 2024, 8:40am UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/1 "2024-02-02T08:40:18Z")

</div>

Hello, I’d like to add the text “Total stay” where the total amount of the reservation is displayed (here 158€ so Total stay 158€)- I can’t find the file that manages this block to customize the code. What’s more, when the text is added, it’s added to the unit price (price/night) because it’s the same block, but I want it to appear only when the quantity is selected and the total is displayed. Thanks

 ![total amount](https://community.hivepress.io/uploads/default/original/2X/7/7ba0baf44fe7c18ff4427d610635c2b47fbe0e6d.jpeg)  
 ![unit price](https://community.hivepress.io/uploads/default/original/2X/0/0bb6f224b50a83691a923d9b2b0de1d3d8ac71cb.jpeg)

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [February 5, 2024, 8:23pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/3 "2024-02-05T20:23:45Z")

</div>

Please let me know if you have a developer for custom work, the snippet requires some research but I can provide guidance on the related hooks and functions.

---

<div class="post-metadata">

**Author:** ![muslimbnb](https://community.hivepress.io/user_avatar/community.hivepress.io/muslimbnb/32/3235_2.png) [@muslimbnb](https://community.hivepress.io/u/muslimbnb)\
**Post date:** [February 5, 2024, 8:37pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/4 "2024-02-05T20:37:14Z")

</div>

@ihor Yes I have a developer but he doesn’t understand the structure or logic of the theme, so yes it would be nice to give as much advice as possible on hooks, elements, tags… and especially the file that manages the reservation blocks and the dynamic “total amount” tag thank you.

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [February 9, 2024, 2:54pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/6 "2024-02-09T14:54:28Z")

</div>

I’m sorry for the delay. If you have a developer please ask them to use the `hivepress/v1/fields/currency/display_value` filter hook [Filter: hivepress/v1/fields/{field\_type}/display\_value | HivePress Hook Reference](https://hivepress.github.io/hook-reference/hivepress_v1_fields_%257Bfield_type%257D_display_value.html) This way it’s possible to set the display value format or customize it in any way. The main issue is affecting only the price after the calculation, I recommend using a condition to check if the field name equals to “price” and also if it’s a REST request (this way only the calculated amount will be affected since it’s refreshed via REST), you can try this function to check this:

`hivepress()->helper->is_rest()`

Hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [March 10, 2024, 2:54pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/7 "2024-03-10T14:54:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jovica](https://community.hivepress.io/user_avatar/community.hivepress.io/jovica/32/12310_2.png) [@jovica](https://community.hivepress.io/u/jovica)\
**Post date:** [July 23, 2025, 9:55pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/8 "2025-07-23T21:55:58Z")

</div>

Hi there,

I want to add “Total:” to calculated booking price on the listing page. Currently it shows only as number.

I followed the solution in [Change the total booking price format - #3](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/3)

 ![image](https://community.hivepress.io/uploads/default/original/2X/b/badd2e48299b0ab9f030988c1a59d1e3858c3a35.png)

How can I check if the field name equals to “price”, as per the above suggestion?

Here’s my code:

```auto
add_filter(
    'hivepress/v1/fields/currency/display_value',
    'bookably_conditional_total_label',
    10,
    3
);
function bookably_conditional_total_label( $display, $value, $field = null ) {

	
    if ( ! hivepress()->helper->is_rest() ) {
        return $display;
    }

    
    $plain = html_entity_decode( strip_tags( $display ) );
    $plain = trim( $plain );
    
    $last = substr( $plain, -1 );
    if ( is_numeric( $last ) ) {
        return 'Total: ' . $display;
    }

    
    return $display;
}

```

---

<div class="post-metadata">

**Author:** ![jovica](https://community.hivepress.io/user_avatar/community.hivepress.io/jovica/32/12310_2.png) [@jovica](https://community.hivepress.io/u/jovica)\
**Post date:** [July 24, 2025, 8:46pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/10 "2025-07-24T20:46:04Z")

</div>

Hi there,

As per my question in [Booking total price format](https://community.hivepress.io/t/booking-total-price-format/16370) ,

Any suggestion how to check if the field name is “price”?

Thanks,

Jovica

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [July 24, 2025, 10:08pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/11 "2025-07-24T22:08:21Z")

</div>



---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [July 24, 2025, 10:12pm UTC](https://community.hivepress.io/t/change-the-total-booking-price-format/9521/12 "2025-07-24T22:12:29Z")

</div>

Please set the number of parameters to pass to the callback function to 2, then the first one is `$display` (the displayed value) and the second one is `$field`, and you can get the field name via `$field->get_name()` method.

Hope this helps
