Create customers in admin & assign categories to users

Open to all! Ask other shopowners for help.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Create customers in admin & assign categories to users

Post by LeeFoster »

I'm looking for 2 addons for a site I'm working on.

1. Create Customers from admin
2. Assign Categories to Customers

Number 1 is pretty self explanatory, number 2 I would like to have some categories show to specific customers.

Before I start working on these does anyone know of anything similar that already exists?


Join The Code Co-op to get access to your library in the Code Co-op Forum
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Create customers in admin & assign categories to users

Post by raiwa »

1.: There was an addon in the old marketplace "Create Account & Manual Order Maker" which was linked to the old order editor. You could use the part of create account as a starting point.
2..: If you wish to assign categories to customer groups, it should be possible to extend my Wholesale addon to assign categories to wholesale group(s). If you need it for individual customers/different categories for each customer, it's not useful.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Create customers in admin & assign categories to users

Post by burt »

I haven't tried, but in recent versions of Phoenix, the admin pages are sort of modular using views and actions. So you may be able to add in a new view in the customers.php page?

A bit like editing an existing customer? You would just be "editing" a blank customer.

As I say, untried.
I am not here to build for you.
I am here to build with you. Let's help each other.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

raiwa wrote: Tue Jun 21, 2022 4:46 pm 2..: If you wish to assign categories to customer groups, it should be possible to extend my Wholesale addon to assign categories to wholesale group(s). If you need it for individual customers/different categories for each customer, it's not useful.
No it's single category single customer.
burt wrote: Tue Jun 21, 2022 5:38 pm I haven't tried, but in recent versions of Phoenix, the admin pages are sort of modular using views and actions. So you may be able to add in a new view in the customers.php page?

A bit like editing an existing customer? You would just be "editing" a blank customer.

As I say, untried.
Will have a look into this tomorrow
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

LeeFoster wrote: Tue Jun 21, 2022 2:35 pm 2. Assign Categories to Customers
Working on this first, I have the drop down to select a category hooked in. I'm struggling to see how to process this into the database though. Normally I'd have used the hook for updateAction but this doesn't exist in customers.php at the moment.

Any suggestions appreciated.

Site is Phoenix 1.0.8.14 for reference.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Create customers in admin & assign categories to users

Post by Kofod95 »

onchange=this.form.submit()?

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

Thought I'd share a list of things I think I'm going to need to do and hopefully cross them off as I go. Happy to listen to ideas on how to achieve some of these.

1. Create hook to add categories to customer.
2. Add category type (private, public etc).
3. Create table - customers_to_categories
4. Create hook to hide "private" categories.
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Create customers in admin & assign categories to users

Post by ecartz »

LeeFoster wrote: Wed Jun 22, 2022 9:26 am Normally I'd have used the hook for updateAction but this doesn't exist in customers.php at the moment.
Have you tried it? There are hook listeners for both the actions processed by admin/customers.php : updateAction and deleteConfirmAction

But it would probably make more sense to create a new action, as update won't work for a customer who doesn't exist.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

ecartz wrote: Wed Jun 22, 2022 10:03 am
Have you tried it? There are hook listeners for both the actions processed by admin/customers.php : updateAction and deleteConfirmAction

But it would probably make more sense to create a new action, as update won't work for a customer who doesn't exist.
I haven't tried it, I didn't know there were listeners for it that would work without there being an actual hook in the file.
LeeFoster
Contributor
Posts: 263
Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times

Re: Create customers in admin & assign categories to users

Post by LeeFoster »

This
LeeFoster wrote: Wed Jun 22, 2022 9:44 am 1. Create hook to add categories to customer.
And this
LeeFoster wrote: Wed Jun 22, 2022 9:44 am 3. Create table - customers_to_categories
Are now done and working for existing customers. It is configured to use check boxes to allow multiple categories to be selected for each customer.

Next on to
LeeFoster wrote: Wed Jun 22, 2022 9:44 am 2. Add category type (private, public etc).
@ecartz are there any listeners I can use on catalog.php?


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply