ACF number less than comparison not working

Due to the ‘ vs ' that was already mentioned and since your code logic is correct, I suggest you make sure you’re comparing integers, not strings. PHP can be surprising when working with strings as numbers, so cast them as int. Also, make sure you’re getting the correct values by adding $post_id, like this:

$price = intval(get_field('price', $post_id));

$reduced_price = intval(get_field('reduced_price', $post_id));

“117900” is considered smaller than “99900” as strings. PHP will compare ASCII values of the first character from the string – “1” vs “9” in our case. If the first character from the first string is smaller, the whole first string is smaller. If they’re equal, it moves on to the next character, an so on.

error code: 523