Ecommerce Shopify WordPress Discussion

WordPress Bricks Builder Dynamically Fill Select Options

Bricks builder for Wordpress has an option to echo a function as dynamic content for form fields. I need to offer users a choice of dates from the next 6 days. I have a select field and the following function: function generate_date_options() { $date_options = array(); // Generate dates for the next six days for ($i = 0; $i < 6; $i++) { $date = date('Y-m-d', strtotime("+$i days")); $formatted_date = date('F j, Y', strtotime("+$i days")); $date_options[$formatted_date] = $formatted_date; } return $date_options; } This function returns a list of the next 6 dates. I want each date to be an option in the select field. But instead they are all listed on a single line separated by comas as the single select option. The function is defined in a child theme function.php and can be called using {echo: generate_date_options()}. The Date/Time picker would be ideal but does not allow narrowing of the range of dates available to just the next 6 days. Any ideas on this method or an alternative gratefully received.
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.