ReynierPM ReynierPM - 1 year ago 134
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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download