Jump to content

use {if} for product groups


hogava

Recommended Posts

Hi, how i can show element for some product groups?

now i use product id for if function (in viewcart.tplconfigureproduct.tpl),how is about product groups?

{$showhello = 0}
    {if $product.pid == '1'} {$showhello = 1}  {/if}
    {if $product.pid == '2'} {$showhello = 1}  {/if}
    {if $product.pid == '3'} {$showhello = 1} {/if}
    {if $product.pid == '4'} {$showhello = 1} {/if}    
{if $showhello == 1}  
<p>Hello!</p>
{/if}

 

Edited by hogava
Link to comment
Share on other sites

On 02/06/2019 at 12:15, hogava said:

now i use product id for if function (in viewcart.tplconfigureproduct.tpl),how is about product groups?

add {debug} to the end of either template and you'll get a popup window of available variables.

from memory, I think in viewcart, it would be {$product.productinfo.gid} (if you're in the products loop); configureproduct I can't recall off-hand, though there are some cart pages where you don't get access to a product group ID value, only the product group name - but you should be able to figure out the correct variable from the popup window... don't forget to remove {debug} from the template(s0 when you've finished.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated