WooCommerce and Webhooks

The webhook system of WooCommerce, which is present since a few versions ago, got a good web interface to manage creation and interaction with hooks. For whom do not know what webhooks mean, we can summarize like:

 

It is a mechanism that you can monitor notification of systems, by using an API, usually allowing to register an URL which runs a program to interpret the received notifications.

 

With this system, it is possible to monitor events ocurred on WooCommerce. For example, we can monitor new orders and send alerts for sales team to get in touch (it was only a simple example, there is many actions available to monitor).

You can check the full documentation here: http://docs.woothemes.com/document/webhooks/.

Enable CORS for Nginx

Whom have worked with cross-origin HTTP requests knows that one of the actions to make this working is enable CORS in API’s webserver .

As I work with Nginx, the code that warns browsers (Firefox e Chrome) and allow pre-flight requests is presented below:

https://gist.github.com/6398833248000894b05b

The flow of this browsers is: making a pre-flight request to test the webserver, before making the real request. The code above allow the cross-origin request flow goes ahead. You will need to implement this code between “location” block.

More informations in Enable CORS and here. Hope this useful.

 

Hide tabs from product page on WooCommerce

Hello guys. This is another quick article with a tip of WooCommerce. Sometimes we don’t want show the tabs of the product page on WooCommerce. To hide them, you need to put the code below at your functions.php file theme’s:

https://gist.github.com/e82f35156dc84741eab0

Hope it will be usefull. See you later.