WooCommerce: How to get a Customer Details from an Order

I was asked a question the other day about retrieving a user’s details from an order programmatically, since WooCommerce 3.0 it is reasonably easy to extract a user’s details but there are a number of methods that can be used and  we also need to consider how WooCommerce stores address data for the “My Account” … Read more

WordPress/Woocommerce: How To Get The Original Url Before It’s Rewritten

WordPress has it’s own rewrite API which it uses to prettify URLs, to give a specific WooCommerce example the shop URL http://wooexp.local/shop/ can be rewritten as http://wooexp.local/index.php?post_type=product If you type the URL above into a browser (changing the host from the I’m using on a Local by Flywheel test site to your site) then you … Read more

Using is_single() in WooCommerce

If you’ve ever done any coding in WordPress then you may have used the is_single() function, it’s super useful for finding out if you’re on a specific single post page function hwn_filter_content_using_issingle($content) { if( is_single(35) && is_main_query() ) { $new_content = ‘<p>This bonus content is added to the bottom of post 35.</p>’; $content .= $new_content; … Read more