A Guide to the WooCommerce wc_get_template Function

What Does the WooCommerce wc_get_template Function Do? The wc_get_template function can be used to display the contents of template files. The function allows you to pass values into the templates which can then be displayed as part of the template. The function also allows templates to be over ridden either in themes or plugins. A … Read more

What Does <?=?> (Question Mark Equals) Do In PHP?

Some times when looking at WordPress or WooCommerce code you might see something like this <?php $value = “Hi there!”; ?> <div>     <strong><?=$value?></strong> </div> The very simple example above would render the following to the screen So what is the  <?=$value?> code doing? From the example above you might have worked out that &lt;?=$value?&gt; is shorthand for writing … Read more

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