Ecomm - Troubleshooting
WooCommerce post webhook returns 405 error
Webhook triggers but returns error "Error 405--Method Not Allowed". This is due to the user agent being set to the WooCommerce default value "WooCommerce/<version_no> Hookshot (WordPress/<version_no>)" which is rejected by Netsuite.
- FTP into your wordpress account.
- Navigate to the "plugins" directory.
- Locate the woo-commerce directory and navigate to the "includes" directory.
- Edit the file 'class-wc-webhook.php'. Locate the string 'sprintf( 'WooCommerce/%s Hookshot (WordPress/%s)', WC_VERSION, $GLOBALS['wp_version'] )' .
- Replace this string with 'Mozilla/5.0 (Windows NT x.y; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0' . Please note that the quotation is part of the string.
- Save and upload your changes.