Hide user-filled fields based on shipping method?

Please post any feature requests here

Hide user-filled fields based on shipping method?

Postby fale » Wed Oct 07, 2020 4:17 pm

Hello!
How to hide user-filled fields depending on the delivery method? :?:
I have an important question about a component.
Example: When choosing a delivery method by postal service, the client fills in the fields - country, address, zip code, name, surname.
These fields are needed to send goods through the postal service.
When choosing a delivery (picking up a product from a pick-up point) - the client has to fill in a lot of unnecessary unnecessary fields.
Question: Can you use your component to hide user-filled fields when choosing this delivery method?
That is, when choosing a delivery method from a self-pickup point, you need to hide some customer fields.
This is necessary to simplify the order form from the pickup point.
1. For sending products by mail - the form is shown in full.
2. Pickup of products - some of the customer fields are hidden
I have not found such a function in your component.
I would be glad if you could explain. Thanks! Vitaly

Оригинал:

Здравствуйте!
У меня есть важный вопрос по компоненту.
Пример: При выборе способа доставки почтовой службой - клиенту заполняет поля - страна, адрес, индекс, имя, фамилия .
Эти поля нужны для отправки товаров через почтовую службу.
При выборе доставки ( забор продукта из пункта самовывоза) - клиенту приходится заполнять много лишних ненужных полей.
Вопрос: Можно ли с помощью вашего компонента скрыть поля заполняемые пользователем, при выборе такого метода доставки?
То есть, при выборе метода доставки из пункта самовывоза - нужно скрыть некоторые поля заказчика.
Это нужно что бы упростить форму заказа с пункта самовывоза.
1.Для отправки почтой продуктов - форма показывается полностью.
2. Самовывоз продуктов - часть полей заказчика скрыты
Я не нашёл такой функции в вашем компоненте.
Буду рад если вы обьясните. Спасибо! Виталий
fale
 
Posts: 1
Joined: Tue Oct 06, 2020 11:25 am

Re: Hide user-filled fields based on shipping method?

Postby admin » Fri Mar 05, 2021 1:56 pm

hello, i suggest to modify your tabcontent.js

and add a code:
Code: Select all
function filterFields() {
  var ship_id = Onepage.getInputIDShippingRate();
    if (ship_id == 'shipment_id_2') {
        jQuery('#address_2_div').parent().hide();
    }
   else {
      jQuery('#address_2_div').parent().hide();
   }
}
addOpcTriggerer('callAfterShippingSelect', filterFields);


you can adjust the above as needed and per the number of child elements within the section which wraps your fields.
the exaple is per shipping ID = 2

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to Feature Request