vicko766 Posted January 9, 2017 Share Posted January 9, 2017 (edited) Hi to all prestashopers. I would like to add a link to product page but only to products in category id 13. Because if I add just this line to product.tpl in line 197 <a href="http://mysite.com/guide.pdf">Sizing Guide</a> its show on all products. I allredy tried adding this line {if $category->id != 13 && $category->id != 24} to product.tpl. But no go. I will appreciate Any Pointers. bye for now Yes and my first post on the prestashop forum VZ Edited January 11, 2017 by vicko766 (see edit history) Link to comment Share on other sites More sharing options...
rictools Posted January 10, 2017 Share Posted January 10, 2017 Did you try $category->id_category ? Link to comment Share on other sites More sharing options...
vicko766 Posted January 10, 2017 Author Share Posted January 10, 2017 Did you try $category->id_category ? I did just now but nothing happens. I tried with firebug on <p id="availability_statut"> <span id="availability_value" class="label label-success"> $category->id_category ? Link to comment Share on other sites More sharing options...
rictools Posted January 10, 2017 Share Posted January 10, 2017 I don't understand. Did you use the question mark at the end too? Link to comment Share on other sites More sharing options...
vicko766 Posted January 11, 2017 Author Share Posted January 11, 2017 (edited) I don't understand. Did you use the question mark at the end too? Sorry for late reply yes I used it. And thx to helping me out . Edited January 11, 2017 by vicko766 (see edit history) Link to comment Share on other sites More sharing options...
rictools Posted January 11, 2017 Share Posted January 11, 2017 OK, the ? was part of my question, but not part of the variable. Just try to replace $category->id in your code (two times) with $category->id_category Link to comment Share on other sites More sharing options...
vicko766 Posted January 11, 2017 Author Share Posted January 11, 2017 (edited) OK, the ? was part of my question, but not part of the variable. Just try to replace $category->id in your code (two times) with $category->id_category I tried that too but nothing happens only code showing in front end thx Edited January 11, 2017 by vicko766 (see edit history) Link to comment Share on other sites More sharing options...
rictools Posted January 11, 2017 Share Posted January 11, 2017 Then there's a syntax mistake, sometimes one wrong sign. You could post the whole part of the code here. Link to comment Share on other sites More sharing options...
vicko766 Posted January 12, 2017 Author Share Posted January 12, 2017 Then there's a syntax mistake, sometimes one wrong sign. You could post the whole part of the code here. Hi this is from firebug where iam testing the code. <p id="availability_statut"> <span id="availability_value" class="label label-success">On stock</span> $category->id_category </p> Link to comment Share on other sites More sharing options...
rictools Posted January 12, 2017 Share Posted January 12, 2017 I am talking about the code you posted in your first post. Link to comment Share on other sites More sharing options...
vicko766 Posted January 12, 2017 Author Share Posted January 12, 2017 (edited) I am talking about the code you posted in your first post. aha. This is the code in line 194-198 in product.tpl <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> {*<span id="availability_label">{l s='Availability:'}</span>*} <span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span> $category->id_category <a href="http://mysite.com/size_guide.pdf">Size guide</a> </p> I think Iam missing something Check the attached print screen image how does it look on product page thx Edited January 12, 2017 by vicko766 (see edit history) Link to comment Share on other sites More sharing options...
rictools Posted January 12, 2017 Share Posted January 12, 2017 I cannot find the code line from your first post (why don't you use this code with this variable???, could be right), only the variable without the code (that included the variable two times). And as I know without {} the variable is not seen as variable but as text. Link to comment Share on other sites More sharing options...
vicko766 Posted January 17, 2017 Author Share Posted January 17, 2017 I cannot find the code line from your first post (why don't you use this code with this variable???, could be right), only the variable without the code (that included the variable two times). And as I know without {} the variable is not seen as variable but as text. I tried with variable but no go Link to comment Share on other sites More sharing options...
rictools Posted January 17, 2017 Share Posted January 17, 2017 If you don't post this code part that you tried how could we help you ... Link to comment Share on other sites More sharing options...
vicko766 Posted January 24, 2017 Author Share Posted January 24, 2017 (edited) aha. This is the code in line 194-198 in product.tpl <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> {*<span id="availability_label">{l s='Availability:'}</span>*} <span id="availability_value" class="label{if $product->quantity <= 0 && !$allow_oosp} label-danger{elseif $product->quantity <= 0} label-warning{else} label-success{/if}">{if $product->quantity <= 0}{if $PS_STOCK_MANAGEMENT && $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{elseif $PS_STOCK_MANAGEMENT}{$product->available_now}{/if}</span> {$category->id_category} <a href="http://mysite.com/size_guide.pdf">Size guide</a> </p> I think Iam missing something Check the attached print screen image how does it look on product page thx If you don't post this code part that you tried how could we help you ... On the top is my code in tpl file Sorry for late reply thx Edited January 24, 2017 by vicko766 (see edit history) 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