I have this code, and the following, I need to print or hide a button according to the foreach result, example if it is empty I want it to hide the button, if there is any item it shows the button.
<?php
foreach( $types_list as $single_type ) {
$yith_wapo_frontend->printSingleGroupType( $product , $single_type );
}
$product_id = yit_get_base_product_id( $product );
$product_display_price = yit_get_display_price( $product );
?>
</div>
<button class="btn2" data-dismiss="modal" aria-hidden="true">Concluído</button>
</div>
<?php
$var = $product_id;
if( $var >= 1 ) {
echo "<a href='#myModal' role='button' class='btn' data-toggle='modal'>Quero Personalizar</a>";
} else if ( $var = 0 ) {
echo "<a hr
ef='#myModal' role='button' class='btn' data-toggle='modal' style='display:none'>Quero Personalizar</a>";
}
?>