X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Adding custom User Profile field (https://forum.x-cart.com/showthread.php?t=46974)

2inchesofwater 04-15-2009 05:54 PM

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

2inchesofwater 04-29-2009 07:48 PM

Re: Adding custom User Profile field
 
We're still looking for a solution to this issue... can anyone help, please?

2inchesofwater 04-30-2009 12:40 AM

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.

2inchesofwater 04-30-2009 12:52 AM

Re: Adding custom User Profile field
 
Hmm... so where are the data objects, such as custom/registered fields, assembled?

...

2inchesofwater 04-30-2009 08:31 PM

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.


All times are GMT -8. The time now is 10:57 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.