child theme - remove_action() hook not working

admin2025-01-07  5

On my child theme,

I created this:

remove_action('woocommerce_single_product_summary','woocommerce_template_single_excerpt',20);
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt',30);

The add_action is working, but not the remove_action

What happens is, the woocommerce_template_single_excerpt gets duplicated with the add_to_cart in the middle of the two.

I am using shopkeeper theme in woocommerce. I hope someone can help.

On my child theme,

I created this:

remove_action('woocommerce_single_product_summary','woocommerce_template_single_excerpt',20);
add_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt',30);

The add_action is working, but not the remove_action

What happens is, the woocommerce_template_single_excerpt gets duplicated with the add_to_cart in the middle of the two.

I am using shopkeeper theme in woocommerce. I hope someone can help.

Share Improve this question edited May 18, 2017 at 8:12 fuxia 107k38 gold badges255 silver badges459 bronze badges asked May 18, 2017 at 8:01 ibubibub 11 silver badge1 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

Actions (and filters) can be removed only after they had been set, therefor you will have to figure out when in the execution path the woocommerce_template_single_excerpt is being added, and remove it only after that.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736262051a788.html

最新回复(0)