ivanmart07 Posted April 13, 2015 Share Posted April 13, 2015 I need to show names of selected attributes for product. Instead or under product reference. (For example green, XL ) Did someone solved this ? Thanks for help Martin Link to comment Share on other sites More sharing options...
Tuni-Soft Posted April 14, 2015 Share Posted April 14, 2015 If you have the id_product_attribute it would be fairly simple to get the attributes summary I used this method and it's working fine public function getProductAttributes($id_product, $id_product_attribute) { $id_lang = (int)$this->context->language->id; $product = new Product((int)$id_product, false, $id_lang); $attributes = $product->getAttributeCombinationsById((int)$id_product_attribute, $id_lang); $product_attributes = array(); foreach ($attributes as $attribute) $product_attributes[] = $attribute['attribute_name']; if (! count($product_attributes)) return '-'; return implode(' - ', $product_attributes); } 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