Looking to convert ACF / SCF output from 0/1 to yes/no or custom values
-
This is probably PHP coding 101, but after an hours-long lengthy trawl through the various search engines & YouTube, it appears I’m the first and only person to ask this simple question – hoping someone can answer in a non-coder friendly way.
Working with ACF, Elementor (I know) and Woo Commerce as a way to feature additional product variables. Ideally “true” would return something other than “1”, like “Is this product heavy” = “Yes”. Happy with “false” not displaying a result.
I can’t for the life of me find a code example that relates to my simplistic query. Not even in the code examples provided by ACF.
Using dynamic fields in Elementor to show the ACF data on a Single Product Template. Would apply the PHP using Code Snippets plugin.
Can someone point me in the right direction as to how I can achieve this? Forever grateful. PS: I get the high-level logic behind “get field > if true > print XYZ”, but no concept as to how I can actually code this.
Have tried to cobble together a few PHP entries. Each time it either a) doesn’t do anything b) causes a critical site error
- You must be logged in to reply to this topic.