One WooCommerce catalogue, sold in several cities at prices that are not the same in each. This extension adds the region as a dimension of the shop rather than as a second copy of it, and it is published as open source under GPL‑3.0.
Source, issues and releases: github.com/kostyasorokin/wc-regional-catalog
The problem it solves
The usual answer to regional pricing is to duplicate the product, once per city. The catalogue then grows by a factor of the number of cities, every edit has to be made that many times, and the two copies drift apart within a month.
Here a region is a taxonomy on the product, and the regional price is a value beside it. One product, one description, one stock figure — and a price that depends on where the visitor is looking from.
How the region is decided
Rewrite rules put the city in the path — /shop/kharkiv/product-name/ — and product permalinks are rewritten to stay inside it. A URL is therefore a complete instruction: it says both what is being looked at and where from, which is what makes a regional page indexable at all.
The address wins when it names a region. Otherwise a cookie holds the last choice, so a visitor who arrived through a city page keeps it while browsing the rest of the shop.
Where the price comes from
The regional figure is applied through WooCommerce’s own price filters rather than by writing over the product. Because everything downstream reads the price through those same filters, the cart and the checkout follow without knowing the extension exists.
Filtering the catalogue is a taxonomy query, not a meta query. That distinction stops mattering at a few hundred products and starts mattering badly at several thousand, which is the size this was written for.
Feeds and switching
Each region can emit its own Google Merchant RSS feed, so a shopping campaign can be aimed at one city without a second store behind it. A product that carries no price for the region asked for falls back to its ordinary one, which is worth knowing before pointing a budget at the feed.
A shortcode renders the region switcher wherever a theme wants it. Nothing else is added to the front end — the extension enqueues no script and no stylesheet, and the page it produces weighs exactly what the theme’s page weighed.
Roles
Developer
Konstantin Sorokin
Work done
- Plugin architecture and PHP development
- Region taxonomy and per-region pricing
- Rewrite rules and regional product permalinks
- Google Merchant RSS feed per region
- Region switcher shortcode
- Documentation and open-source release