Problem/Motivation
When you first install commerce, and you visit the products page to create your first product, your presented with a page that notes you first need to setup your first store. "Products can't be created until a store has been added. Add a new store."
This is great, so you start to create your first store with such details as name address etc., except you can't actually create your first store until you first setup a currency. So its a bit backwards.
Add a Product:
Create your Store:
Error Message:
Proposed resolutions
Option #1: Introduce a setup wizard in the UI when commerce is first installed. Custom configuration of currency and tax rates will be accommodated through the existing UI as they require a more complex approach in regards to setup.
The idea will be to have a "quick" installation method to get your store up and running within a matter of minutes.
Other core commerce modules and contributed modules will be allowed to hook into the step system so they can add their own steps to the wizards guided UI.
Option #2: Introduce the core tour module with a step by step process for initial setup. Could just be a non-intrusive stand alone page, much like a docs page.
Option #3: Replace the messaging/link " Products can't be created until a store has been added. Add a new store." with something along the lines of; "Products can't be created until a store and a default currency have been created. Add at least one supported currency, then add a new store."
Option #4: Place a message with a link below the "Default currency" field, notifying the user they don't have a currencies created, and to create one.
User interface changes
The wizard will use existing drupal 8 core UI patterns for building a progressive step system before creating your store.
API changes
n/a
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#42 | improve_the_initial-2878968-42.patch | 22.81 KB | sorabh.v6 |
#42 | improve_the_initial-2878968-42-interdiff.txt | 2.32 KB | sorabh.v6 |
#42 | Peek 2017-09-01 20-00.gif | 575.75 KB | sorabh.v6 |
#40 | improve_the_initial-2878968-40.patch | 22.19 KB | sorabh.v6 |
#40 | improve_the_initial-2878968-40-interdiff.txt | 3.06 KB | sorabh.v6 |
Comments
Comment #2
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedComment #3
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedComment #4
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedComment #5
bojanz CreditAttribution: bojanz at Centarro commentedWe need to implement a setup wizard that creates currencies, stores, tax types, and then product/variation & order types.
Comment #6
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedSounds good, let me see what I can mock up for a wizard/user flow, and we can get it into dev asap.
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedGreat! Keep in mind that we can choose the currency and tax types based on the customer's country.
That's why the Console command asked you for the store country (a web page can ask for an entire address), then preselected a currency, and when confirmed, created the currency and the store.
For products I'm not sure what makes sense yet, I dislike the fact that we start with a "Default" type that means nothing, would be nicer to ask for a title and for attributes, so that you can say T-Shirt, with Sizes: Small, Medium, large and Colors: Red, Green, Blue, and have the types and attributes created. However, I'm worried people might confuse this with a product creation flow, or that they wouldn't care about this in this stage of the setup.
I would be fine with initially committing a wizard that's about stores/currencies/tax types only, leaving the order/product parts to a followup.
Comment #8
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedAlright so for the first part of the wizard setup this is what I've mocked up so far.
All and any feedback is welcomed.
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedWe might need to split 3) into three steps, to make it easier to hide the tax rate part if commerce_tax is disabled or there's no tax type plugin matching the store address.
The general idea will be to make this pluggable, allowing submodules (and even contrib) to add their own steps.
Comment #10
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedThanks @bojanz, sure I can split that up, I had that initially but was trying to reduce the number of clicks in the wizard.
How do you envision #3 being split up?
1. Confirm Currency
2. Confirm Tax Rates
3. ???
I'll talk to the guys about making the wizard function with other submodules & contrib.
Comment #11
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedComment #12
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedComment #13
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedAlright,
Here's the latest with the currency & tax steps broken up, also the addition of the cart's block placement step.
In total we have 6 steps, I think if we start adding in too many defaults it may deter some people in using the guide.
Anyways, let me know your thoughts!
Comment #14
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedFirst draft, has a new stepper component and all the UI work is done. Just need someone smarter than me to implement the software side of things.
Feedback welcome!
Comment #15
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedComment #16
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedUpdating IS (added GIF) and adding a Bartik admin screenshot.
Comment #17
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedNew patch, minor fixes to checkmark image path and link url.
Comment #18
gauravjeet CreditAttribution: gauravjeet as a volunteer and at Acro Commerce commentedVery interesting module, and great work!
I reviewed patch #17 on a vanilla install but somehow could not get the store up neither the currency was set up. Probably because there is no textfield/input fields where i can enter the new store's information.
Comment #19
gauravjeet CreditAttribution: gauravjeet as a volunteer and at Acro Commerce commentedFound that the
#type
used is 'stepper' :Is the stepper
#type
is something provided by default in Form API D8, if not, there is a need to mention a dependency on a contrib module ininfo.yml
file.Comment #20
heddnAs a PoC, I like the direction. Some small nits here and there, but overall, the look/feel is good. It would help with the PoC if we could surface at least one of the sub-forms to see how that would look in the overall flow.
I'm also going to bikeshed a little on the module name. commerce_setup seems better, or if this is planned to merge into core, then we can stop bikeshedding now.
Nit: Whitespace
I see what we are trying to do by calling this 'Wizard Setup', but I feel like 'Commerce Setup' or 'Initial Setup' in the menu is better. Wizard is too technical and tied to implementation. No matter how it is done, this is a setup feature.
I installed this patch on an already setup Commerce site, so to see Wizard, etc was a little odd feeling.
Nit: new line missing.
Nit: 2 spaces and short array syntax.
Nit: missing new line.
Nit: missing new line.
Nit: missing new line.
Nit: missing new line.
Nit: 80 characters for comments and begin with a capital letter and end with a period.
Nit: 2 spaces instead of 4.
This shows up, even after commerce is fully installed. Maybe 'Hey! It looks like you want help setting up and configuring Drupal Commerce!' Or something better.
What is envisioned as the action if someone selects 'skip'? Would a config option be switched so that the menu option goes away or would the form list a success message saying everything is now setup?
Nit: 80 characters for comments.
Nit: 2 spaces instead of 4, and on through this class.
Nit: remove commented code.
This is jarring to see 'Next, location'. I thought I was setting up a store. What's with Location showing up. It might be less of an issue once the actual store details surface. However, we do need to consider how this will look when someone has already done partial setup where maybe the store and location are setup, but the currency is done at a later date.
Ah, I see later these buttons are changed to a 'Confirm'. I think I like that better.
Another note, if I re-edit the store, it resets status on /all/ of the later options. Actually, if I do that with any of the options, it resets the status for all up to that point. Forcing me to re-walk through the entire wizard. I didn't necessarily expect/want that.
This much to translate with all that markup is going to be hard. Shorter strings are better.
Comment #21
bojanz CreditAttribution: bojanz at Centarro commentedThe wizard will live in the commerce base module, so we don't need to bikeshed the patch module name.
Comment #22
rigids CreditAttribution: rigids commentedCreated a patch for #20
Comment #23
rigids CreditAttribution: rigids commentedComment #24
rigids CreditAttribution: rigids commentedRe-rolled patch
Comment #25
heddnre #24: can I see an interdiff? And usually when something is ready to be looked at again, we change the status to Needs Review. Is this ready for review or are you still working on things.
Comment #26
pbrown063 CreditAttribution: pbrown063 at Acro Commerce commentedUpdate to .patch file with changes:
- Added fields to steps 1 and 2 of the setup
Next tasks:
- Pull those fields from the /store/add form instead of having them free form
- Add functionality to create a store entity when the 'Create Store'
button is clicked in the wizard
Comment #27
heddnCan we see some updated screenshots of step 1/2?
Comment #28
pbrown063 CreditAttribution: pbrown063 at Acro Commerce commentedUpdated Step 1 and 2 screen shots
Comment #29
heddnGenerally speaking, I like this. I don't like the wording of the buttons. Maybe 'Proceed to Next Step'.
Comment #30
AaronChristian CreditAttribution: AaronChristian at Acro Commerce commentedI'll agree with @heddn here, we can probably just make it a "catch-all" for verbiage on the button, less configuration is better.
Comment #31
sorabh.v6Comment #32
sorabh.v6Previous patch was failing. So fixed it, and changed the labels of stepper buttons as per #29. Create Store button is disabled, how can I activate it when all steppers are done.
Comment #33
sorabh.v6Hi, I suggest changing country field with select-list, like we have in store add form.
Also, I think we should have user reference field for Owner instead of a plain text-field.
Comment #34
heddnStray comment.
I think I see a trend towards lower case for all but the first word for buttons in the wild. So, "Proceed to the next step" is preferred.
This much markup interspersed with translatable text is not really good for i18n. Let's just do the t() on the wording and concatenate the p tags, etc.
Comment #35
SilverBallz CreditAttribution: SilverBallz commented.
Comment #36
heddnSo, after we add the create forms to the wizard, we need to make some decisions. I think there are two possible paths. I prefer one over the other. We need to decide what to do when a site is already configured, or partially configured. No need to add store details and location if we've already added those.
Path #1:
If something exists, state it already exists and provide a link to the admin page where the thing can be edited. By providing a link, we can direct folks to the listing page for stores and blocks. And we don't have to decide which is the "primary" block or payment gateway.
Path #2:
Arbitrarily or deterministicly elect a "primary" store of payment gateway and display it in the edit form; instead of the normal create store form, payment gateway form, etc.
I prefer option #1. But I've listed #2 for completeness sake.
Comment #37
sorabh.v6@heddn I have created SubformState for the stepper in the form. I have also made changes suggested above. Request you to review.
Thanks
Comment #38
sorabh.v6Comment #39
sorabh.v6New patch uploading.
This patch contains code for split 'store add' form for 'store details' and 'store location'.
Now, need to get location details upon click of stepper button so that currency suggestion can be made based on store location. Need some guidance on how I can get form details upon clicking stepper button.
Thanks
Comment #40
sorabh.v6Uploading correct patch and interdiff.
Comment #41
heddnWe'll probably need to do the location => currency via AJAX. See https://api.drupal.org/api/drupal/core%21core.api.php/group/ajax/8.2.x.
Comment #42
sorabh.v6I applied ajax to location submit button and created a callback function. But control doesn't enter the callback function, and throws error in the below screenshot.
Please suggest a solution.
Comment #43
a.dmitriiev CreditAttribution: a.dmitriiev at 1xINTERNET commentedI suggest using InlineFormManager for this since it is in commerce 2.13 already. Also I think it should not be a separate module, because the core commerce module is enabled anyway, this should be there. It is only needed to restrict the access to wizard after it was configured.
Comment #44
FiNeX CreditAttribution: FiNeX as a volunteer commentedHi, the setup wizard looks a very good idea. Has it be abandoned?
Comment #45
dwkitchen CreditAttribution: dwkitchen at Centarro commented