Skip Navigation

[Resolved] Add dollar sign to values

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Charles 7 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#548624

Support,

I trying to add a $ sign to my price values.

I have add the following code and was able to get commas:

function display_price($output) {
    return number_format($output, 0);
}
add_filter("wpcf_fields_slug_price_value_display", "display_price");

This is my loop editor:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
          	<table width="100%">
		<thead>
			<tr>
				<th>[wpv-heading name=""]Post Featured Image[/wpv-heading]</th>
				<th>[wpv-heading name="post-link"]Post Title[/wpv-heading]</th>
				<th>[wpv-heading name="price"]Price[/wpv-heading]</th>
				<th>[wpv-heading name=""]Post Status[/wpv-heading]</th>
			</tr>
		</thead>
		<tbody class="wpv-loop js-wpv-loop">
		<wpv-loop>
			<tr>
				[wpv-post-body view_template="Loop item in My Ads List"]
			</tr>
		</wpv-loop>
		</tbody>
	</table>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

Here is a pageshot: hidden link

Where can/should I add the $?

Thanks,
Chuck

#548643

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please try to use following code and try to resolve your issue.:

function display_price($output) {
    return "$".number_format($output, 0);
}
add_filter("wpcf_fields_slug_price_value_display", "display_price");
#548802

That code did not work. Is there another code to try?

Thanks,
Chuck

#548803

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can I have problem URL and information where exactly you want to place the $ sign?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#548821

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now.
=> hidden link

I can see $ sign is added before the price field. Could you please confirm.

I've adjusted following code in your current theme's functions.php file:

function display_price($output) {
    return "$".number_format($output, 0);
}
add_filter("wpcf_fields_slug_price_value_display", "display_price");
#548826

Looks like it's working now.

Thank you,
Chuck