Jump to content

Cart.php Group Modification


Recommended Posts

Hello I am currently set to use the Slider Orderform. I would like to customize my product groups and turn them into the image of my choice instead.


Here is my cart:



Instead of "Free Web Hosting" I would like to add an image inside the small hover boxes and/or replace the text completely with an image.


Can anybody think of an easy way to do this? Thanks!

Link to comment
Share on other sites

the easiest way I can think of would be to modify products.tpl inside your slider orderform template.


in this example below, i'm replacing the text entirely with an image... so on line 44 is the following line of code...

<div class="prodcats"><div><a href="cart.php?gid={$productgroup.gid}">{$productgroup.name}</a></div></div>

replace it with the following line...

<div class="prodcats"><div><a href="cart.php?gid={$productgroup.gid}"><img src="templates/orderforms/slider/images/prodimage{$productgroup.gid}.png"></a></div></div>

what you will then need to do is create the images and name them so their group IDs are in their filenames - so for your site, you would need the following images for their respective group titles..


prodimage1.png -> Shared Web Hosting

prodimage2.png -> Reseller Web Hosting

prodimage4.png -> Virtual Private Servers

prodimage6.png -> Free Web Hosting


upload the images to the "images" directory within the "slider" orderform directory.


for the non-products (e.g addon, domain registration and transfers), you can modify the code in a similar way.


{if $gid neq "addons"}<div class="prodcats"><div><a href="cart.php?gid=addons">{$LANG.cartproductaddons}</a></div></div>{/if}

{if $renewalsenabled && $gid neq "renewals"}<div class="prodcats"><div><a href="cart.php?gid=renewals">{$LANG.domainrenewals}</a></div></div>{/if}


{if $registerdomainenabled && $domain neq "register"}<div class="prodcats"><div><a href="cart.php?a=add&domain=register">{$LANG.registerdomain}</a></div></div>{/if}

{if $transferdomainenabled && $domain neq "transfer"}<div class="prodcats"><div><a href="cart.php?a=add&domain=transfer">{$LANG.transferdomain}</a></div></div>{/if}

just replace the {$LANG.???} with a similar img link as previously - though you can give the images specific filenames now as they're not being called in a loop.... ignore the temptation to alter them in the language files.


ideally, what you would also do in the code is first check to see if the image exists - if not, display the text instead - but as you only have four groups and you wanted it kept simple, I haven't bothered - there shouldn't be any need for it in your case anyway.


note, there is an error in your products.tpl line at lines 70 & 71 - the same line is duplicated, so you will see two "Register Domain" links in your category section... as outlined above, you can also replace the text in these categories with images too.


btw - as you are modifying the template code in the slider orderforms, it might be worth copying the slider folder, renaming it and reuploading to the site - the reason being that when you come to update WHMCS, you may overwrite these changes - but if you rename the directory, this shouldn't be an issue.

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.

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