seb776 Posted October 22, 2013 Share Posted October 22, 2013 Hi, I have a small module which modify meta values after a product get saved. So I used hookActionProductSave hook, but in this hook product get saved again which cause an infinite loop. I know I can directly change values in database but I prefere to use the API. A solution ? https://gist.github.com/SebSept/b291c7eb3961f0aa9dcc Link to comment Share on other sites More sharing options...
vekia Posted October 22, 2013 Share Posted October 22, 2013 if i were you i will write own separate function to update meta values Link to comment Share on other sites More sharing options...
seb776 Posted October 22, 2013 Author Share Posted October 22, 2013 if i were you i will write own separate function to update meta values you mean, override product class instead of creating a module ? Link to comment Share on other sites More sharing options...
seb776 Posted October 22, 2013 Author Share Posted October 22, 2013 so i finnaly used Db::getInstance()->update() instead of product->save() . But if someone has a less brutal solution, it will interest me ... Link to comment Share on other sites More sharing options...
vekia Posted October 22, 2013 Share Posted October 22, 2013 no, i mean that i will not use $product->save(); method because this causing infinite loop i will write own function inside module to update product meta tags Link to comment Share on other sites More sharing options...
seb776 Posted October 22, 2013 Author Share Posted October 22, 2013 ok, that's what i did. (updated the gist (not tested, but my real code is ok)) Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts