Ok, to taka poprawka na szybko która powinna rozwi?za? problem:
wej?? do /wp-content/plugins/inpost-paczkomaty/inpost-paczkomaty.php
i zmieni?
function paczkomaty_inpost_validation_checkout() {
$selected_shipping = WC()->session->get( 'chosen_shipping_methods' );
if ( isset( $selected_shipping ) && ! empty( $selected_shipping ) ) {
$selected = explode( ':', $selected_shipping[0] );
$selected_name = WC()->session->get( 'paczkomat_name' );
if ( $selected[0] == 'inpost_paczkomaty' && ( ! isset( $selected_name ) || empty( $selected_name ) ) ) {
wc_add_notice( __( 'Nie wybrano paczkomatu. Wybierz paczkomat lub zmień form? wysy?ki.' ), 'error' );
}
}
}
na:
function paczkomaty_inpost_validation_checkout() {
$virtual = false;
foreach ( WC()->cart->get_cart() as $item ) {
if ( $item['data']->is_virtual() ) {
$virtual = true;
break; // Stop the loop
}
}
if ( $virtual == false ) {
$selected_shipping = WC()->session->get( 'chosen_shipping_methods' );
if ( isset( $selected_shipping ) && ! empty( $selected_shipping ) ) {
$selected = explode( ':', $selected_shipping[0] );
$selected_name = WC()->session->get( 'paczkomat_name' );
if ( $selected[0] == 'inpost_paczkomaty' && ( ! isset( $selected_name ) || empty( $selected_name ) ) ) {
wc_add_notice( __( 'Nie wybrano paczkomatu. Wybierz paczkomat lub zmień form? wysy?ki.' ), 'error' );
}
}
}
}