Keyword

Edit one of the extrafields on multiple K2 items

  • brutto
  • brutto's Avatar Topic Author
  • Offline
  • New Member
More
6 years 2 months ago #166702 by brutto
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:
k2 id, price
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.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 2 months ago #166707 by Krikor Boghossian
Replied by Krikor Boghossian on topic Edit one of the extrafields on multiple K2 items
Hello Brutto,

Backup the db and try your method :)
A custom method is the solution for your issue.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum