Add a customer from admin?

Open to all! Ask other shopowners for help.
Post Reply
maxi032
Posts: 3
Joined: Tue Apr 09, 2024 7:59 pm
Phoenix Version:

Add a customer from admin?

Post by maxi032 »

What would be the best way to proceed about doing that?
I want to allow customer registration only via the admin area.
Currently customers have an edit action associated with an update but how can I add an 'add' action associated with create? I was able to "repurpose" the form that was made for editing, in such a way to allow an extra action=add in the url. So in this case the customers.php POST method will have action=create instead of update in the FORM but I don't know where processing of the form for "create" should take place. I am using v1.0.9.0
Any help would be appreciated.


Join The Code Co-op to get access to your library in the Code Co-op Forum
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: Add a customer from admin?

Post by Kofod95 »

If you look in admin/includes/actions/customers you can see the actions as they are. If you add a new file there called create or add (depending on what you end up calling your action) and put the processing of form data there, things automagically work.
You can look at actions/info_pages for an example that has both add_new and update actions.

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Phil
Member
Posts: 16
Joined: Thu Sep 07, 2023 6:15 pm
Phoenix Version:
Has thanked: 2 times
Been thanked: 1 time

Re: Add a customer from admin?

Post by Phil »

Following up on this, seems like it is a great idea to have the ability to add customers, even edit/add orders in the admin panel.
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: Add a customer from admin?

Post by burt »

I'm almost certain that addons already exist to cover "adding customer" and "add/edit order".
I am not here to build for you.
I am here to build with you. Let's help each other.


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