Jump to content

How Can I Show Different Image At Products.tpl


inTeL

Recommended Posts

{if $product.gid!="1"}<img src="templates/{$template}/images/lin-img.jpg" />
{elseif $product.gid!="2"}<img src="templates/{$template}/images/win-img.jpg" />
{elseif $product.gid!="3"}<img src="templates/{$template}/images/radyo-img.jpg" />
{elseif $product.gid!="4"}<img src="templates/{$template}/images/lin-img.jpg" />
{elseif $product.gid!="5"}<img src="templates/{$template}/images/win-img.jpg" />
{elseif $product.gid!="6"}<img src="templates/{$template}/images/ded-tr-img.jpg" />
{elseif $product.gid!="7"}<img src="templates/{$template}/images/ded-eu-img.jpg" />
{elseif $product.gid!="8"}<img src="templates/{$template}/images/vps-tr-img.jpg" />
{else $product.gid!="9"}<img src="templates/{$template}/images/vps-eu-img.jpg" />{/if}

 

this is my codes.

 

i want to show different images at different group id

 

example if i m displaying cart.php?gid=2 page (as linux Web hosting) i wanna see a linux image else i am displayin cart.php?gid=3 (as windows web hosting) i wanna see a windows image at package box in products area

Link to comment
Share on other sites

What has it got anything to do with it?

 

so say for love :)

 

___________________________

Get a mini image at product box what u want.

 

an example:

 

at linux web hosting page; u will see a linux logo near product details

at windows web hosting page; u will see a windows logo near product details

 

which product if u want u can show own logo at product box :)

Link to comment
Share on other sites

Lets breakdown your first line so that you know what it does

 

{if $product.gid!="1"}
$product.gid is not a variable within the $ product array ($product is an array of all the products to be displayed).

 

!= means not equal to

 

So if a variable that does not exist is not equal to 1 then (display your image).

 

The image would ALWAYS display because the variable is empty and would never equal 1.

 

Hope that helped to explain to you where you went wrong.

 

Here is a couple of linux penguins for you

 

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