Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying WooCommerce Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
WooCommerce Cookbook

WooCommerce Cookbook

By : Rauland
3.4 (12)
close
close
WooCommerce Cookbook

WooCommerce Cookbook

3.4 (12)
By: Rauland

Overview of this book

If you have ever built or managed a WordPress site and want to add e-commerce functionality into your site, WooCommerce and this book are perfect for you. Learning how to use WooCommerce through this series of recipes will give you a solid platform to add any future e-commerce needs.
Table of Contents (12 chapters)
close
close
11
Index

Setting a post code for correct taxation with the Local Pickup setting


If you're selling to people in different parts of the country or the world, you normally base the tax on the location of the customer. For that reason, you don't normally have to set your own zip code or city. But if you sell to people outside your city most of the time, but also have the Local Pickup shipping method selected, then you'll need to set your zip code and city.

How to do it…

This is an edge case, so there isn't any way to do this in the admin. You have to do this with some custom code, using the following steps:

  1. Open your theme's functions.php file, located under wp-content/themes/your-theme-name/, or create a custom WooCommerce plugin.

  2. At the bottom of the file, enter the following lines of code to set your city:

    add_filter( 'woocommerce_countries_base_city' , 'woocommerce_cookbook_countries_base_city' ); 
    function 'woocommerce_cookbook_countries_base_city'() { 
        // Replace with your store town/city 
        return...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete