Jump to content

Add link to product page with category Id limit


vicko766

Recommended Posts

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 by vicko766 (see edit history)
Link to comment
Share on other sites

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

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

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

post-1328177-0-06890800-1484247782_thumb.png

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

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

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

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 by vicko766 (see edit history)
Link to comment
Share on other sites

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...