# Display price extras by default

**URL:** <https://community.hivepress.io/t/display-price-extras-by-default/2448>\
**Category:** HivePress\
**Created:** [October 20, 2022, 4:57pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448 "2022-10-20T16:57:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davilillo](https://community.hivepress.io/user_avatar/community.hivepress.io/davilillo/32/2229_2.png) [@Davilillo](https://community.hivepress.io/u/Davilillo)\
**Post date:** [October 20, 2022, 4:57pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/1 "2022-10-20T16:57:58Z")

</div>

Hello!!  
Is it possible for woocommerce extras to appear by default automatically when attributes are selected?  
In this way we save time for the user, it is annoying to have to write them one by one, it is much more practical and improves the user experience if you only have to click

Gracias!!!

 ![Captura de pantalla 2022-10-20 185359](https://community.hivepress.io/uploads/default/original/2X/0/0b1c4a8d5a23bd2fb0b921db8aff9c742a33903c.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:** [October 21, 2022, 9:48am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/2 "2022-10-21T09:48:11Z")

</div>

Please send more details about this issue, do you mean pre-filling some default extras for every added listing? Should these extras be editable or they are the same for all listings?

---

<div class="post-metadata">

**Author:** ![Davilillo](https://community.hivepress.io/user_avatar/community.hivepress.io/davilillo/32/2229_2.png) [@Davilillo](https://community.hivepress.io/u/Davilillo)\
**Post date:** [October 21, 2022, 10:07am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/3 "2022-10-21T10:07:51Z")

</div>

pre-filling some default extras for every added listing?  
Yes, please

hould these extras be editable or they are the same for all listings?  
Yes, please

They will be some predetermined extras based on the attributes  
In this way the Vendor only has to adjust the price of the extras once they have selected the attributes  
It is a way to make an ad faster and improve the user experience using only “click” instead of writing one by one the attributes related to the extras.

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [October 23, 2022, 12:58pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/6 "2022-10-23T12:58:15Z")

</div>

Unfortunately, there’s no easy way to prevent editing extras, this would require a few snippets (e.g. for hiding the “x” for removing extras), but you can set default extras for newly created listings using this snippet:

```auto
add_action(
	'hivepress/v1/models/listing/create', 
	function($listing_id, $listing) {
		$listing->set_price_extras([['name' => 'Test', 'price' => 100]])->save_price_extras();
	},
	1000,
	2
);

```

---

<div class="post-metadata">

**Author:** ![Davilillo](https://community.hivepress.io/user_avatar/community.hivepress.io/davilillo/32/2229_2.png) [@Davilillo](https://community.hivepress.io/u/Davilillo)\
**Post date:** [October 24, 2022, 3:16pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/7 "2022-10-24T15:16:25Z")

</div>

I don’t know if I explained myself well, sorry…  
I would like to use the same default attributes for all the ads and that the seller only has to put a price to each attribute by default.  
That they can adjust a price to each independent attribute

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [October 25, 2022, 7:53pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/9 "2022-10-25T19:53:41Z")

</div>

Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work [https://fvrr.co/32e7LvY](https://fvrr.co/32e7LvY)

---

<div class="post-metadata">

**Author:** ![Davilillo](https://community.hivepress.io/user_avatar/community.hivepress.io/davilillo/32/2229_2.png) [@Davilillo](https://community.hivepress.io/u/Davilillo)\
**Post date:** [October 26, 2022, 8:52am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/10 "2022-10-26T08:52:12Z")

</div>

I’ve tried to search for professionals on Fiverr, but they all say no…  
I feel sad that the site is almost there, but I am missing certain settings that I am not able to solve by myself and I feel frustrated.  
Please, would you be so kind as to recommend a professional?  
I would appreciate it very much

---

<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:** [October 27, 2022, 6:05pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/12 "2022-10-27T18:05:52Z")

</div>

Sorry, there are a few urgent updates and we temporarily don’t offer customization services. If you find a developer familiar with WordPress in general, we can provide some guidance on implementation, HivePress framework is pretty easy to customize.

---

<div class="post-metadata">

**Author:** ![Davilillo](https://community.hivepress.io/user_avatar/community.hivepress.io/davilillo/32/2229_2.png) [@Davilillo](https://community.hivepress.io/u/Davilillo)\
**Post date:** [October 28, 2022, 7:50am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/13 "2022-10-28T07:50:30Z")

</div>

I can’t find… I’m thinking of refunding the total amount of the set of plugins that I paid for.  
You must know someone who wants to work, please!  
It doesn’t have to be from your team, a friend, colleague…

---

<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:** [October 28, 2022, 1:27pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/15 "2022-10-28T13:27:43Z")

</div>

I’m sorry for the inconvenience, but we don’t advertise in-house customization services anywhere, we sell themes & extensions with a specific set of features (advertised on the demo site and theme page) and we guarantee these features (by fixing bugs and providing guidance about the features). We hope to start offering customization services soon, but at the moment this is not something that we can offer with the theme license. We also plan to launch the HivePress Experts program to recommend developers fully familiar with HivePress.

If there are only a few specific changes required you can also submit the requirements here [https://forms.gle/XHCtFKMMc1g1xUp67](https://forms.gle/XHCtFKMMc1g1xUp67) and we’ll check if we can implement these, postponing some of the HivePress updates.

---

<div class="post-metadata">

**Author:** ![Davilillo](https://community.hivepress.io/user_avatar/community.hivepress.io/davilillo/32/2229_2.png) [@Davilillo](https://community.hivepress.io/u/Davilillo)\
**Post date:** [October 31, 2022, 10:48am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/16 "2022-10-31T10:48:42Z")

</div>

Ok thanks!

---

<div class="post-metadata">

**Author:** ![danilo](https://community.hivepress.io/user_avatar/community.hivepress.io/danilo/32/2105_2.png) [@danilo](https://community.hivepress.io/u/danilo)\
**Post date:** [November 10, 2022, 5:46pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/17 "2022-11-10T17:46:10Z")

</div>

Hey yevhen, how can i set the extra price per booking?

---

<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:** [November 11, 2022, 10:06am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/18 "2022-11-11T10:06:42Z")

</div>

It’s possible if you enable extras in HivePress/Settings/Listings/Selling, then hosts can define extras for their listings in the listing edit form. If you mean a common fee for all the bookings, you can try adding it as a custom tax in WooCommerce.

---

<div class="post-metadata">

**Author:** ![danilo](https://community.hivepress.io/user_avatar/community.hivepress.io/danilo/32/2105_2.png) [@danilo](https://community.hivepress.io/u/danilo)\
**Post date:** [November 12, 2022, 1:58am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/19 "2022-11-12T01:58:01Z")

</div>

Oh sorry! I meant using code snippet. How could I set this?

---

<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:** [November 12, 2022, 10:19am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/20 "2022-11-12T10:19:04Z")

</div>

Please try using the code snippet suggested by @yevhen above, it pre-defines price extras for a newly created listing. You can add this snippet via the Code Snippets plugin.

---

<div class="post-metadata">

**Author:** ![danilo](https://community.hivepress.io/user_avatar/community.hivepress.io/danilo/32/2105_2.png) [@danilo](https://community.hivepress.io/u/danilo)\
**Post date:** [November 12, 2022, 10:31am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/21 "2022-11-12T10:31:40Z")

</div>

I’ve used code snippet suggested by @yevhen above, but I need to know how do I set that as a per booking price instead of per day as default.

---

<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:** [November 13, 2022, 10:39am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/22 "2022-11-13T10:39:17Z")

</div>

Unfortunately there’s no such option yet, if you use day-based bookings, then the price will be multiplied by the number of days (or nights if there are nightly bookings), for time slot bookings the price is multiplied by the number of slots (if you allow booking more than 1 slot at once).

---

<div class="post-metadata">

**Author:** ![danilo](https://community.hivepress.io/user_avatar/community.hivepress.io/danilo/32/2105_2.png) [@danilo](https://community.hivepress.io/u/danilo)\
**Post date:** [November 17, 2022, 10:57am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/23 "2022-11-17T10:57:58Z")

</div>

ihor,  
I don’t know if I was able to be clear enough, but I have the code snippet below (with name and price), right? So, i need to add “per reservation” or “per guest per day” option on this. Isn’t it possible?

```auto
add_action(
	'hivepress/v1/models/listing/create', 
	function($listing_id, $listing) {
		$listing->set_price_extras([['name' => 'Test', 'price' => 100]])->save_price_extras();
	},
	1000,
	2
);

```

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [November 19, 2022, 2:07am UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/26 "2022-11-19T02:07:34Z")

</div>

Please try this PHP snippet to set per booking as price extra type by default

```auto
add_action(
	'hivepress/v1/models/listing/create', 
	function($listing_id, $listing) {
		$listing->set_price_extras([['name' => 'Test', 'price' => 100, 'type' => 'per_order']])->save_price_extras();
	},
	1000,
	2
);

```

---

<div class="post-metadata">

**Author:** ![danilo](https://community.hivepress.io/user_avatar/community.hivepress.io/danilo/32/2105_2.png) [@danilo](https://community.hivepress.io/u/danilo)\
**Post date:** [December 1, 2022, 12:20pm UTC](https://community.hivepress.io/t/display-price-extras-by-default/2448/27 "2022-12-01T12:20:51Z")

</div>

It worked fine! Thanks

[Next page](https://community.hivepress.io/t/display-price-extras-by-default/2448.md?page=2)
