We’re always looking for new solutions that work with the Geotargeting Pro plugin to add extra features to our customers’ websites. Today, we’re excited to tell you how to use Geotargeting Pro with the popular WooCommerce Product Table plugin.
More and more WooCommerce websites are seeing increased sales after switching to a product table layout for their store pages. A product table can boost your sales because it lists more products per page, with extra data about each product and ‘quick find’ features such as filters and search box. It speeds up the buying process because customers can choose quantities and variations, and add to the cart without having to click through to the single product page.
However, the WooCommerce Product Table plugin is normally listed to display the same products to all customers – wherever they are in the world. By combining it with our own Geotargeting Pro plugin, you can get all the benefits of product table layouts, as well as the benefits of showing different products based on each customer’s location, city, country or region.
How to Create a WooCommerce Product Table
First, I’ll tell you how to create a product table listing all your products. You’ll need the WooCommerce Product Table plugin for this. Once you’ve done this, I’ll reveal how to make the WooCommerce product table dynamic so that different products appear to different users based on their country, region, city or state.
- Get WooCommerce Product Table and install it on your website.
- In the WordPress admin, go to WooCommerce > Settings > Products > Product tables. Enter your license key and configure the settings to control how your product tables will look. There are settings relating to all aspects of the table such as choosing your columns, number of rows per page, whether to add search filters above the table, how the tables behave on mobiles, and more.
- Next, create a page where you want to add your country-specific product tables and add the shortcode
[product_table]
. This will list all your products in a table, or alternatively you can show specific products only.
How to Use Geotargeting to Make Your Product Tables Country-Specific
So far, I’ve told you how to create product tables listing WooCommerce products. At this stage, your product tables list the same products to all your customers, regardless of their location. Next, I’ll tell you how to make your WooCommerce product tables country-specific. Hint: You’ll need the Geotargeting Pro plugin for this:
- Sign Up for Geotargeting WP.
- Log into your account and get enough credits to download the plugin and start using the geotargeting API.
- Copy your API Key and API Secret from the API Keys section of your Geotargeting WP account. At the bottom of this page, enter the domain where you will be using the plugin.
- Next, download the plugin and install it on your WordPress site.
- In the WordPress admin, go to GeoTargetingWP and paste in your API Key and API Secret. Click ‘Check license’ to activate the plugin’s features.
- If you want to restrict products to users based on their country, skip to the next section. If you want to restrict products based on groupings of multiple countries or city, then scroll down to create your regions and cities:
- In the ‘Countries’ section of the settings page, add the name of the region first. This is just a label for your internal use; customers won’t see it. Next, enter the countries that you wish to include in the regional grouping. Do this for each of the regions. For example, you might want to create a region for each continent.
- In the ‘Cities’ section, add a self-explanatory label that will help you select the city for each product. Next, select the country that the city is in. Start typing the city into the box below, and then select the city name from the list that appears.
- Scroll down and save the Settings page.
- Next, go to the Edit screen for each of the products for which you wish to add country/region/city based restrictions in your WooCommerce product tables. Scroll down to the ‘GeoTargeting Options’ section, which you’ll find below the ‘Product Data’ section. Select the location(s) that you do or don’t want the product to appear in. To hide the product from the WooCommerce product table, you also need to tick the ‘Remove post from loop’ box.
- Repeat Step 8 for each of the country-specific products where you need to use geolocation.
See the GeoTargeting Pro documentation for more detailed instructions.
Test Your Geotargeted WooCommerce Product Tables
As with any geolocation plugin, you need to test that your country-specific product tables are working correctly. This is really important to ensure the correct users see the correct products for their country or region.
To test it, set one of the products in your product table is set to be either visible or invisible for your country/city/region. View your WooCommerce product table and make sure the product’s visibility is correct based on your current location. Now change the visibility for that product (so if it was visible for your location before, hide it now – or vice versa).
Refresh the WooCommerce table and see if the product appears/disappears.
If the geolocation isn’t working as expected, here are some things to check. The country-specific products will only work correctly in the product table if you set it up as follows:
- Use the standard version of WooCommerce Product Table and do not enable the AJAX/lazy load option.
- On the Geotargeting Pro settings page, do not tick the AJAX option because WooCommerce Product Table only works with the non-AJAX option.
- You’ll also need to disable caching on the pages where you’re using product tables, e.g. if you’re using a caching plugin or if your host uses caching.
If that doesn’t fix the problem, reach out to Geotargeting Pro plugin support for assistance.
How to Create Country-Specific Categories
WooCommerce Product Table has a feature that lets you create product tables listing products from specific categories only. You can use this with the shortcodes built into Geotargeting Pro to add geolocation to entire categories.
Here’s how to do it:
- Instead of using the plugin to restrict individual products based on their location, create a category for each country that you wish to create a product table for. (You don’t need to georestrict the category at this stage – you’ll do this through a shortcode in a minute.)
- Add products to the category.
- Next, create a WooCommerce product table for each of your country-specific categories. To do this, add the shortcode
[product_table category="italy"]
. Replace “italy” with the country that the category will be available to. - Next, wrap the Geotargeting Pro shortcode around the product table shortcode you just created. Here are some examples:
- The following combination of shortcodes will create a product table listing products from the ‘UK’ category which is only visible to users in the UK:
[geot country="GB"][product_table category="GB"][/geot]
- These shortcodes will create a WooCommerce product table which will be visible to all countries in the world except from the US:
[geot exclude_country="US"][product_table][/geot]
. This is useful if you sell most of your products worldwide but need to exclude specific countries due to legal restrictions.
- The following combination of shortcodes will create a product table listing products from the ‘UK’ category which is only visible to users in the UK:
- Repeat these steps for each of the countries that you need to use geolocation for. You can add as many product tables as you like to the page, each visible to a specific country or region. Think carefully about the logic in your shortcodes, and you can ensure that each customer will only see one product table – however many you add to the page.
Next Steps
That’s everything you need to know in order to use WooCommerce geolocation within a product table layout. Together, the plugins work together to increase your store’s conversion rate, while geotargeting your products so that each customer sees the correct items based on their location.
Leave a Reply