Jump to content

How can I add a product feature to shopping cart summary?


Recommended Posts

Hello folks

 

I have in my store products with feature. I want this feature to appear right under the "SKU" field, in the shopping cart summary. I've been checking the forum but I can't find a solution to my question.

 

I attach a picture to make it easier to understand. I hope anybody can help me!

 

Thanks :)

post-813630-0-81463600-1404752773_thumb.png

Link to comment
Share on other sites

Hi,

 

is there one particular feature that you want to display in the shopping cart? Or do you want to display all? You will first need to call new Feature through CartController.php and then add something along those lines into shopping-cart-product-line.tpl

Right under this code

<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html':'UTF-8'}" alt="{$product.name|escape:'html':'UTF-8'}" {if isset($smallSize)}width="{$smallSize.width}" height="{$smallSize.height}" {/if} /></a>

Add the following:

{foreach from=$features item=feature}
<tr>
{if isset($feature.value)}     
<td>{$feature.name|escape:'html':'UTF-8'}</td>
<td>{$feature.value|escape:'html':'UTF-8'}</td>
{/if}
</tr>
{/foreach}

But this will only work if you have the defined the feature variable through the php controlelr file. It will also spit out all the features, not just one. 

Link to comment
Share on other sites

I'm gonna give it a try. I want to show all features (my products only have 1 feature so that's not a problem).

 

I don't understand very well what do you mean here:

 

 

But this will only work if you have the defined the feature variable through the php controlelr file. It will also spit out all the features, not just one. 

 

Link to comment
Share on other sites

  • 6 months later...

Hi, i have modified my shopping-cart-product-line.tpl as you described.

But no features show up (after clearing cache).

What do i need to add to CartController.php to see the features?

I am using Prestashop 1.6.0.9

Found the answer myself in this thread:

https://www.prestashop.com/forums/topic/265593-solved-display-product-features-such-as-height-width-in-shopping-cart/

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

  • 6 years later...

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
×
×
  • Create New...