Customer Registration Group Tag

Questions and answers about ShopSite Custom Templates

Customer Registration Group Tag

Postby aisg » Fri Apr 11, 2014 8:27 am

I want to modify the Template for Customer Registration where they see their Account Information and I want to show the group they belong to right after where their name is displayed. What is the Customer Group tag called? Could not find it in the tag help pages.

Basically I want to do this:
[-- CR_CUSTOMER_NAME --] - [-- CR_CUSTOMER_GROUP --]

Thanks
aisg
 
Posts: 21
Joined: Tue Jun 07, 2011 8:10 pm

Re: Customer Registration Group Tag

Postby ShopSite Lauren » Fri Apr 11, 2014 1:54 pm

There isn't a tag to pull the customer group information. However, thanks to this post, this feature will be added into the next release (likely a maintenance release) of ShopSite.

If you would like to add this information before the next release, you could use JavaScript to read the customer registration cookie, because the group a customer is assigned to is in the cookie information.

I haven't checked my code below (the basic idea is there), but here is some sample code that could work to pull the customer registration group from the customer registration cookie. I am not the best at JavaScript, so the code below is a bit messy, but should work.

<script type="text/JavaScript">
function DisplayLogGroup(name) {
var cookies=document.cookie;
var start = cookies.indexOf(name + "=");
var name = "";
var start1;
var end1;
var tmp;
var signed_in = -1;

if (start != -1) {
start = cookies.indexOf("|", start) +1;
var end = cookies.indexOf("|", start);
if (end != -1) {
signed_in = cookies.indexOf("|yes", start);
group = unescape(cookies.substring(start,signed_in));
if ((signed_in != -1) && (group != "<none>")) {
document.write(" - " + group);
}
}
}
}
</script>

<p>[-- CR_CUSTOMER_NAME --]<script type="text/javascript">DisplayLogGroup("[-- RegCookieName --]");</script>
- ShopSite Lauren
Contact me for help with any of your
custom ShopSite template questions.
ShopSite Lauren
 
Posts: 887
Joined: Fri Aug 11, 2006 1:35 pm
Location: Orem, UT

Re: Customer Registration Group Tag

Postby aisg » Fri Apr 11, 2014 2:21 pm

Oooh...excellent! That will work for now! Thanks, Lauren!
Glad to see you are still around to give great advice still!
Dave
aisg
 
Posts: 21
Joined: Tue Jun 07, 2011 8:10 pm


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 20 guests

cron