bartoszr Posted January 15, 2016 Share Posted January 15, 2016 What would be the best way to check in template whether product has attributes or no. In some tpl files I have seen something like $product->hasAttributes() method so this may seem clear here. But in others something like that seems to be normal $product.id_product_attribute == 0 or >0. It returns the id of default attributes combinations I guess. Is there some consistent/proper/preffered way to do the check? Link to comment Share on other sites More sharing options...
NemoPS Posted January 15, 2016 Share Posted January 15, 2016 both are valid, the first only when you have a product object, the second in lists Link to comment Share on other sites More sharing options...
gpal Posted January 15, 2016 Share Posted January 15, 2016 Hi, First method i.e $product->hasAttributes() is used in php files while the other one $product.id_product_attribute == 0 or >0 is used in tpl files. Link to comment Share on other sites More sharing options...
bartoszr Posted January 15, 2016 Author Share Posted January 15, 2016 Great, thank you very much. Most appreciated. 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