View Full Version : Group Desriptions
Chainsaw76
12-22-05, 03:08 AM
It would be nice (as an option) of having a group description displayed as a user switches groups (early in the signup process).
-Jason
That's exactly what I'm looking for. :)
Zorro67
01-04-09, 12:48 PM
A great idea - product descriptions as an overview for each product group, which can then be displayed in templates. i'd like to see that.
ChrisGooding
01-05-09, 03:59 PM
I suppose......... and I'm speculating here.... that you could do it by moddifying the templates.
Simply add a section on the page where you want them displayed, and then ising {if} statements have it display a pre-determined piece of text depending on the group id shown. Even so far as to have it call the text from somewhere so changing the description doesnt require messing with the templates all the time.
I'm not the best coder here by a long shot, but I reckon it could be put together quite simply, if not done already.
I may have a go at it, as it does sound like a bloody good suggestion, that could be used to great effect if done right.
I may be slow though, so if there is someone else who follows my thinking that wants a go too, feel free and we'll bounce some ideas in here :)
Zorro67
06-12-09, 04:17 PM
I know this is an old thread but I realised I forgot to post my solution to it.
Many thanks to Sparky for helping me debug the solution.
In your products.tpl file, add the following line <h2>{$LANG.productgroupdesc.$gid}</h2>
immediately after <p align="center" class="cartheading">{$LANG.cartbrowse}</p>
format it how you want.
Then in your language file, add the following array
$_LANG["productgroupdesc"] = array(
"1" =>"Description for prod group 1 ",
"2" =>"Description for prod group 2 ",
"3" =>"Description for prod group 3 ",
"4" =>"Description for prod group 4");
etc etc.
You can add as many descriptions as you have group ID's, but make sure you have a comma between each array item and finish the array with a ); "bracket semi-colon"
Then when you lang file is loaded, it contains the details of the description array.
I'm sure some-one could do this with a custom table and a MySQL call, but to date no-one has, so feel free to use this fix.
Just attached a screenshot so you could see the result (circled). You can also see the SEF Anchor link to each product in the group. very useful if each product takes up a bit of screen realestate - each anchor shows title and description of product
I usually end up breaking stuff when I try this, any way to do it for a newb?
Zorro67
09-23-09, 12:15 AM
Yes, copy your standard template to a new one, and edit the new template. After you've made the cahamges to the copies template, test them out by by appending the following to your products page
&systemtemplate=newtemplatedirectoryname
When you are done viewing, don't forget to add
&systemtemplate=originaltemplatedirectoryname
to get back to your original template
The method by zorro works great only I'd like to add a bit more formatting to the entire page so it appears visibly different per product group.
I tried without success
{if $gid=1}
<div class="group1">page wrapped</div>
{/if}
{if $gid=2}
<div class="group1">page wrapped</div>
{/if}
{if $productgroup.gid == "1"}
<div class="group1">page wrapped</div>
{/if}
How can i add a variable to smarty to recognize that switch and execute as I need?
thehost5968
09-29-09, 01:26 AM
Hi
I find this a good way of doing it:
put this at the top of templates/orderforms/your form/products.tpl:
{foreach key=num item=productgroup from=$productgroups}
{if $gid eq $productgroup.gid}{assign var=productgroupgid value=$productgroup.gid|replace:" ":""}{/if}
{/foreach}
then put this where you want it to show:
{include file="orderforms/cart/header/$productgroupgid.tpl"}then make a folder and file in templates/orderforms/your form/header/29.tpl or the like then you have a full page to work with instead of a file that will end up with about 2000 + line in it.
P.s I have this for a header, footer, socialbookmark and will be doing one for alsopurchased also.
thehost5968, this solution is excellent. Thumbs up!
Thanks
thehost5968
09-29-09, 08:34 AM
Thanks,
It may need a if statement so if the page is not there then show now code.
but at this time it is not showing any errors on screen but there will be a error I think.
othellotech
09-30-09, 03:21 PM
put this at the top of templates/orderforms/your form/products.tpl:
you already have the gid in $gid, so looping through seems pointless :)
you can do it with ...
{include file="moreabout$gid.tpl"}
thehost5968
09-30-09, 04:15 PM
Why? OK here is the post I did to get this working at first I was using the group name but then I got lazy on typing lot's of group names so just changed it to a more simply group id which in my case is only 2 numbers but for the same reason's as the linked post is why I did not do it your way (I think it had some think to do with the gid not all way maching! but do not hold me to that)
http://forum.whmcs.com/showthread.php?t=21863
Zorro67
10-01-09, 01:49 AM
Why? OK here is the post I did to get this working at first I was using the group name but then I got lazy on typing lot's of group names so just changed it to a more simply group id which in my case is only 2 numbers but for the same reason's as the linked post is why I did not do it your way (I think it had some think to do with the gid not all way maching! but do not hold me to that)
http://forum.whmcs.com/showthread.php?t=21863
Was think about the customisation question from post #8, as well as your post above. There might be a way to handle this so that you have some customisation for product groups.
Rather than populate your language file with a description, create 2 groups of files: a language file and a css file.with numbers that correspond to your GID
eg language.001.php, language.002.php, language.003.php etc, and
products.001.css, products.002.css, products.003.css etc
Make the text in each language file specific to that product group
$_LANG["productgroupdesc"] = "Insert your description for prod group here";
(you could also call tooltips, or extended descriptions, or other help info specific to that product group, simply by adding a custom description to each language file , obviously each 'type' would use the same name across language files)
your css file could represent different title or background colours or layouts specific to that product.
then in your template page use an if statement above to call the relevant language and css files
eg
include file="language.$gid.php";
include file="products.$gid.css";
Note: check which path you should use
Also in your products.tpl (or other order templates) simply display <h2>{$LANG.productgroupdesc}</h2>
When I get around to testing it, I'll post the results
thehost5968
10-01-09, 02:01 AM
Zorro67 (http://forum.whmcs.com/member.php?u=7787)
sorry I was not replying to post #8 but just posting anther way of adding a header and or footer etc.. to the page by only just adding 4 line of code and making 1 file ( that could have custom css in as inline or it's own css file) for each group and not having one files being to big and also better for when there is a upgraded to be done(like v4.1.1 out now).
columbusgeek
12-30-09, 02:13 AM
great tip. thanks so much.
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.