Additional button on product page (WooCommerce / WordPress)

0

I searched for a plugin to insert an additional button on the WooCommerce product page, but did not find it. Could someone give me a light on how I can do this? It needs to work EXACTLY as on this page:

link

I need one button to ask for a quote, and the other to open a popup with an iframe from a specific product URL (the above page does this through product panel).

I kind of found a way to add the 2nd button through the fuctions.php file of my theme. Here is the code:

add_action( 'woocommerce_single_product_summary', 'my_extra_button_on_product_page', 30 );

function my_extra_button_on_product_page() {
  global $product;
    echo '<button type="submit" class="single_add_to_cart_button button alt">Configure o Seu Detector</button>';
}

Now, come the following question: I can not put this button on ALL pages. Only some devices are "configurable, and those are, I need to include an iframe in the product for the button to be enabled."

Would you have to add a field to this URL in the product edit form, and put a "select box" to activate that second button?

Once again, thank you all.

    
asked by anonymous 08.04.2017 / 04:38

1 answer

0

I got it using the Popup Builder plugin. It generated a shortcode, and I simply put that code in the brief description of the product, just below the text. It was next to the "Buy / Request Budget" button, then it resolved to me. I think there are other ways to do it, but I'm not a programmer = /

Thank you all.

    
10.04.2017 / 02:24