Allow backorders for certain products in WooCommerce

Using this code snippet you can allow backorders for certain products.

How to modify the WooCommerce API orders response?

How to create a callback URL in WooCommerce

I was working on a payment gateway for WooCommerce and had to create a special URL that will then load the specified class method. Sometimes the information does not reach all parties e.g. if you close the browser and the status of the payment between the payment’s and merchant’s server remains unclear. The WooCommerce API […]

WooCommerce REST API – Import products from JSON

I had a task to create a PHP script to import simple and variable products from JSON file using the WooCommerce REST API. Thought it might be worth sharing with others because I couldn’t find much information about products import from JSON using the API.

How to add custom product sorting options in WooCommerce

By default, WooCommerce comes with 6 sorting options. In this example, I’ll add an extra option to sort by sale status. However, if your sorting needs are more advanced, then you can hook into pre_get_posts instead of woocommerce_get_catalog_ordering_args.