Jump to content

Product Images


Recommended Posts

https://forum.whmcs.com/showthread.php?111411-editing-font-awesome-icons

https://forum.whmcs.com/showthread.php?108179-Change-large-product-icons-on-Product-Details-page

 

... and if you mean you don't want to use fontawesome / glyphicons and would prefer an image, then it should just be a case of adding the URL to the appropriate image.

Link to comment
Share on other sites

<div class="product-icon text-center">
                               <span class="fa-stack fa-lg">
                                   <i class="fa fa-circle fa-stack-2x"></i>
                                   <i class="fa fa-{if $type eq "hostingaccount" || $type == "reselleraccount"}{elseif $type eq "server"}database{else}archive{/if} fa-stack-1x fa-inverse"></i>
                               </span>
                               <h3>{$product}</h3>
                               <h4>{$groupname}</h4>
                           </div>

 

Is there a way to make it so I can specify each product group?

 

Right now it set for 3 icons, one for hosting accounts, reseller accounts, and server accounts. Or can it be coded some way that i can say product id 1 has fa-lock for examaple

Link to comment
Share on other sites

Is there a way to make it so I can specify each product group?

use $groupname in that {if} statement instead if $type.

 

Right now it set for 3 icons, one for hosting accounts, reseller accounts, and server accounts. Or can it be coded some way that i can say product id 1 has fa-lock for example

use $pid if you know the product ID; or use $product if you it's name - $pid is probably technically better to use as you could rename the product at a later date and break this code, but you can't change it's ID.

Link to comment
Share on other sites

groupname doesnt appear to work

it should do - and does for me in v7.1.1 :?:

 

<i class="fa fa-{if $groupname eq "Shared Hosting" || $type == "reselleraccount"}magic{elseif $type eq "server"}database{else}archive{/if} fa-stack-1x fa-inverse"></i>

note I quickly changed 'hdd-o' to 'magic' and it's now showing the magic icon. :idea:

 

VQbjUZ8.png

 

in your image, the $groupname will be "Comodo SSL & Security" - but if it doesn't work for you with a particular product, add a {debug} to the template and see if the variable exists and what it is exactly called.

Link to comment
Share on other sites

  • 5 months later...

Can you point out where I went wrong here?

 

When a client orders a product, no matter which one, the original image is shown in the clientarea product area.

 

{if $groupname eq "Liquidizer" || $pid == "40"}<img src="/images/products/original.jpg" alt="Original" width="162" height="208">
{elseif $pid eq "42"}<img src="/images/products/grapeape.jpg" alt="Grape Ape" width="162" height="208">                                 
{elseif $pid eq "44"}<img src="/images/products/bananaOG.png" alt="Banana OG" width="162" height="208">                                  
{elseif $pid eq "41"}<img src="/images/products/icehit.jpg" alt="IceHit" width="162" height="208">                                 
{elseif $pid eq "43"}<img src="/images/products/pineappleexpress.png" alt="Pineapple Express" width="162" height="208">                                  
{elseif $pid eq "45"}<img src="/images/products/strawberrycough.jpg" alt="Strawberry Cough" width="162" height="208">                                  
{elseif $pid eq "46"}<img src="/images/products/6pack.jpg" alt="6 Pack Sample" width="162" height="208">                                                                                                                                    
{/if}   

 

In the admin area the Group name is Liquidizer, and all the correct product id's correspond with the product..

Edited by AffordableDomainsCanada
Link to comment
Share on other sites

I assume that you're trying this in clientareaproductdetails.tpl ?

 

if so, I gave it a quick test locally and it worked fine - obviously no images, but the alternative text showed for different products.... I can't see anything obviously wrong with the code - unless either $pid doesn't exist in whichever template you're trying to do this.... or PIDs 41-46 are in the liquidizer group and so the first $groupname condition is met and so doesn't get to the elseifs ?

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