[Resolved] Displaying a weight as pounds at 3 and above and ounces below 3
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Tell us what you are trying to do? My CPT includes a field for weight in pounds. It currently displays as '2lb'. The client would like all weights below 3lb to display in ounces. This requires multiplying the value by 16 if the value is less than 3 and then appending 'lb' at 3 and above and 'oz' below 3.
What is the most efficient way to do this?
Is there any documentation that you are following? I couldn't find a way to add a field that would automatically calculate its value from the 'weight' field value.
I couldn't figure out how to perform the calculation within a conditional in Views.
Is there a similar example that we can see? n/a
What is the link to your site? hidden link
Admin access is still in place from prior tickets.
Thank you for contacting us and I'd be happy to assist.
To achieve this, you can register a custom shortcode, that gets the value from the weight custom field and then return the output, after the necessary calculation and suffix.