This rewrite.script has been configured for WordPress: RULE_0_START: # get the document root map path into SCRATCH:DOCROOT from / # initialize our variables set SCRATCH:ORIG_URL = %{URL} set SCRATCH:REQUEST_URI = %{URL} # see if there are any queries in our URL match URL into $ with ^(.*)\?(.*)$ if matched then set SCRATCH:REQUEST_URI = $1 set […]
Category: WP Tutorials
Add a custom currency / symbol
Posted onAdd this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. /** * Custom currency and currency symbol */ add_filter( ‘woocommerce_currencies’, ‘add_my_currency’ […]
Minimum Order Amount
Posted onAdd code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. /** * Set a minimum order amount for checkout */ add_action( ‘woocommerce_checkout_process’, ‘wc_minimum_order_amount’ […]
Change a currency symbol
Posted onAdd code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme. /** * Change a currency symbol */ add_filter(‘woocommerce_currency_symbol’, ‘change_existing_currency_symbol’, 10, 2); function change_existing_currency_symbol( […]
Rename a country in WooCommerce
Posted onAdd this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file, as this will be wiped entirely when you update the theme. /** * Rename a country */ add_filter( ‘woocommerce_countries’, ‘rename_ireland’ ); function rename_ireland( […]
Hide other shipping methods when “Free Shipping” is available
Posted onOverview By default, WooCommerce will show all shipping methods that match the customer and the cart contents. This means Free Shipping will also show along with Flat Rate and other Shipping Methods. The functionality to hide all other methods and only show Free Shipping requires either custom PHP code or a plugin/extension. If you’d like to see this feature added […]