Simple Payments: Widget #24617
Labels
[Feature] Customizer
The site customizer for traditional, non-block themes.
Simple Payments
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
Milestone
Scenario
The user wants to add an existing Simple Payment button to the site sidebar, make changes to a published Payment Button, or create a new one.
Steps
Select the widget
Everything starts with either selecting an existing widget from a sidebar item, or adding a new one to one of the theme's sidebars.
To do so, the user has to:
The customizer should display a drop down list of existing Payment Buttons, with the option to edit the selected item, or give the user the option to create a new one.
Add Existing Payment Button
To add an existing Payment Button as a widget, the user only needs to select it from the drop down list, where they will be listed by name. They have to be listed using the same sorting than the Simple Payments dialog on the Editor.
The changes are saved live, and the content of the selected payment button should show on the preview window. Only when the user publishes the customizer changes, they will show on the site.
Create a new Payment Button
The user should be allowed to create new Payment Button directly on the customizer in case there are none available, or no existing button satisfies the user requirement.
To do so, the user will have to:
While creating a new Payment Button, the drop down list of existing items should either be disabled or show a generic text for new items.
All changes should be live, and should reflect on the preview as the user fills the form.
When saving the new button, it will get added to the drop down list and it will marked as selected. The preview window should reflect this change.
Adding a Payment Button this way makes it live, and available on the Editor.
Edit an existing Payment Button
Form Actions
![img_2186](https://user-images.githubusercontent.com/233601/39517047-0314b006-4dff-11e8-9cae-437627b8a338.JPG)
Image Actions
![image_edit_replace](https://user-images.githubusercontent.com/233601/39516668-eb6a0fd8-4dfd-11e8-938b-e5f1f3d33e27.png)
All the changes are saved when clicking the
Deleting an existing Payment Button
The edit action on the widget customizer allows the user to remove any existing Payment Button from the system.
Since this action is permanent and could potentially affect existing posts or pages, we need to display a confirm dialog.
Once the action is confirmed, the form should close, the Payment Button should be removed from the drop down list. The first element on the list is now the selected Payment Button, and the preview should reflect that change.
Tasks
I've created separate issues for technical tasks that will need to be completed for this flow to work.
The text was updated successfully, but these errors were encountered: