WordPress Developer Ukraine, Kyiv
WooCommerce Checkout Validation and Custom Field Sanitization

WooCommerce Checkout Validation and Custom Field Sanitization

WooCommerce checkout validation and custom field sanitization A custom checkout field needs three things: it is displayed, its value is validated before the order is created, and it is sanitized when it is saved. Each step has its own hook, and using the wrong one leads to orders placed with invalid data or errors shown…
WooCommerce Store API: Build a Custom Storefront with React

WooCommerce Store API: Build a Custom Storefront with React

Build a custom WooCommerce storefront with the Store API and React The WooCommerce Store API (/wp-json/wc/store/v1) is the API behind the Cart and Checkout blocks. It is made for the front end: public product data needs no authentication, the cart belongs to the visitor’s session, and it returns prices, images and stock in a form…
WooCommerce Multi-Currency: Custom Exchange Rates and Geo-Pricing

WooCommerce Multi-Currency: Custom Exchange Rates and Geo-Pricing

Several currencies in WooCommerce: what a small plugin can do and where it stops A shop that sells abroad wants prices in the visitor’s currency. WooCommerce has one store currency, and multi-currency plugins do a lot of work behind the scenes: converting prices, rounding them, charging the right currency through the payment gateway, and keeping…
WooCommerce Product Recommendations with Custom Scoring Algorithms

WooCommerce Product Recommendations with Custom Scoring Algorithms

WooCommerce product recommendations with your own scoring WooCommerce upsells and cross-sells are curated by hand: the shop owner links related products one by one. On a store with hundreds of products nobody keeps that up to date. A simple algorithm based on what customers actually bought together, weighted by category, gives a relevant “Customers also…
WooCommerce Shipping Zones and Custom Shipping Methods

WooCommerce Shipping Zones and Custom Shipping Methods

A custom WooCommerce shipping method with weight tiers WooCommerce’s built-in methods (flat rate, free shipping, local pickup) cover simple shops. A courier that charges by weight brackets, adds a surcharge for bulky items and does not deliver some product categories needs a shipping method of its own. It is one class that extends WC_Shipping_Method, registered…
WooCommerce Product Gallery: Images, Sideloading, and REST API

WooCommerce Product Gallery: Images, Sideloading, and REST API

WooCommerce product images from URLs: sideload, gallery and REST API Product data from a supplier usually comes with image URLs, not files. The WooCommerce REST API can take those URLs and download the images itself, and in PHP the same is done with media_sideload_image() plus set_image_id() and set_gallery_image_ids(). The parts that are easy to get…
Extending the WooCommerce REST API with Custom Routes and Fields

Extending the WooCommerce REST API with Custom Routes and Fields

Extend the WooCommerce REST API: extra fields and custom routes An ERP or a mobile app talks to WooCommerce through /wp-json/wc/v3/. Sooner or later it needs data that WooCommerce does not expose: an internal supplier code on products, a B2B account number on customers, or a resource of the plugin itself. There are two clean…