Child Product Action remove and add action

Child Product Action remove and add action


function child_product_actions()
{
	add_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 11);
	add_action('woocommerce_single_product_summary', 'woocommerce_gzd_template_single_price_unit', 11);
	add_action('woocommerce_single_product_summary', 'woocommerce_gzd_template_single_legal_info', 12);
    
    
    add_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 14);
    
	remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 21);
	remove_action('woocommerce_single_product_summary', 'woocommerce_gzd_template_single_price_unit', 21);
	remove_action('woocommerce_single_product_summary', 'woocommerce_gzd_template_single_legal_info', 22);
	remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
	remove_action('woocommerce_before_single_variation', 'woocommerce_template_single_price', 20);
	remove_action('woocommerce_before_single_variation', 'woocommerce_gzd_template_single_legal_info', 21);
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 10);
    if (function_exists('tzn_product')) {
        add_action('woocommerce_single_product_summary', [tzn_product(), 'display_product_key_features'], 13);
        remove_action('woocommerce_single_product_summary', [tzn_product(), 'display_product_key_features'], 11);
        remove_action('woocommerce_single_product_summary', [tzn_product(), 'product_meta'] , 27);
        remove_action('woocommerce_before_single_variation', [tzn_product(), 'product_meta'] , 27);
    }
}
add_action('woocommerce_before_single_product', 'child_product_actions', 25);

Leave a Reply

Your email address will not be published. Required fields are marked *