Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding custom User Profile field

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-15-2009, 05:54 PM
 
2inchesofwater 2inchesofwater is offline
 

Member
  
Join Date: May 2007
Posts: 24
 

Default Adding custom User Profile field

Hi,

My clients have asked if they can give some of their loyal customers a bulk discount on some products.

I figure I'll use a couple of custom fields on Products to sort out the bulk discount part of their request, but I'm a bit stuck on assigning the loyalty discount in the first place.

What I've done so far is create a custom field in User Profiles called 'Loyalty Discount', and made it available to Administrators only.

When an Administrator goes into Modify Customer Profile for an individual Customer, the admin should be able to toggle that Loyalty Discount. The catch is, the custom field doesn't appear in Modify Customer Profile.

Any thoughts on how to make a custom field appear in Modify Customer Profile, and then get saved into the database?

Cheers,
Dan

Oops, and I need to change my sig to say that I'm using X-Cart Pro 4.2
__________________
xcartpro4.2
Reply With Quote
  #2  
Old 04-29-2009, 07:48 PM
 
2inchesofwater 2inchesofwater is offline
 

Member
  
Join Date: May 2007
Posts: 24
 

Default Re: Adding custom User Profile field

We're still looking for a solution to this issue... can anyone help, please?
__________________
xcartpro4.2
Reply With Quote
  #3  
Old 04-30-2009, 12:40 AM
 
2inchesofwater 2inchesofwater is offline
 

Member
  
Join Date: May 2007
Posts: 24
 

Default Re: Adding custom User Profile field

Okay, so this is me jotting down some thoughts to get my own head around this issue.

I've discovered that if I activate the "Loyalty Discount" custom field for Customer usertypes (not just Admins), then the field appears on Customer user profile pages. That's a good start, but doesn't solve the problem.

The Loyalty Discount is a setting that only Admins should be able to set, on a Customer by Customer basis. Customers (and Providers too) should never be able to see this particular custom field.

I've tracked the presentation code all the way to skin1\main\ register_additional_info.tpl
Of course, the whole point of Smarty is to divorce the presentation layer from the business logic layer. So I need to head back up the tree, and find some PHP code where I can shut off this one particular instance of custom/registered fields.

When I get there, I need to check the custom fields carefully, because I don't want to shut down any future custom fields.
I'll be looking to check that the $fieldid does not equal this particular custom field - every other custom field should slip straight through the filter. I know that isolating and hard-coding one custom field isn't a great idea, but running out of ideas and budget on this project. I also need to check that it's only Admins who can see this custom field.
__________________
xcartpro4.2
Reply With Quote
  #4  
Old 04-30-2009, 12:52 AM
 
2inchesofwater 2inchesofwater is offline
 

Member
  
Join Date: May 2007
Posts: 24
 

Default Re: Adding custom User Profile field

Hmm... so where are the data objects, such as custom/registered fields, assembled?

...
__________________
xcartpro4.2
Reply With Quote
  #5  
Old 04-30-2009, 08:31 PM
 
2inchesofwater 2inchesofwater is offline
 

Member
  
Join Date: May 2007
Posts: 24
 

Default Re: Adding custom User Profile field

Aaaaaaaaand now I feel like a chump.
Have just discovered all of this should be possible using Discounts and Wholesale pricing.

Thread closed.
__________________
xcartpro4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:21 AM.

   

 
X-Cart forums © 2001-2020