Change WooCommerce price and currency without a plugin

I’ve tried many currency plugins for WooCommerce, but none of them worked well. Some of them were not compatible with coupons, WooCommerce Subscriptions or poorly coded, so I decided to write a tiny WordPress plugin to change the price and currency based on the billing country.

What it does?
1. If the billing country is not “DE” (Germany), then it gets the price from a custom field “regular_price_usd”, which is created by ACF plugin.
2. If the billing country is not “DE” (Germany), then it changes the currency to USD.
3. If currency is USD, disables TAX calculation.

Can be easily adopted to use more countries and currencies. You can also implement GeoIP and change prices by IP location or browser language on the fly.

Price in USD for WooCommmerce
Price in USD after changing the currency

Simple AJAX posts filter by category and publish date for WordPress

The first thing you need to do is to write some HTML for category and publish date select box. This can be added to a custom template or your home page index.php file.

Now, when we have HTML ready, we also need to show some latest blog posts.

Create a file called content-post.php in template-parts directory. If this directory doesn’t exist, then create it. We’ll be showing the title of the post and linking to it.

Add this JavaScript code to your theme’s javascript file. This code filters out the posts by category and publish date under AJAX. The request is sent to ajax_filterposts_handler PHP function, then response is delivered by JavaScript (jQuery).

Finally, the PHP part. Add this to your functions.php file.