Uncheck default “Ship to different address” on woocommerce checkout using functions.php

Posted by on Mar 19, 2018 in Blog, PHP, Woocommerce | No Comments

“Ship to different address” is the default setting on woocommerce checkout. There has been much discussion about why this is or is not a good idea. See this thread https://github.com/woocommerce/woocommerce/issues/2571 As we all know, in the end though the client rules, and this is what my client had to say. The “ship to a different […]

get_dimensions() for displaying dimensions deprecated in woocommerce 3

Posted by on Jun 15, 2017 in Blog, PHP, Woocommerce | No Comments

The code to display product dimensions has changed in woocommerce 3 This is my old code which was in my child themes functions.php file. It displayed the product dimensions next to the label ‘Dimensions:’ on the single product page only if dimensions had been entered in the backend. If no dimensions were entered nothing appeared […]

Add a giftwrap checkbox and instruction field to your child theme woocommerce

Posted by on Dec 31, 2016 in Blog, E-Commerce, Woocommerce | No Comments

Code for a giftwrap checkbox and input field on woocommerce checkout This code will add a checkbox and input field to woocommerce checkout. It will also add it to the orders page in the backend AND the thank you page after checkout PLUS the email the customer receives after ordering. It took me a while […]

De-minify that block of minified CSS to make it readable

Posted by on Oct 22, 2016 in Blog, CSS, Themes | No Comments

De-minify that eye destroying block of minified CSS in your themes style.css to make it readable. have you ever come across this when for example trying to build a child theme in WordPress. The master theme has a minified CSS file. All of the blank space and returns have been removed to make it a […]

Add login and logout to menu for woocommerce

Posted by on Mar 30, 2015 in Blog, E-Commerce, Woocommerce | No Comments

There are a couple of ways you can do this. I like this as it adds the login and logout as 1 menu item, the state of which changes if the user is logged in or not. The code below is from a git, Credit to Kloon. I made a slight update as “woocommerce_get_page_id” is […]

Add the stock status to Woocommerce Shop and Category pages

Posted by on Aug 7, 2014 in Blog, PHP, Themes, Woocommerce | 5 Comments

Woocommerce displays the Stock Status, for example ‘Out of stock’ or ‘6 in stock’ on the single product page. I needed to display the message on the Shop and Category pages. Also my client actually only wanted to display the status when a product was ‘Out of stock’ Thanks to Bryce from Woocommerce for help […]

Returning Arrays in PHP, a simple example

Posted by on Aug 7, 2014 in Blog, PHP, Themes, Wordpress | No Comments

This one is just a little post for myself really. It may be handy for someone else. WordPress will often store data in Array in PHP. When you go to return something back by name you just get the result ‘Array’ Not very helpful. First to create the array To return all of the items […]

CSS for using small caps, text figures etc. font-feature-settings

Posted by on May 21, 2014 in Blog, CSS, Wordpress | No Comments

Credit This is not so much an article as a handy store of this information for myself. There are specific situations where small caps and text figures are appropriate. For a discussion of that see this excellent article by Dmitry Fadeyev from which this code was extracted for my use. This may not be the […]

Changing URL’s in your database after migrating a WordPress site

Posted by on Apr 29, 2014 in Blog, Wordpress | One Comment

The problem After you migrate a site to a new location or use WordPress Export/Import to import some posts to a site the URL’s of files such as images still point to the original site. After migration the task is to update all the posts and custom fields to the URL of the production site. […]