148 Posts
pixelneco
6 years ago
8
Topic

Hi Seblod Community,


whats is it about:
A form for a customer request. The request comes from a phone call or via mail, so the form is filled by an admin/ team member (and not by the customer). Fields: topic, the request, customer name, mail, address, phone etc.

here is the challenge:
Customers contact data (like name, phone, mail…) should be saved also somewhere else (article? free object?), so these information are available separated from the article with the request.

To avoid duplicate data, there should be also a possibility to check if the customer already exists. if he/ she exists then the existing data should be used for the new request.

It would be really great, if the request is filled with only one step. Filling the request data and the new customer data / filling the request data and choosing the existing customers data and connect it with the request for further steps.

Would not be fair to expect a perfect and detailed solution here for a complex problem like this one (but feel free to do it if you want :) ). It would enough if someone could give me some approach how to start this thing.

Kind regards

Necati | pixelkultur

Get a Book for SEBLOD
1283 Posts
Bucklash
6 years ago
7
Level 1

My first thought is that you have the two content types based on article object:

customer 

request

Each request would reference a customer id.

So at start of request form, check email address against #__cck_store_form_customer.email using Seblod's '4' 'Required/Validation'.

From there it depends on your skill level with jQuery and php etc.

Maybe this:

If email matches have a 'load customer info' button which is really a save button.

Using beforestore get the data from #__cck_store_form_customer

and populate #_cck_store_form_request fields/storages.

The form will save and reload with the customer info.

Then carry on filling in request


Something like that anyway :)

 

148 Posts
pixelneco
6 years ago
6
Level 2

Woow, just a brilliant approach! Thx a lot Bucklash! Did not thought about the validation thing at all. And the second idea is also great.

What about editing the customer data in the request article after the first procedure? It often happens, that there is a little typing error like the phone number, zip code etc. So the admin can go back to the request article and changes the customer data directly there.

Best regards

Necati | pixelkultur

1283 Posts
Bucklash
6 years ago
5
Level 3

Hi

Hmm - do you need the customer data stored in each request or can you simply reference it?

In the request use a list field to display the customer details - and an 'edit customer details button' 

If customer details are stored in each request then the before store field can be on 'add' from the 'workflow' options....

...so when you create a request you will populate the request form with customer details or enter them manually, and then when you edit the form the beforestore will not be used....

148 Posts
pixelneco
6 years ago
4
Level 4

Hi Bucklash

referencing would be enough. i guess this makes it easier to handle the whole structure or?

1283 Posts
Bucklash
6 years ago
3
Level 5

Hi

Yes, I would have thought it would be more 'proper'. 

Be good to see what you end up doing and how you did it 

148 Posts
pixelneco
6 years ago
2
Level 6

Hi Bucklash,

thx a lot for sharing your thoughts and ideas. also for being so active here generally. really appreciated.


I am focusing on two approaches:

Alternative 1: Entering the customer data in the request form

  1. The admin enters the request data in the form
  2. He also can enter the customer directly in this form: For this approach, i am going to use your great tutorial about creating content dynamically: here
  3. With the beforeStore plugin, i can give the request the art_id of the customer by referencing to the most recent id + 1. (also explained in your tutorial)


Alternative 2: Entering customer data, then request data

  1. The admin enters the customer data in the customer data form and save
  2. This form has a Button „New Request“, which only appears after the the customer form is saved for the first time (workflow: edit).
  3. The Button opens the request form (maybe in a modal window). I give the button the article id of the customer via url-parameter
  4. The request form takes the parameter for referencing to the customer.
  5. Both forms have a list field with the the corresponding customer data/ request(s)


About avoiding duplicate customer data:

Unfortunately only one field (like mail or last name) would not enough for validation. Is there a possibility to combine multiple fields for ajax validation? Example:

Check if:

first name
last name
adress
zip

exists in this combination. If yes don't save and give a possibility for getting the existing data to the request form. If no, create a new customer.

Unique customer ID and request ID

Also i have some thoughts about a unique, auto_increment customer id and also a request id. Since customer data and the requests are Joomla articles, which is fine for me, article id would not works here. Instead the article id i thought about this:

A new field with storage standard | article | customer_id | int

With beforeStore Plugin, i check the most recent customer_id and give a „+1“ for the next one (also using your tutorial mentioned above). For internal referencing, Joomlas article id would be enough. The customer_id and request_id could be used for other purposes. Otherwise, maybe i could use them also or referencing. I would appreciated if you could also give a thought to this.

 

Best regards

Necati | pixelkultur

1283 Posts
Bucklash
6 years ago
1
Level 7

Hi

Watch out for that 'dynamic create' tutorial.  

Seblod 11.0 has updated methods for such things   

Both of your alternatives sound cool, depends doesn't it. 

As far as ajax for combination of values, I am not sure, sorry.  

And customer_id field is cool too :)

 

148 Posts
pixelneco
6 years ago
0
Level 8

Great, thx a lot  for your help Bucklash! Still suprised how powerfull SEBLOD can be. Amazing...

Get a Book for SEBLOD