-
Notifications
You must be signed in to change notification settings - Fork 307
Update stock prices
Magmi can be update mode is used to update attributes of existing products, and the 2 most commons candidates for updates are : price & stock.
While Magento Dataflow export format is very verbose, magmi can act on only a very small subset of it. In update mode, the subset can be as small as sku + modified attributes columns.
- sku
- qty
- sku
- price
- sku
- qty
- price
Of course, any supplementary column may be used if your update is done one more values than price or stock (like special_price or name)
the store column is not present in the samples i gave.
In fact, some values are store dependent (like price) and some are not (qty)
The rule of thumb is :
- attributes are store dependent
- inventory related column are stock dependent
So ,
-
multistore stock update is trivial since all stores share the same stock<sup*
* see below for multi stock qty update - multistore price update needs explicit store to be set if your prices are not global and may differ from one store to another
- up to 0.7.11 : Warning "no decimal attribute set for sku xxxx"
- from 0.7.12 : magmi will assume "admin" store (ie: default values)
- up to 0.7.11 : no warning, values imported only on valid store views.
- from 0.7.12 : a waning will be issued listing the invalid store view codes, values imported only on valid store views
- up to 0.7.11 : Warning "no decimal attribute set for sku xxxx"
- from 0.7.12 : a waning will be issued listing the invalid store view codes,another one for telling line is skipped.
In all following samples we have 3 items (skus 00001,00002,00003)
This kind of stock update is the most common and is supported since the beginning of magmi.
The following CSV will do the trick
sku,qty 00001,2 00002,4 00003,5
This handy feature enable to set stock relatively for exising items (adding & removing units)
To specify relative stock update, only put a + or - before the qty value, magmi will perform relative stock operation.
The following CSV will increase stock for 00001 & 00003 , decrease for 00002
sku,qty 00001,+1 00002,-3 00003,+4
Some extensions can provide multiple stock support , and this support is theoritically available in the magento DB info , however not used yet in magento standard release.
Magmi can handle multiple stock , for this , the stock_id column is necessary
Here, we'll dispatch our items stock among differents stocks (here say stock_id 1 & 2)
Relative syntax is permitted here too , this sample will mix both fixed & relative stock !!!
sku,qty,stock_id 00001,+2,1 00001,-2,2 00002,4,1 00002,5,2 00003,-4,1 00003,2,2