Docs

Import Product Pricing

Map product prices in the Pricing section of the WooCommerce Products template. Prices are formatted with WooCommerce’s wc_format_decimal() before save.

Pricing fields

FieldDescription
Regular PriceStandard product price
Sale PriceDiscounted price (enable the Sale Price subgroup)
Sale Price FromOptional sale start datetime
Sale Price ToOptional sale end datetime

Simple product example

NameSKURegular PriceSale Price
Simple Product 1simple-one19.9914.99
Simple Product 2simple-two29.99

Map Regular Price and optionally Sale Price. Leave sale price empty when the product is not on sale.

Sale price and schedule

  1. Enable the Sale Price fields.
  2. Map Sale Price.
  3. Optionally map Sale Price From / Sale Price To using a datetime WooCommerce accepts (typically YYYY-MM-DD or YYYY-MM-DD HH:MM:SS).

If sale prices are not updating on re-import:

  • Confirm Update is enabled and price fields are not excluded in permissions
  • Confirm the unique identifier matches existing products
  • Confirm the sale price column is not empty when you expect a value (empty values may clear or skip depending on mapping/permissions)

Variation prices

For variable products, set Regular Price / Sale Price on each variation row. Parent variable products do not need a single selling price in the same way — WooCommerce derives the display range from variations.

See Import Variable Products and Variations.

Price-only updates

  1. Map SKU + price fields only.
  2. Unique identifier = Product SKU.
  3. Permissions: Update enabled; optionally Create disabled.
  4. Restrict update to pricing fields so other product data is untouched.

See Update Existing WooCommerce Products.

Transforming prices (margins, commas, currency)

Decimal commas

If your feed uses European decimals (12,99):

add_filter( 'iwp/woocommerce/product_field/_regular_price', function ( $value, $raw ) {
	$raw = str_replace( '.', '', $raw ); // optional: strip thousand separators
	return str_replace( ',', '.', $raw );
}, 10, 2 );

add_filter( 'iwp/woocommerce/product_field/_sale_price', function ( $value, $raw ) {
	$raw = str_replace( '.', '', $raw );
	return str_replace( ',', '.', $raw );
}, 10, 2 );

Add a percentage margin

add_filter( 'iwp/woocommerce/product_field/_regular_price', function ( $value, $raw ) {
	$price = floatval( $raw );
	if ( $price <= 0 ) {
		return $value;
	}
	$margin = 1.20; // +20%
	return wc_format_decimal( $price * $margin );
}, 10, 2 );

Skip importing a price below a minimum

Combine a price filter with record filtering, or zero-out invalid prices:

add_filter( 'iwp/woocommerce/product_field/_regular_price', function ( $value, $raw ) {
	$price = floatval( str_replace( ',', '.', $raw ) );
	if ( $price > 0 && $price < 5 ) {
		return ''; // or keep previous via permissions / custom logic
	}
	return $price;
}, 10, 2 );

More examples: WooCommerce Filters and Code Snippets and Using Code Snippets in WordPress.

Preventing unwanted price changes

  • Use Permissions → Update → None of the following fields to block _regular_price / _sale_price when a feed should not change prices.
  • Or use Only the following fields when the feed should change only prices.
  • Do not map price columns at all if they must never change.