Problem with php if else loop

I am new to coding.
I am trying to get a different text on one of my button if the field is empty. The original code is:

<?php if ( $clpr_options->coupon_code_hide ) {
$button_text = fl_get_option( ‘fl_lbl_show_coupon’ );
$button_text = ‘<i class=”icon-lock”></i>’ . $button_text;
$class .= ‘ coupon-hidden’;
}
?>

now I changed it to:

<?php if ( $clpr_options->coupon_code_hide ) {
$button_text = fl_get_option( ‘fl_lbl_show_coupon’ );
$button_text = ‘<i class=”icon-lock”></i>’ . $button_text;
$class .= ‘ coupon-hidden’;
} else {
$coupon = get_post_meta( $post->ID, ‘clpr_coupon_code’, true );
$coupon == ”;
$button_text = ‘Angebot anzeigen’;
}
?>

however it does not change the content it still shows the first if need some help.

Read more here:: Problem with php if else loop

Leave a Reply

Your email address will not be published. Required fields are marked *