Jump to content

Displaying Products on homepage.tpl


ambalium

Recommended Posts

Hello Community!

 

Given that I am a newbie (but a fast learner), I would like to know how to make the default index.php of my whmcs display a set of product (e.g. web hosting services) as against the Twitter/Newsreplace feed on the homepage.

 

I know the $If $twitter and Else $Announcement smarty code is responsible for rendering the twitter or announcement but I would rather want to use my products I've setup in the products area.

 

 

What i want to achieve is attached (someone has done this but I have googled this to no avail)

homepage-tpl.png

Link to comment
Share on other sites

there's no quick & simple built in way to do this as the homepage doesn't natively have access to the required variables that the cart does... so while you could copy the layout code from the orderform templates products.tpl page and add it to homepage.tpl, it would have no product information within it to display (no product names, descriptions, prices etc).

 

therefore, you would need to add that information to the homepage either by using a hook to query the database, or by using Data Feeds - the hook method would be more complicated, but using data feeds would be simpler (though potentially slower).

 

btw - I wouldn't be surprised if WHMCS v8 did it next year, but until then you basically have the above options.

Link to comment
Share on other sites

Thank you Brian!

 

I have benefited from your various contribution here which has helped to get hold on whmcs at a faster rate.

 

I would appreciate if you could help with a step-by-step process in achieving the explanation you made.

 

However if there is a commercial module/add-on to also achieve this I would be glad for your recommendation.

 

Thank you!

Link to comment
Share on other sites

which one - hook or data feeds?

 

data feeds should just require copying of template across and replacing variables with data feed output...

using hooks, would require some tweaking to the template to make it work..

 

https://forum.whmcs.com/showthread.php?128774-Product-Info-on-Custom-Pages

 

I would appreciate if you could help with a step-by-step process in achieving the explanation you made.

using which orderform template? from the image, I can't tell if it's a commercial custom template or one of the comparison templates restyled...

 

this is one of those situations where it would take longer to explain how to do something than it would to actually do it, so there's no point in me giving you details for a template you aren't using. :)

 

However if there is a commercial module/add-on to also achieve this I would be glad for your recommendation.

the only addon that i'm aware of that does this is a free one, Product View on Any Page, though whether it's compatible with v7 and/or your orderform template, I cannot say - though the version I downloaded a few months ago would only work with Boxes & Modern, it looks like you might need to pay to use it with other orderform templates. :roll:

 

0Uzt95r.png

 

I can remember trying it, thinking it was absolute rubbish and quickly uninstalling it, but perhaps it will suit your needs. :idea:

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