Jump to content

[1.2] Add Product To Category


m.vantloo

Recommended Posts

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 by m.vantloo (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...