Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 1.6.1: type vs. type_id, categories vs. category_ids?

They seem to bear the same value in the results returned by product.info API call. For example:

[type] => simple
[type_id] => simple


[categories] => Array
    (
        [0] => 4
    )
[category_ids] => Array
    (
        [0] => 4
    )

So which one of them am I supposed to use when creating or updating products? Or should I just stick to both of them and set the same value for both of them when creating or updating products?

Thanks!

like image 266
datasn.io Avatar asked Dec 01 '25 17:12

datasn.io


1 Answers

The "id" values are what is stored in the database, their shorter equivalents are set by the product model for convenience and it is responsible for copying changes back to the "id" field. In theory you can use either interchangeably.

like image 193
clockworkgeek Avatar answered Dec 03 '25 08:12

clockworkgeek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!