M
M
Muvka2019-01-09 15:24:12
WooCommerce
Muvka, 2019-01-09 15:24:12

How to save the field when updating the checkout?

I have a switch, radio type, with the value of which I want to filter delivery methods - if delivery is selected, then one, if pickup, then others.

$fields['shipping']['shipping_type'] = array(
    'required'  => true,
    'class'     => array(),
    'type'      => 'radio',
    'options'   => array(
      'flat_rate'  => 'Доставка',
      'local_pickup' => 'Самовывоз',
    ),
    'default'  => 'flat_rate'
  );

So, when the "update_checkout" event triggers, the indicator is always reset to default. Just don't save the value? Or it is necessary to do hands through session?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question