• Resolved marcus1w

    (@marcus1w)


    Is it possible to add this following code but adjust it to a specific WooCommerce product ID?

    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter marcus1w

    (@marcus1w)

    Thread Starter marcus1w

    (@marcus1w)

    function action_woocommerce_single_product_summary() {
        global $product;
        
        // Set Id's
        $product_ids = array ( 30, 815 );
        
        // Is a WC product
        if ( is_a( $product, 'WC_Product' ) ) {
            // Get productID
            $product_id = $product->get_id();
            
            // Product Id is in the array
            if ( in_array( $product_id, $product_ids ) ) {
                // Remobe
                remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
            }
        }
    }
    add_action( 'woocommerce_single_product_summary', 'action_woocommerce_single_product_summary', 4 );

    Solved it

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove hooks on specific page’ is closed to new replies.