0

Good evening,

Im looking at creating a form for a website that allows for bulk updating of a price field within an expression engine channel, lets say for instance, increase all prices for all entries by 5%

Looking into it the HTML form is no issue, and I can pass the figure to a process to make the changes and I think the the thing i need is:

ee()->api_channel_entries->update_entry((int) $entry_id, (array) $data);

but im very new to EE and would appreciate any pointers on putting a script together that gathers all the info from each entry then applies the update

1 Answer 1

1

If you're using the channel entries API then the $data you need to send back is the entire entry. For example if you just pass the price through, all the other field data will be nulled. It's probably best you don't go down that route if you're not familiar with the API.

Best route imo would be to build a module that will update your price field in exp_channel_data to be x% of whatever you submit.

If all you are doing is displaying prices (not searching/filtering/ordering on) - the other option is simply modifying the prices at the template side using a math plugin:

http://devot-ee.com/search/tags/tag/math

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.