m.vantloo Posted December 4, 2015 Share Posted December 4, 2015 (edited) Hello, We recently bought a webshop and that is still running at PS 1.2.4. Yes, I know..... time to upgrade, but that is quiet a process. In a home-brewed piece of code, a product is deactivated. But in stead of deactivation, I want to add the product to an category. It's very difficult to find doc's about version 1.2, so hopefully somebody over here can help me. Current piece of code: function proccess($settings, $product_id){ $product = new Product(intval($product_id)); $product->active = floatval($settings['0']); $product->update(); Hook::updateProduct($product); Search::indexation(false); } So in stead of $product->active = floatval($settings['0']); I'm looking at something like $product->category = 123; Can anyone help me with this? Thanks in advance. [edit] To be clear: I want to ADD it to a category, not move it [/edit] Edited December 4, 2015 by m.vantloo (see edit history) Link to comment Share on other sites More sharing options...
maurice.vantloo Posted December 5, 2015 Share Posted December 5, 2015 By reading code of several modules, I found a way to add a category by using MySQL's INSERT command. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now