Conditional button in meta.php file
-
Hi Guys I’m trying to insert a condition in single-product meta.php file. I’m trying this script
function conditional_link() { global $post, $product; $categ = $product->get_categories(); if ( $categ = "Stampanti 3D") { $z = 'PREVENTIVO'; echo '<div><a href="https://www.mario.it"><button type="button" class="btn" id="single-quote">'. $z; '</button></a></div>'; } else { echo '<div><a href="https://www.luigi.it"><button type="button" class="btn" id="single-quote">'. $z; '</button></a></div>'; } } add_action( 'woocommerce_product_meta_end', 'conditional_link', 15 );
but it doesn’t works. Can anyone help me? Please
thanks in advance
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Conditional button in meta.php file’ is closed to new replies.