-1

In a Woocommerce Product Page I need to remove the Variation Select Lists from the default placement and show them y my custom hook:

"flatsome_custom_single_product_3"

How can I do this?

I tried with this, but not working.

   remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10 );
   add_action( 'flatsome_custom_single_product_3', 'woocommerce_single_variation', 10 );

Take a look at this capture to see what I mean:

enter image description here

Ruvee
  • 8,611
  • 4
  • 18
  • 44
JPashs
  • 13,044
  • 10
  • 42
  • 65

1 Answers1

0

You could first remove the default variation and then add your own using the following hook:

remove_action('woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30);

add_action('woocommerce_variable_add_to_cart', 'custom_variable_div', 15);

add_action('woocommerce_variable_add_to_cart', 'woocommerce_single_variation_add_to_cart_button', 20);

function custom_variable_div(){
    # Make up your own stuff
}

I've tested it and it works seamlessly fine!

Ruvee
  • 8,611
  • 4
  • 18
  • 44
  • Where do I set my custom hook "flatsome_custom_single_product_3" ? – JPashs Jan 27 '21 at 19:11
  • replace ```custom_variable_div``` with your own ```flatsome_custom_single_product_3``` – Ruvee Jan 27 '21 at 19:23
  • Really? Interesting, haaa? Well, were you able to remove the default variation section? – Ruvee Jan 28 '21 at 12:46
  • The only thing I could think of, is your custom function! Does your custom function output anything? like html content? – Ruvee Jan 28 '21 at 12:47