Dear Friends, we have this issue, if client choose Delivery to the Courier office, we need to display additional field, where to type the Office address and name. How can we achieve this?
So, for example, we have 2 Delivery methods - 1. To the Client address, where everything is okay because they fill out their address, 2. Method to the Office - where the client need to fill out the Office address, or Name
Let the customer register a second shipping address. You can store as many adresses as You like.
Jörgen @ Kreativ Fotografi
No, I don`t want to ask them for second address, I just need 1 input field.
??? Then use the input field You have if You do not need any extra address.
I would use the native shipping address.
Jörgen @ Kreativ Fotografi
hide/show field by JS depending on the shipping method chosen
you can also set if required by JS -- something like
<script>
jQuery(document).ready(function($){
<?php if(//detect the shipping id == 2) { ?>
$('#company_field').show().addClass('required').attr('required', 'required').attr('aria-required', 'true');
<?php }else{ ?>
$('#company_field').hide().removeClass('required').removeAttr('required aria-required').val('');
<?php } ?>
});
</script>
prob need to hide the surrounding div/row as well