kadessa Posted July 7, 2014 Share Posted July 7, 2014 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 Link to comment Share on other sites More sharing options...
PSfever.com Posted July 7, 2014 Share Posted July 7, 2014 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 More sharing options...
kadessa Posted July 8, 2014 Author Share Posted July 8, 2014 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 More sharing options...
kadessa Posted July 8, 2014 Author Share Posted July 8, 2014 I tried your code but nothing happens: no change, no errors, nothing. Any ideas? Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2014 Share Posted July 8, 2014 hello in some cases to see changes it's necessary to clear shop cache try it, it's worth to Link to comment Share on other sites More sharing options...
ackermann Posted February 2, 2015 Share Posted February 2, 2015 (edited) 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 February 2, 2015 by ackermann (see edit history) Link to comment Share on other sites More sharing options...
senso321 Posted November 26, 2021 Share Posted November 26, 2021 This works with 1.7.8.1 when you need explicit access in the cart to features {foreach from=Product::getFrontFeaturesStatic($language.id, $product.id) item=feature} {$feature.name} {/foreach} 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