Unable to call woocommerce hook in my custom php file

You are doing it all wrong, place your code like the following in your file. <?php echo ‘hook called’; // This is not showing any message exit(); global $woocommerce; $product_id = $_POST[‘selected_package_id’]; echo $product_id; // This is not displaying id exit(); $found = false; //check if product already in cart if ( sizeof( WC()->cart->get_cart() ) … Read more

Send Email to Custom Field in Custom Post Type when order is Completed

How to debug Step 1 add_filter( ‘woocommerce_email_headers’, ‘enyc_order_completed_email_add_cc_bcc’, 10, 3 ); function enyc_order_completed_email_add_cc_bcc( $headers, $email_id, $order ) { // CHANGE EMAIL $partnerEmail=”[email protected]”; $headers .= ‘Cc: Name <‘.$partnerEmail.’>’ . ‘\r\n’; // del if not needed $headers .= ‘Bcc: Name <[email protected]>’ . ‘\r\n’; // del if not needed return $headers; } Step 1 works? -> step 2 … Read more