montyex1 Posted December 21, 2010 Share Posted December 21, 2010 Hi, Dose any one know "how to display features in Shopping cart summary ?" I tried with {$Product.features[ 0 ].value} in shopping-cart-productline.tpl , But its not working Can some one guide me ? Thanks Monty Link to comment Share on other sites More sharing options...
only7yb Posted December 28, 2010 Share Posted December 28, 2010 I have the same problem,I managed in 'product-list' using this: {foreach from=$product.features item=feature name=features}{if $feature.id_feature == 6} {$features.value|escape:'htmlall':'UTF-8'} {/if} {/foreach} But it doesn't seem to work in 'blockcart'Any clues?..thanks Link to comment Share on other sites More sharing options...
montyex1 Posted December 29, 2010 Author Share Posted December 29, 2010 Hi, I also managed it in product-list ...but no luck in blockcart Monty Link to comment Share on other sites More sharing options...
GabriGreese Posted February 10, 2011 Share Posted February 10, 2011 (edited) Hi! I just resolved my problem using the getFrontFeaturesStatic() function of Product class. Pasting this in your 'shopping-cart-product-line.tpl' template will resolve the "printing features" problem. {php} $feat_product=$this->get_template_vars('product'); $feat_idprod=intval($feat_product["id_product"]); $feat_idlang=intval($this->_tpl_vars["cart"]->id_lang); $features_product=Product::getFrontFeaturesStatic($feat_idlang, $feat_idprod); if (isset($features_product) && count($features_product)>0) { for($feat_i=0;$feat_i<count($features_product);$feat_i++) { $cart_quantity=intval($feat_product["cart_quantity"]); $cart_quantity_pcs=$features_product[$feat_i]["value"]; settype($cart_quantity_pcs, "integer"); $cart_quantity_rely=$cart_quantity/$cart_quantity_pcs; echo '<span id="ft_'.$feat_product["id_product"].'">('.$cart_quantity_rely.'x) '.$features_product[$feat_i]["value"].'</span>'; } } {/php} I've just corrected the code snippet... The forum trimmed many pieces of code away! Edited September 7, 2011 by GabriGreese (see edit history) Link to comment Share on other sites More sharing options...
montyex1 Posted March 27, 2011 Author Share Posted March 27, 2011 Thanks a lot, It worked Here is my site www.easy4busy.com Link to comment Share on other sites More sharing options...
maxkdiv Posted September 2, 2011 Share Posted September 2, 2011 could you please explain me better this mod? I wasn't able to make it work Link to comment Share on other sites More sharing options...
SonnyBoyII Posted September 7, 2011 Share Posted September 7, 2011 Hi! I just resolved my problem using the getFrontFeaturesStatic() function of Product class. Pasting this in your 'shopping-cart-product-line.tpl' template will resolve the "printing features" problem. {php} ...... {/php} Bye Thats great! I will try this. But... is there any more elegant way to get features variable in shopping-cart-product-line.tpl?? I have been trying to pass this variable by editing class/controlers but no success so far .... Link to comment Share on other sites More sharing options...
GabriGreese Posted September 7, 2011 Share Posted September 7, 2011 could you please explain me better this mod? I wasn't able to make it work Yes, you are right. The problem was due to some problem with this forum... The code snippet was eated by something... Now should be correct. Link to comment Share on other sites More sharing options...
GabriGreese Posted September 7, 2011 Share Posted September 7, 2011 Thats great! I will try this. But... is there any more elegant way to get features variable in shopping-cart-product-line.tpl?? I have been trying to pass this variable by editing class/controlers but no success so far .... Please update the script you have copied. There was some problem with the forum because it has trimmed away a significant part of my code snippet. The correct (and updated) one is above! Link to comment Share on other sites More sharing options...
GabriGreese Posted September 7, 2011 Share Posted September 7, 2011 Thanks a lot, It worked Here is my site www.easy4busy.com Great! You have copied the code snippet before the forum problem in this post... now there is an updated one... Link to comment Share on other sites More sharing options...
SonnyBoyII Posted September 7, 2011 Share Posted September 7, 2011 Mate... you saved me... Thanks!! If you want to pass the whole features array to template shopping-cart-product-line.tpl) use this code: {php} $feat_product=$this->get_template_vars('product'); $feat_idprod=intval($feat_product["id_product"]); $feat_idlang=intval($this->_tpl_vars["cart"]->id_lang); $pr_features=Product::getFrontFeaturesStatic($feat_idlang, $feat_idprod); $this->assign(pr_features,$pr_features); {/php} and then an example how to get features values: {foreach from=$pr_features item=feature} {if $feature.name == "ipod"}rubbish, and only has {$feature.value} memory{/if} {/foreach} Link to comment Share on other sites More sharing options...
ceeray Posted January 26, 2012 Share Posted January 26, 2012 Arg this is not working for me in a 1.4.6.2 install. I am trying to add the feature values into the cart summary. {foreach from=$product.features item=feature name=features} {$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'} {/foreach} ^does not display anything for me in the cart summary (shopping-cart-product-list.tpl) {foreach from=$product.features item=feature} {$feature.id_feature_value} {/foreach} ^works, but it is not what I am looking for I tried inserting both of the php scripts above, but they just nullify all the code that follows. Thanks in advance for any help. Link to comment Share on other sites More sharing options...
fifix Posted February 1, 2012 Share Posted February 1, 2012 Not working in 1.4.6.2 i would really have the product.features in shopping-cart.tpl Where do you put the php code - in which file ? 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