My web development blog collects posts I’ve made solving problems for my clients. There’s hints, tips and code snippets for all the open source frameworks I work with: WordPress, WooCommerce, OpenCart, Drupal, Magento and more. If you have a web development question, get in touch or post a question in the comments, I’ll try my best to help.
Build a WordPress currency convertor with rates from the Open Exchange Rates API
Learn how to build a simple Ajax currency convertor tool for WordPress, retrieving exchange rates from Open Exchange Rates.
Output a Bootstrap grid from an ACF repeater field
Output a Bootstrap grid from an ACF repeater field elegantly using the array_chunk method.
Create ACF field programmatically permanently in the database
How to create an ACF field in code which is permanently created in the database and editable in the admin UI.
WooCommerce make UK county checkout field required
I was recently tasked with setting the County (billing_state / shipping_state) fields in the WooCommerce checkout to be required fields. The standard way to override these billing and shipping fields is to use the woocommerce_billing_fields...
Strip shortcodes from WordPress posts
A regular expression to remove a particular shortcode from WordPress posts using search and replace, while leaving the content intact.
WordPress post content search and replace in the database using SQL
Perform a bulk search and replace of WordPress post content using an SQL query in the database. And find out about alternative methods.
WooCommerce hook on product updated or added
WooCommerce doesn’t provide a hook which runs when a product is saved or updated in the admin. Find out which WordPress hooks to use for this action.
Create WooCommerce coupons programmatically
Create a WooCommerce coupon in code using the woocommerce_get_shop_coupon_data filter. Useful for validating a coupon with an external API.
Debug WordPress by logging hook calls
Learn how to log every action and filter hook call in WordPress. Identify which processes are running and which are resource intensive and need optimising.
WorldPay Business Gateway for OpenCart 2.x
From OpenCart version 2.0.2.0, the built in WorldPay payment gateway no longer takes transactions for WorldPay Business Gateway, but was changed to connect to WorldPay Online Payments API. Find out how to install the old gateway on newer versions of OpenCart.
Lightweight social share buttons for Divi theme
Add a set of social sharing buttons to your Divi theme, without installing a plugin and using the built in icon set.
Divi hide “no results found” message for blog module
Divi’s blog module displays an ugly “No results found” message for empty categories. Find out how to hide this message.