Snippets

WooCommerce – Output a simple, printable stock/inventory report

Another user request today to output a list of products, as well as their stock levels, to be used to compare the amount of real stock in hand with what WooCommerce thinks is in stock.

The code below can be added as a page template in your theme. Once added to your template, just create a page in WordPress admin and assign it the “Stock Report” page template.

Theres a check at the top of the page to only let admin users in, and when viewed the page will give you a simple list of products, SKU’s and stock levels which you can then print out.

I hope you find it useful :)

Debugging with WP_DEBUG_LOG

The constant WP_DEBUG_LOG is something I’ve only recently discovered — when added to wp-config.php it enables a log of WordPress errors and notices to be saved to wp-content/debug.log.

define( WP_DEBUG_LOG, true );

This is very handy when debugging plugin errors, especially hidden ones like those which occur on plugin activation.

WooCommerce: Output a printable list of processing orders

Someone requested a way to print out a list of their processing orders for WooCommerce so I came up with a snippet to do so :)

The code below can be added as a page template in your theme. Once added to your template, just create a page in WordPress admin and assign it the “Print processing orders” page template.

Theres a check at the top of the page to only let admin users in, and when viewed the page will give you a nice list of processing orders which you can then print out.

HTML5/CSS3 (and a little jQuery) strength indicators

Want an easy way to add a password strength indicator without extra markup? Try the following method – it used a small chunk of jQuery code to assess the strength and then displays it using some nifty css3 styling.

Cool? No extra markup is needed, and there’s very Javascript code too making this a nice lightweight enhancement.

Continue reading →