Barry Hughes WordPress Developer

You are browsing posts tagged “woocommerce”.

No SSL, thanks

9 July 2019 (updated 9 July 2019)

I love my HTTPS as much as the next person, but for local dev purposes it can be handy to disable this in the context of working on a WooCommerce project.

To that end…adding the following bits of code can be helpful.

add_action( 'init', function() {
	remove_action( 'template_redirect', [ 'WC_HTTPS', 'force_https_template_redirect' ] );
} );

The above should be added to a (mu-)plugin, accompanied by the following in the site’s (wp-)config.php file:

define( 'FORCE_SSL', false );
define( 'FORCE_SSL_ADMIN', false );
define( 'FORCE_SSL_LOGIN', false );

Of course, this is for ease of local development only.

Am I in Sandbox Mode? (Braintree|WooCommerce)

10 April 2019 (updated 11 April 2019)

Setting up a test environment to use a Braintree sandbox account is pretty straightforward and is well documented.

However, once done there are no visual flags within the Settings → Payments → Braintree screen to indicate that one is indeed in “sandbox mode” (or the reverse, that one is in production mode). Occasionally, though, there can be a need to quickly confirm that this is the case and, when that happens, there are a couple of easy things you can do: