sonixax Posted November 9, 2014 Share Posted November 9, 2014 Hi, I want to show Product Shipping Details like Width,Height,Depth and ... in Product Page. But the problem is I don't know which Variables should I use to show this Informations in Product page! Also , I do not want to use Features ($features) to show this informations becaus I already set them in Shipping Detail! so, The question is , how can I found variables of width,height and depth and use them in Prestashop 1.6 Smarty engine ?! (product.tpl) Thanks a lot Link to comment Share on other sites More sharing options...
FullCircles Posted November 10, 2014 Share Posted November 10, 2014 For any of the standard fields on a class (such as Product), you should be able to just reference them like so: {$product->width} {$product->height} {$product->depth} 1 Link to comment Share on other sites More sharing options...
sonixax Posted November 11, 2014 Author Share Posted November 11, 2014 oh,Thanks a lot is there any way to get Features by ID ? (Without using Foreach) (to make auto generated Descriptions!) Link to comment Share on other sites More sharing options...
FullCircles Posted November 12, 2014 Share Posted November 12, 2014 There should already be a section for that on the product.tpl file Looks like this: {if isset($features) && $features} {foreach from=$features item=feature} {if isset($feature.value)} {$feature.name|escape:'html':'UTF-8'} {$feature.value|escape:'html':'UTF-8'} {/if} 2 Link to comment Share on other sites More sharing options...
sonixax Posted November 12, 2014 Author Share Posted November 12, 2014 so, this means there is no way to get Features value without foreach ?! Link to comment Share on other sites More sharing options...
FullCircles Posted November 13, 2014 Share Posted November 13, 2014 Not that I'm aware of, what is it you're actually trying to do with it? Unsure 1 Link to comment Share on other sites More sharing options...
sonixax Posted November 13, 2014 Author Share Posted November 13, 2014 Not that I'm aware of, what is it you're actually trying to do with it? Unsure Im trying to get only two value from about 10 values! at the moment I using if statements inside a loop! to get only two value Link to comment Share on other sites More sharing options...
FullCircles Posted November 17, 2014 Share Posted November 17, 2014 In that case, you'll just need to use something like this: {if isset($features) && $features} {foreach from=$features item=feature} {if isset($feature.value) && isset($feature.name) && ($feature.name == "NAME_OF_FEATURE_1_HERE" || $feature.name == "NAME_OF_FEATURE_2_HERE"} <br /><strong>{$feature.name|escape:'html':'UTF-8'}:</strong> {$feature.value|escape:'html':'UTF-8'} {/if} {/foreach} {/if} That will print out only the features whose names you put into that code there.. preformatted the html a little, but you'd need to change it to however you wanted to display it 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