Categories
Snippets

WooCommerce – Hide price suffix when product is not taxable.

Categories
Snippets

WooCommerce – Redirect external products offsite (disable single listings)

Categories
Snippets

WooCommerce – remove payment method from emails

Categories
Snippets

WooCommerce – Hide shipping rates when free shipping is available.

Categories
Snippets

WooCommerce – Add all upsells of a product to the cart via custom link

Categories
Snippets

WooCommerce – enable free shipping only if product class is found in cart.

Categories
Snippets

WooCommerce – Remove product data tabs and hook content in sequence instead

Categories
Snippets

WooCommerce – Change number of displayed upsells on product pages

Categories
Snippets

Showing quantity inputs in WooCommerce loops

Here is a quick snippet showing how you can add quantity inputs to WooCommerce loops for simple products. This used to be only possible through template edits, but is now doable through filters because they are magic.

The end result:

2016-04-21 at 18.21.png

Categories
Snippets

Github to WordPress.org deploy script

Today I polished, documented, and open sourced a bash script I’ve been using to do plugin deployments from Github to WordPress.org (plus I wanted an excuse to use the new WordPress.com desktop app which is awesome by the way). It’s based on code Barry Kooij sent me a while back. You can find it here:

https://github.com/mikejolley/github-to-wordpress-deploy-script

It handles Github tagging, removing junk files, and SVN tagging with minimal effort. It also has a quick checklist to stop you forgetting to set things in the readme.txt like the stable version (I’ve been guilty of forgetting this in the past).

Once downloaded to your machine, the script requires a Github access token, and a few edits to tell it which plugin you’re deploying.

After you’ve added the details specific to your project, you simply need to open it’s parent directory in terminal, and run the command:

sh release.sh

It then prompts you for a version, branch, and handles the deployment process.

demo

The above demo is from a release of WP Job Manager I did today showing it working nicely. Hope it’s useful!