Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to change logos for different users?

How to change logos for different users?

Views: 813

Results 1 to 7 of 7
25 Dec 2011, 2:00 AM
#1
nwfap avatar

nwfap

New Zenner

Join Date:
Dec 2011
Posts:
20
Plugin Contributions:
0

How to change logos for different users?

Hello,

I'm working with 1.3.9 and MultiSite mod running. I'm only focusing on my first site (lets call it site1.com) and I'd like to create TWO different types of users "Regular" users and "Pro" users. The only difference between the "Pros" and regular users are that they would get a price percentage discount (which would vary depending on how often they purchased products from us) and they would have a different logo "Site.com Pro" displayed to show them that they are getting their discount and are part of our "Pro Program".

My two questions are:

  1. Since I'll have to use different discount groups for the pros, how would I create a check field on the individual user record to show if they are a pro or not?

  2. What files to I need to change to get the check to happen and switch the logo?

Thanks!

NWFAP

25 Dec 2011, 1:51 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How to change logos for different users?

  1. If you're using the built-in group discount pricing, there is already a line item (Pricing roup) that shows the group assigned to a customer in Admin - Customers - Customers.

  2. I think you'd need to write some code for that.

29 Dec 2011, 6:49 AM
#3
nwfap avatar

nwfap

New Zenner

Join Date:
Dec 2011
Posts:
20
Plugin Contributions:
0

Re: How to change logos for different users?

Stevesh - Thank you for the response! Here is the few problems I face with using the group discounting:

stevesh:

  1. If you're using the built-in group discount pricing, there is already a line item (Pricing roup) that shows the group assigned to a customer in Admin - Customers - Customers.
  • I will have my "Pro" users in several groups with different names (IE one group may be named "Pros", one group many be named "Invoice" [since I'm using the pay via invoice payment option module], another group may be named "Tax Exempt"

Also, some of the members of the groups that pros will be in are not actually pros (IE they may be in the "Invoice" group because I allow them to pay via discount - but I don't want a pro logo showing up).

Thanks!

NWFAP

29 Dec 2011, 7:52 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to change logos for different users?

some of the members of the groups that pros will be in are not actually prosThis would mean that the discount group is unusable for distinguishing the logo to be shown. Either you will have to not show the pro logo for the ambiguous group, or create another database customer field for identifying pros.

Alternatively, you could make two "Invoice" groups, one for pros and one for others. They can have the same conditions and rates, and nobody needs to know that there are two organizational groups.

The logo is output by /includes/templates/your_template/common/tpl_header.php, so that would be a good place to insert switching code.

29 Dec 2011, 7:59 AM
#5
nwfap avatar

nwfap

New Zenner

Join Date:
Dec 2011
Posts:
20
Plugin Contributions:
0

Re: How to change logos for different users?

gjh42:

This would mean that the discount group is unusable for distinguishing the logo to be shown. Either you will have to not show the pro logo for the ambiguous group, or create another database customer field for identifying pros.

GJH - Thanks for the response! My plan was to add a customer field for identifying pros - I remember seeing an add-on to do this - do you know of an add on that allows me to do so?

Alternatively, you could make two "Invoice" groups, one for pros and one for others. They can have the same conditions and rates, and nobody needs to know that there are two organizational groups.

gjh42:

The logo is output by /includes/templates/your_template/common/tpl_header.php, so that would be a good place to insert switching code.

Thanks this is the location I needed to know!

29 Dec 2011, 8:04 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to change logos for different users?

Another good location to edit would be /includes/languages/english/your_template/header.php. Wrap a test around this and make alternates as desired:```php
// added defines for header alt and text
define('HEADER_ALT_TEXT', 'Powered by Zen Cart :: The Art of E-Commerce');
define('HEADER_SALES_TEXT', 'TagLine Here');
define('HEADER_LOGO_WIDTH', '192px');
define('HEADER_LOGO_HEIGHT', '64px');
define('HEADER_LOGO_IMAGE', 'logo.gif');

29 Dec 2011, 8:07 AM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How to change logos for different users?

Look in Free Addons for a mod for additional customer fields, if you want to go that route.
If you want to use discount groups, you can test for the customer id being in any one of a number of specified group ids.