Jump to content

How to hide attributes not chosen in cart


Recommended Posts

What is the best practice to hide attributes that are a value of none (see screen)

I am assuming it would be a mod to shopping-cart-product-line.tpl and shopping-cart.tpl

 

code section in shopping-cart-product-line.tpl

<td class="cart_description">
	<h5><a class="product-image" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'}</a></h5>
{if isset($product.attributes) && $product.attributes}<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'htmlall':'UTF-8'}">{$product.attributes|escape:'htmlall':'UTF-8'}</a>{/if}
</td>

 

code section in shopping-cart.tpl

<h5><a href="{$link->getProductLink($lastProductAdded.id_product, $lastProductAdded.link_rewrite, $lastProductAdded.category, null, null, null, $lastProductAdded.id_product_attribute)|escape:'htmlall':'UTF-8'}">{$lastProductAdded.name|escape:'htmlall':'UTF-8'}</a></h5>
						{if isset($lastProductAdded.attributes) && $lastProductAdded.attributes}<a href="{$link->getProductLink($lastProductAdded.id_product, $lastProductAdded.link_rewrite, $lastProductAdded.category, null, null, null, $lastProductAdded.id_product_attribute)|escape:'htmlall':'UTF-8'}">{$lastProductAdded.attributes|escape:'htmlall':'UTF-8'}</a>{/if}

 

Any suggestions?

post-463404-0-62131200-1364685188_thumb.jpg

Edited by Whispar1 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
×
×
  • Create New...