plugin_path() . '/includes/wc-template-functions.php' );
$params = array(
'type' => 'select',
'options' => array(
'paczkomaty' => __( 'Paczkomat', 'woocommerce-paczkomaty-inpost' ),
'polecony' => __( 'Paczka E-Commerce', 'woocommerce-paczkomaty-inpost' ),
'kurier' => __( 'Kurier', 'woocommerce-paczkomaty-inpost' ),
),
'class' => array('first'),
'custom_attributes' => array('style' => 'width:100%'),
'label' => __('Usługa', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_usluga', $params, $args['paczkomaty_usluga']);
$params = array(
'type' => 'select',
'options' => $args['punkty_nadania'],
'class' => array('first','polecony'),
'custom_attributes' => array('style' => 'width:100%'),
'label' => __('Punkt nadania', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_punkt_nadania', $params, $args['paczkomat_punkt_nadania']);
$params = array(
'type' => 'select',
'options' => $this->adminMachines,
'class' => array('first','paczkomaty'),
'custom_attributes' => array('style' => 'width:100%'),
'label' => __('Wybrany paczkomat', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_id', $params, $args['paczkomat_id']);
if ($args['select2']) :
?>
'select',
'options' => $paczkomaty_shipping_method->packageSizes,
'class' => array('first','paczkomaty'),
'label' => __('Wybrany rozmiar paczki', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_size', $params, $args['paczkomat_size']);
$params = array(
'type' => 'number',
'class' => array('first','kurier'),
'label' => __('Długość paczki [mm]', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_length', $params, $args['paczkomat_length']);
$params = array(
'type' => 'number',
'class' => array('first','kurier'),
'label' => __('Szerokość paczki [mm]', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_width', $params, $args['paczkomat_width']);
$params = array(
'type' => 'number',
'class' => array('first','kurier'),
'label' => __('Wysokość paczki [mm]', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_height', $params, $args['paczkomat_height']);
$params = array(
'type' => 'number',
'class' => array('first','kurier'),
'label' => __('Waga paczki [kg]', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_weight', $params, $args['paczkomat_weight']);
$params = array(
'type' => 'text',
'class' => array('first','paczkomaty','kurier'),
'defualt' => $args['paczkomat_customer_ref'],
'label' => __('Numer referencyjny', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field( 'paczkomat_customer_ref', $params, $args['paczkomat_customer_ref'] );
$params = array(
'type' => 'select',
'options' => $paczkomaty_shipping_method->howToGive,
'class' => array('first','paczkomaty'),
'default' => $paczkomaty_shipping_method->get_option( 'self_send', true ),
'label' => __('Sposób nadania', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
if(!empty($args['paczkomat_how_to_give'])){
woocommerce_form_field('paczkomat_how_to_give', $params, $args['paczkomat_how_to_give']);
}
else{
woocommerce_form_field('paczkomat_how_to_give', $params, $paczkomaty_shipping_method->get_option('self_send', 1 ) );
}
$params = array(
'type' => 'checkbox',
'class' => array('first','paczkomaty','kurier'),
'label' => __('Ubezpieczenie', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_ubezpieczenie', $params, $args['paczkomat_ubezpieczenie']);
$key = 'paczkomat_ubezpieczenie_amount';
$params = array(
'label' => __( 'Kwota ubezpieczenia', 'woocommerce-paczkomaty-inpost' ),
'type' => 'number',
'class' => array( 'first','paczkomaty','kurier' ),
'custom_attributes' => array(
'min' => 0,
'step' => '0.01',
)
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field( $key, $params, $args['paczkomat_ubezpieczenie_amount'] );
$params = array(
'type' => 'checkbox',
'class' => array('first','paczkomaty','kurier'),
'label' => __('Pobranie', 'woocommerce-paczkomaty-inpost'),
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field('paczkomat_cod', $params, $args['paczkomat_cod']);
$key = 'paczkomat_cod_amount';
$params = array(
'label' => __( 'Kwota pobrania', 'woocommerce-paczkomaty-inpost' ),
'type' => 'number',
'class' => array( 'first','paczkomaty','kurier' ),
'custom_attributes' => array(
'min' => 0,
'step' => '0.01',
)
);
if (!empty($args['paczkomat_packcode'])){
$params['custom_attributes']['disabled'] = 'disabled';
}
woocommerce_form_field( $key, $params, $args['paczkomat_cod_amount'] );
if (!empty($args['paczkomat_packcode'])):
?>
Numer paczki:
: