Custom fields are cleared

  • Posts: 332
  • Thank you received: 9
  • Hikashop Business
1 day 3 hours ago #367840

When a customer places an order we always give them the option through personalized fields to enter the name of the location and a time.
When the customer fills out these fields and then selects a payment method other than the default (card), the custom fields are deleted by themselves.
In attachment 1.png you can see the fields filled in with the preselected card payment.
In attachment 2.png I have changed the payment method to bizum and the custom fields have been deleted.
Can it be avoided in any way?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 84079
  • Thank you received: 13634
  • MODERATOR
23 hours 7 minutes ago #367844

Hi,

In the file checkout / show_block_fields, which you can edit via the menu Display>Views, you have the line:

window.Oby.registerAjax(['checkout.fields.updated','cart.updated','checkout.shipping.changed','checkout.payment.changed'], function(params){
If you change it to:
window.Oby.registerAjax(['checkout.fields.updated','cart.updated','checkout.shipping.changed'], function(params){
then the fields area won't be refreshed when you change the payment method and thus the fields won't be cleared.
This, however, means if you configured the fields to display for only some payment methods and not others, the fields won't appear/disappear when the payment method is changed.

Another approach would be to configure your checkout in several steps, and move the payment and fields views onto different steps. That way, the problem would not happen.

Please Log in or Create an account to join the conversation.

  • Posts: 332
  • Thank you received: 9
  • Hikashop Business
8 hours 58 minutes ago #367852

Good morning.
I have already made the change and it works correctly. In case there is any Hika update, does it affect this file being modified?

Please Log in or Create an account to join the conversation.

  • Posts: 242
  • Thank you received: 30
  • Hikaserial Subscription Hikashop Business
5 hours 51 minutes ago #367858

If the code modification you made was made through the hikashop menu: Display>Views, then no, your override replaces the default view from hikashop.

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.066 seconds
Powered by Kunena Forum