magmi-git
magmi-git copied to clipboard
Place Item In Out of Stock Category Based on Qty
Hello, I'm working on a client site and they would like to be able to have a category for items with 0 Qty called Out of Stock. I've tried with Value Replacer in 2 different versions of magmi v0.7.18 beta2 and v0.7.23 but both don't seem to workout well.
We import a CSV into Magmi and use the Magmi column mapper to map the columns to what magmi requires for magento. Attached is the CSV that's imported and also the same csv after magmi massages it for magento. Take a look at item ITEM_SIDs/SKUs 1021,1275, and 1529 that have 0 for qty.
Original CSV: Items.txt
After Magmi: linkedretail_magmi_log_1489010366.txt
The command used in Value Replacer is: {{{item.qty}<1?{item.Category} .';;Out of Stock':{item.Category}}}
We have a similar command that works to put items in a Sale Category if the price is higher then the special price so I structured this command in the same fashion but for some reason it doesn't work at all even though it is adding the category into the categories column for the item after magmi.
A potential problem might be how the valuereplacer works. I find doing what you're trying to do above to rarely work.
If you however store those values in a different variable (eg categoryoutofstock) and set it to be assigned it should work.