'how to disable the pickup location field woo commerce local pickup plus

I want to disable the location select field but still show the value.

right now I did this to disable the select field but it is still able to select the locations

add_filter( 'woocommerce_shipping_fields', 'wc_optional_shipping_fields', 10, 1 );
function wc_optional_shipping_fields( $billing_fields  ) {
$billing_fields['pickup-location-field-for-0']['custom_attributes']['disabled'] = 'disabled';
return $billing_fields ;}

is it possible to fix that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source