Now let's see how to update product variants' prices and stock quantities.
Let us imagine that you have a product SKU 10000000104, Apple iPhone X, and this product has three variants:
For example, you need to update the variants' info as follows:
define a different price for each product variant;
change the quantity stock for each product variant.
Here's how you can do it:
Use the CSV Export page of your store's Admin area (Catalog > Import & Export > CSV Export) to export your existing products:
If you need to export only one or several products, select them on the product listing page of your store Admin area (Catalog -> Products) and use the "Export selected" button at the bottom of the page:
Download the resulting export file and open it in a spreadsheet editor.
Edit the file removing the columns whose contents will not be updated. Care not to remove the required columns.
NOTE: According to CSV Import: Products, the required columns for importing products are sku and name; you must keep them.
Since we are dealing not just with simple products but with product variants, you will also need to keep the column variantID OR the columns that correspond with the fields the variants were built on:
[attribute_name](field:product)- if variants were built based on product-specific attributes,
[attribute_name](field:class) - if variants were built based on product-specific attributes
[attribute_name](field:global) - if variants were built based on global attributes)
The values in these columns are necessary to identify the specific variants.
We would use the variantID field as a variant identifier in our sample. As we update the prices and quantities for variants, you should keep the columns variantPrice and variantQuantity in addition to the required ones.
NOTE: If you need to update other price values, use the following columns:
variantCostPrice - the product variant cost price;
variantWholesalePrices - the wholesale product variant prices;
variantSale - a product variant discount set either in an absolute value or in a percent;
So now, if you look at the lines presenting the details of the variants of "Apple iPhone X," you should have something like the following:
Adjust the values in the file:
For variant ID 10000000104-64, add" 650" in the variantPrice column and "20" in the variantQuantity column.
For variant ID 10000000104-128, add" 700" in the variantPrice column and "25" in the variantQuantity column.
For variant ID 10000000104-256, add" 750" in the variantPrice column and "15" in the variantQuantity column.
As a result, your file contents should look like the following:
Next, save the file and import it via the Import page in your store's Admin area (Catalog > Import).
After completing the import process, you should see the updated prices and stock quantity for the product variants.