# Sign in to View Price

**URL:** <https://community.hivepress.io/t/sign-in-to-view-price/199>\
**Category:** Marketplace\
**Tags:** marketplace\
**Created:** [May 20, 2022, 2:36pm UTC](https://community.hivepress.io/t/sign-in-to-view-price/199 "2022-05-20T14:36:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ncramer](https://community.hivepress.io/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@ncramer](https://community.hivepress.io/u/ncramer)\
**Post date:** [May 20, 2022, 2:36pm UTC](https://community.hivepress.io/t/sign-in-to-view-price/199/1 "2022-05-20T14:36:28Z")

</div>

Hi,

Is there a code snippet that will hide the prices for users that arent signed in?

Thanks

---

<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:** [May 21, 2022, 10:14am UTC](https://community.hivepress.io/t/sign-in-to-view-price/199/4 "2022-05-21T10:14:38Z")

</div>

Please try this PHP snippet

```auto
add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if(!is_user_logged_in()){
			if(isset($attributes['price'])){
				$attributes['price']['display_format'] = '';
			}
		}
		
		return $attributes;
	},
	1000
);

```

---

<div class="post-metadata">

**Author:** ![ncramer](https://community.hivepress.io/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@ncramer](https://community.hivepress.io/u/ncramer)\
**Post date:** [May 21, 2022, 9:42pm UTC](https://community.hivepress.io/t/sign-in-to-view-price/199/5 "2022-05-21T21:42:59Z")

</div>

Works perfect, thanks

---

<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:** [June 20, 2022, 9:43pm UTC](https://community.hivepress.io/t/sign-in-to-view-price/199/6 "2022-06-20T21:43:23Z")

</div>

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