Horje
I need to create a custom dropdown field but i need the values to be d - Wordpress Solution
I need to create a custom dropdown field but i need the values to be dynamic. We need to be able to choose the delivery date but these have to automaticaly change every month for a maximum on 1 year As soon as possible Next month June 2022 July 2022 .... April 2023 Etc


woocommerce_form_field( 'devlivery_date', array(
	    'type'          => 'select',
	    'label'         => $label,
	    'required'      => true,
	    'options'       => array(
	    'As soon as possible' => __( 'As soon as possible', 'wps' ),
	    'Next month'	=> __( 'Next month', 'wps' ),
	    'June 2022'	=> __( 'June 2022', 'wps' ),
        'July 2022' => __( 'July 2022 ', 'wps' ),
        'August 2022' => __( 'August 2022', 'wps' ),
        'September 2022' 	=> __( 'September 2022', 'wps' ),
        'October 2022' 	=> __( 'October 2022', 'wps' ),
        'November 2022' 	=> __( 'November 2022', 'wps' ),
        'December 2022' 	=> __( 'December 2022', 'wps' ),
        'January 2023' 	=> __( 'January 2023', 'wps' ),
        'February 2023' 	=> __( 'February 2023', 'wps' ),
        'March 2023' 	=> __( 'March 2023', 'wps' ),
        'April 2023' 	=> __( 'April 2023', 'wps' ),
	    )
	),


Solution - 1

Can you please explain more? Do you want the dropdown to remove months that are passed? Please give us an example.





Wordpress

Related
On submit upload files to server - Wordpress Solution On submit upload files to server - Wordpress Solution
wordpress ajax load more - Wordpress Solution wordpress ajax load more - Wordpress Solution
[ TABLECONTENT NOT RESPONSIVE ON SMALL SCREENS ] - Wordpress Solution [ TABLECONTENT NOT RESPONSIVE ON SMALL SCREENS ] - Wordpress Solution
Populate entries from repeater field in another field (same form) to add more details. - Wordpress Solution Populate entries from repeater field in another field (same form) to add more details. - Wordpress Solution
Moving Delivery Date Field in Checkout Page - Wordpress Solution Moving Delivery Date Field in Checkout Page - Wordpress Solution

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
44