Files
2026-04-28 15:13:50 +02:00

55 lines
3.6 KiB
PHP

<script type="text/javascript">
jQuery(document).ready(function () {
function paczkomatyOptions() {
if (jQuery('#woocommerce_flexible_shipping_method_integration').val() == 'paczkomaty') {
jQuery('.paczkomaty').closest('tr').css('display', 'table-row');
if (jQuery('#woocommerce_flexible_shipping_paczkomaty_usluga').val() != 'polecony') {
jQuery("#woocommerce_flexible_shipping_paczkomaty_usluga option[value='polecony']").attr("disabled", "disabled");
}
jQuery('#woocommerce_flexible_shipping_paczkomaty_usluga').closest('tr').css('display', 'table-row');
if (jQuery('#woocommerce_flexible_shipping_paczkomaty_usluga').val() == 'paczkomaty' || jQuery('#woocommerce_flexible_shipping_paczkomaty_usluga').val() == 'kurier') {
jQuery('#woocommerce_flexible_shipping_paczkomaty_ubezpieczenie').closest('tr').css('display', 'table-row');
jQuery('#woocommerce_flexible_shipping_paczkomaty_cod').closest('tr').css('display', 'table-row');
} else {
jQuery('#woocommerce_flexible_shipping_paczkomaty_ubezpieczenie').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_cod').closest('tr').css('display', 'none');
}
if (jQuery('#woocommerce_flexible_shipping_paczkomaty_usluga').val() == 'paczkomaty'
) {
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_size').closest('tr').css('display', 'table-row');
jQuery('#woocommerce_flexible_shipping_paczkomaty_end_of_week_collection').closest('tr').css('display', 'table-row');
} else {
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_size').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_end_of_week_collection').closest('tr').css('display', 'none');
}
if (jQuery('#woocommerce_flexible_shipping_paczkomaty_usluga').val() == 'kurier') {
jQuery('#woocommerce_flexible_shipping_paczkomaty_kurier_usluga').closest('tr').css('display', 'table-row');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_length').closest('tr').css('display', 'table-row');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_width').closest('tr').css('display', 'table-row');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_height').closest('tr').css('display', 'table-row');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_default_weight').closest('tr').css('display', 'table-row');
} else {
jQuery('#woocommerce_flexible_shipping_paczkomaty_kurier_usluga').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_length').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_width').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_height').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_package_default_weight').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_sms_notification').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_email_notification').closest('tr').css('display', 'none');
jQuery('#woocommerce_flexible_shipping_paczkomaty_saturday').closest('tr').css('display', 'none');
}
} else {
jQuery('.paczkomaty').closest('tr').css('display', 'none');
}
}
jQuery('#woocommerce_flexible_shipping_method_integration').change(function () {
paczkomatyOptions();
});
jQuery('#woocommerce_flexible_shipping_paczkomaty_usluga').change(function () {
paczkomatyOptions();
});
paczkomatyOptions();
});
</script>