Jump to content

Show setected attribute


ivanmart07
 Share

Recommended Posts

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);
}

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More