Yes. Use Shipping country, Shipping state, Shipping postcode or Shipping zone (the Checkout - Address conditions) in cart discounts, checkout fees and, since Pricepep 2.6.0, product pricing rules. Examples: a cart discount "EU spring offer", Percentage discount 5, with Shipping country in list Germany, France, Italy; or a product pricing rule with the same condition, to lower the shop prices themselves for customers in those countries.
Which address is used?
The shipping address WooCommerce keeps for the customer:
- the address they entered in the cart's shipping calculator or at checkout;
- a logged-in customer's saved address;
- for new visitors, WooCommerce's Default customer location (WooCommerce > Settings > General), which can be the shop's country or a country found by geolocation.
So discounts and prices can change when the customer enters their address. Pricepep doesn't look up locations itself.
Can shop prices differ by country?
Yes, since 2.6.0: add the address condition to a product pricing rule's Conditions.
- Where these prices show: in the cart and the checkout always, and in the volume pricing table (Bulk and Tiered pricing rules) whenever it's on. On shop and product pages and in the Store API (block themes, headless shops) only with Change display prices in shop set to a Change option, and with Change - Include simple adjustments only for Simple adjustment rules. See prices shown vs charged.
- Before checkout: to show prices by country to new visitors, set Default customer location to Geolocate, or to Geolocate (with page caching support) on stores with page caching. With the shop's country as the default location, new visitors see that country's prices until they enter an address. With No location by default they have no address yet: country, state and postcode rules with not in list or does not match apply to them, those with in list or matches don't, and Shipping zone sees Locations not covered by your other zones.
- Address changes: when the customer changes the address in the checkout (classic or block), prices update in the same step.
- Without a visitor, such as a product feed built by WP-Cron, there is no address: rules with in list or matches don't apply, and rules with not in list or does not match do. WP-CLI commands run as their
--user(whichwp wccommands need), with that user's address, or without it as a new visitor at the store's default customer location; WP-Cron events run withwp cron event runcount as WP-Cron: no address. - Google Merchant Center: the feed price must match the product page. Write country rules with in list, use a separate feed per country, or have a developer leave such rules out while the feed is built.
- Speed: while any active product pricing rule has an address condition, Pricepep calculates every product's shop price on each page view, for every visitor, instead of using its shop price cache. On large catalogs, keep such rules few.
- Page caching: a full-page cache would show one visitor's prices to others: use Geolocate (with page caching support), or keep shop and product pages out of the page cache. That option separates cached pages by the billing address, not the shipping address these rules read: if many orders ship to another address, leave those pages uncached.
Before 2.6.0, product pricing rules didn't have these conditions: there, use a cart discount instead.
How do postcode patterns work?
Shipping postcode accepts several postcodes separated by commas, * for one character (902**) and ranges (90200-90299 or, since 2.6, 90200...90299). Range numbers are compared by value whatever their lengths, so 800-899 includes 0820. Since 2.6 postcodes with a country code or a dash, and different spacing, match too: "LT-12345", "LT12345" and "12345" are the same. A US ZIP+4 code (90210-1234) matches a range by its first five digits; for an exact code or a * pattern, add the 9-digit form too, such as 90210****. An entry such as 604-8005 is an exact postcode for a customer whose postcode is written the same way (Japan), but a range for other customers: add a Shipping country condition or write it as 6048005. More in checkout conditions.