mercredi 22 juin 2016

two forech loop on if statement

Wondering if it's possible to have a foreach loop call on if statement like this :

    if ( class_exists( 'WooCommerce' ) ) { 
        foreach ( array_combine($val1, $val2) as $key => $row_values )
     }else{
    foreach ( $val1 as $key => $row_values ) 
}
{ begin of loop code

What i'm trying to do is to have a foreach loop if woocommerce plugin is active and to have another foreach loop if woocommerce isn't active

Aucun commentaire:

Enregistrer un commentaire