Guys,
I have a site with a few thousand K2 items each having ~10 extra fields. One of the fields is Price.
From time to time the prices change, and I need to manually update them, and frankly speaking, it's a nightmare. I have to open each item, update the price, save the item, and so on...
I want to develop a plugin or component, which will accept a csv file of such a format:
Then it will update all the K2 items with corresponding k2 ID with the new price from the file.
I checked the DB structure, the K2 component keeps the extra fields as a JSON string. Currently I'm thinking of direct MySQL query that will select all the K2 items, decode JSON, update prices, encode JSON and update the items. But maybe there are existing methods that allow to get & update extra fields values? What is the CORRECT way to accomplish this task?
Thank you.