ReynierPM ReynierPM - 17 days ago 11
PHP Question

how to get all attributes in prestashop

I need to get all attributes that exists in my Prestahop store not matter wich or what product is assigned I just want to generate a array of those attributes and then use them in ProductController.php class. I check the file classes/Product.php and a method called getDefaultAttribute($id_product, $minimumQuantity = 0) is present but I think this only works for attributes assigned to a specific product and not return all as I need. Any help? I'm newbie with Prestashop and need to learn a lot of things

Answer

Examine file classes/Attribute.php. Your may use static function Attribute::getAttributes($id_lang, $not_null = false). It return all attributes for a given language.

Comments