ROADMAP

All Boards

1 vote

'wu_billing_address_fields' Filter issue

The short version: I modified following filter to only use certain fields

add_filter(‘wu_billing_address_fields’, function($fields, $zip_only = false) {

$fields = array();

$fields[‘billing_address_line_1’] = array(
‘type’ => ‘text’,
‘title’ => __(‘Address Line 1’, ‘wp-ultimo’),
‘default_placeholder’ => __(‘E.g. 555 1st Avenue’, ‘wp-ultimo’),
‘wrapper_classes’ => ‘wu-col-span-2’,
‘required’ => true,
);

$fields[‘billing_zip_code’] = array(
‘type’ => ‘text’,
‘title’ => __(‘ZIP / Postal Code’, ‘wp-ultimo’),
‘default_placeholder’ => __(‘E.g. 10009’, ‘wp-ultimo’),
‘wrapper_classes’ => ‘sm:wu-col-span-1’,
‘required’ => true,
);

$fields[‘billing_city’] = array(
‘type’ => ‘text’,
‘title’ => __(‘City / Town’, ‘wp-ultimo’),
‘default_placeholder’ => __(‘E.g. New York City’, ‘wp-ultimo’),
‘wrapper_classes’ => ‘sm:wu-col-span-1’,
‘required’ => true,
);

$fields[‘billing_country’] = array(
‘type’ => ‘select’,
‘title’ => __(‘Country’, ‘wp-ultimo’),
‘default_placeholder’ => __(‘E.g. US’, ‘wp-ultimo’),
‘wrapper_classes’ => ‘wu-col-span-2’,
‘value’ => ‘ ‘,
‘options’ => ‘wu_get_countries_as_options’,
‘required’ => true,
);

$fields = wu_set_order_from_index($fields); // Adds missing order attributes

return $fields;

});

but got the state field as well without label, thus Warning: Undefined array key “title” in /var/web/site/public_html/wp-content/plugins/wp-ultimo/inc/checkout/signup-fields/class-signup-field-billing-address.php on line 214 and cannot proceed due to an error in checkout.min.js:1:6263.

The same happens if I want to omit the country and the city. Screenshot attached. Any way to fix this on my side? Thank you.

Attachments
Completed Category: Core Board: Bug Reports Philipp Lang shared this idea
5 Comment
Philipp Lang June 16, 2022
|

Sorry to report, that the inconvenience persists in 2.0.15. But it is not the most important task, so I keep my work-around with zip_only for now.

Philipp Lang May 19, 2022
|

The issue comes from class-signup-field-billing-address.php:251

if (!$zip_only) {

$fields[‘billing_state’][‘html_attr’] = array(
‘v-model.lazy’ => ‘state’,
);

Contribute your suggestions

We have different boards for different types of reports and suggestions.

Feature Suggestions

On this board you will see features suggested by our community members that entered our roadmap.

Bug Reports

This is where we list the bugs that were found in our plugin and that we are working on to solve.

Ready to get started?

Easily build your own WaaS platform with WP Ultimo!