Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
String comparison not working for cost in ticket template | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium String comparison not working for cost in ticket template

String comparison not working for cost in ticket template

Posted: August 20, 2013 at 3:33 pm

Viewing 1 reply thread


Biebob

August 20, 2013 at 3:33 pm

Hi,

I want to check for the price in the ticket template. When the price is 0, I want to display Reservation instead of EUR 0.00. However, this is not working for some reason. What can be the problem?

<?php
if (do_shortcode(‘[cost]’) == ‘EUR 0.00’) {
echo “RESERVATION”;
}else{
echo do_shortcode(‘[cost]’);
}
?>

  • This topic was modified 11 years, 6 months ago by Biebob.


Dean

  • Support Staff

August 21, 2013 at 2:46 am

OK, well that had me baffled, and honestly still does. I see no reason why that won’t work.

However, until a more seasoned developer laughs and tells us why, I have an alternative solution:

<?php
$test = $data->attendee->total_cost;
$test2 = "0.00";
if($test === $test2) { echo "yes"; } else { echo "no"; }
?>

This grabs the value from the main array and uses that instead.

Viewing 1 reply thread

The support post ‘String comparison not working for cost in ticket template’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso - Staging Server