The article covers the following topics:
Add new section
To add a section:
- Navigate to the Checkout Field Editor settings page (WooCommerce → Checkout Form)
- Click on the Add new section button.
- Enter a Name/ID, Display Position, Title, and other details for your section.
- Set Display Styles if required.
- Set Display Rules if required.
- Set Repeat Rules if required.
- Click on the Save button.
All these tabs are explained below.
Basic Info
This tab contains fields to capture all the basic details of the section. Given below are the fields available in the Basic Info tab. Configure these properties based on your needs.
Name/ID | Unique name or ID for the section. No two sections can have the same section name. |
Title | Title or label for the section. |
Subtitle | Subtitle or description for the section. |
Display Position |
The position in the checkout page where the section is to be displayed. This is a dropdown list with all available positions. NOTE: Enable ‘Terms and Conditions before opting to display section Before/After Terms and Conditions |
Display Order | A number indicating the display order of the section. |
Show section title in the checkout page | Tick the checkbox to show the section title on the checkout page. |
Show section title in my account page | Tick the checkbox to show the section title on my account page. |
Display Styles
CSS Class | A comma-separated list of CSS classes is to be added to the wrapper element. |
Title Class | A comma-separated list of CSS classes for the title tag. |
Subtitle Class | A comma-separated list of CSS classes for the subtitle tag. |
Title Type | The type of title element. Ex. H1, H2, etc. |
Title Color | The color of the title text. |
Subtitle Type | The type of subtitle element. Ex. H1, H2 etc. |
Subtitle Color | The color of the subtitle text. |
Display Rules
Set display condition from this tab. Read the article Display Rules to know more about display rules and their configuration.
Repeat Rules
Set repeat rules from this tab. Read the article Repeat Rules to know more about repeat rules and their configuration.
Edit section
You can change the properties of a section, all properties except Name/ID of a section can be modified.
Note: The properties of default sections(ie, Billing, Shipping, and Additional) are not editable. Only custom sections can be edited.
To edit a section:
- Navigate to Checkout Field Editor settings page (WooCommerce → Checkout Form)
- Click on the pencil icon near the section you want to edit.
- A popup form will be displayed, you can edit the section properties.
- Once done with the edit, click on the Save button to save the changes.
Note: The properties of default sections(ie, Billing, Shipping, and Additional) are not customizable. Only custom sections can be edited.
Note: The "Shipping Details" and "Billing Details" titles are customizable by using the below hook.
function wc_additional_field_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Section Name':
$translated_text = __( 'Your Title Here', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'wc_additional_field_strings', 20, 3 );
Replace the text's Section Name with the corresponding section name (Billing details, Ship to different Address and Additional Information) and Your Title Here with the required title.
Delete Section
Removing a section will also remove all the fields inside that section. Once a section is deleted it cannot be restored.
To remove a section:
- Navigate to Checkout Field Editor settings page (WooCommerce → Checkout Form)
- Click on the X icon near the section you want to delete.
- A confirmation popup with the message "Are you sure you want to delete this section?" will be shown. Click on the OK button to confirm.
Rearranging Sections
The display position of a section on the checkout page is determined by the two properties Display Position & Display Order. Display Position property determines where the section should be displayed and Display Order property determines in which order the sections should be arranged when there are multiple sections for a given position.
To set Display Order:
- Navigate to Checkout Field Editor settings page (WooCommerce → Checkout Form)
- Click on the pencil icon near the section you want to edit.
- From the edit dialogue box, provide a number in the Display Order field according to the order you want to arrange the sections.
It should be noted that the Display Positions set earlier in the section properties can override the Display Order. Even if the sections are arranged according to display numbers, sections coming under the same display position will display first according to the display order assigned.
For example, suppose that A and C are two sections coming before billing details, and B and D come after the billing details. If the Display Order assigned to A, B, C and D are 1, 2, 3, and 4 respectively, the sections will be arranged as A → C → B → D.
Copy A Section (Duplicate A Section)
A duplicate of an existing section can be created by clicking on the ‘Copy’ button next to the pencil icon for editing. Then, a popup to create a new section will appear with all the fields except the section name, filled the same as that of the duplicated field. All you have to do is to assign a new section name and Save the changes.
To duplicate a section:
- Navigate to Checkout Field Editor settings page (WooCommerce → Checkout Form)
- Click on the copy icon near the section you want to make a copy.
- Enter a new Name/ID for the new section. Feel free to modify other properties of the section based on your need.
- Click on the OK button to save the new section.
Add A Custom Section To A Custom Step Created Using A Multistep Plugin
Following are the steps to add a custom section to a newly created step:
- Navigate to Checkout Field Editor via Dashboard → WooCommerce → Checkout Form.
- Click on the Add New Section button which is displayed above the field list.
- Fill the properties and choose the step name from the Display Position pull-down.
- Once new fields are added to the section, it will be displayed in the newly created step.
Comments
0 comments
Please sign in to leave a comment.