method_id, array('allparcels_rankas', 'allparcels_skyrius', 'allparcels_taskas', 'allparcels_pastomatas')) ){
if(get_option( 'allparcels_api') == '') {
if($chosen_method == $method->id)
echo
'
'.__('Klaida: įveskite API kodą', 'mancanweb').'
';
continue;
}else{
switch ($method->method_id):
case 'allparcels_rankas':
$allparcels_obj = new WC_allparcels_rankas($method->instance_id);
$type='*';
break;
case 'allparcels_skyrius':
$allparcels_obj = new WC_allparcels_skyrius($method->instance_id);
$type='2';
break;
case 'allparcels_taskas':
$allparcels_obj = new WC_allparcels_taskas($method->instance_id);
$type='3';
break;
case 'allparcels_pastomatas':
$allparcels_obj = new WC_allparcels_pastomatas($method->instance_id);
$type='1';
break;
endswitch;
if( (empty($allparcels_obj->get_option('kurjeris')) && $method->method_id != 'allparcels_rankas' ) || ( empty($allparcels_obj->get_option('pagrindinis_kurjeris')) && $method->method_id == 'allparcels_rankas' ) )
continue;
printf( '
%5$s ',
$index, sanitize_title( $method->id ), esc_attr( $method->id ), checked( $method->id, $chosen_method, false ), wc_cart_totals_shipping_method_label( $method ) );
do_action( 'woocommerce_after_shipping_rate', $method, $index );
$couriers = Terminals::carriersArray ();
$pastomatai = [];
if (WC ()->customer->get_shipping_city () !== '')
$miestas = WC ()->customer->get_shipping_city ();
else
$miestas = WC ()->customer->get_city ();
if( $allparcels_obj->get_option('kurjeris') != '')
foreach ( $allparcels_obj->get_option('kurjeris') as $value ) {
$terminals=Terminals::getListForSelect($value, $miestas, $type);
foreach($terminals as $terminal)
$pastomatai [ $terminal ['identifier'] ] = $terminal;
}
if($chosen_method == $method->id) {
$string='';
if ( sizeof( $pastomatai ) > 0 && $type != '*') {
$string .= '';
$string .= '' . __( "Pasirinkite...", "mancanweb" ) . ' ';
foreach ( $pastomatai as $key => $value ) {
$string .= '' .
$couriers [ $value ['courierIdentifier'] ] . ' \'' . $value ['name'] . '\' ' . $value ['address']
. ' ,' . $value ['postCode'] . ', ' . $value ['city'] . ' ';
}
$string .= ' ';
printf( $string );
}elseif ($type == '*')
echo ' ';
else{
$string .='';
$string .=''.__('Nurodytame mieste šis pristatymas negalimas.', 'mancanweb').' ';
$string .= ' ';
printf($string);
}
}
}
}else{
printf( '
%5$s ',
$index, sanitize_title( $method->id ), esc_attr( $method->id ), checked( $method->id, $chosen_method, false ), wc_cart_totals_shipping_method_label( $method ) );
do_action( 'woocommerce_after_shipping_rate', $method, $index );
}
?>
customer->has_calculated_shipping() ) :
echo apply_filters( is_cart() ? 'woocommerce_cart_no_shipping_available_html' : 'woocommerce_no_shipping_available_html', wpautop( __( 'There are no shipping methods available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) );
elseif ( ! is_cart() ) :
echo wpautop( __( 'Enter your full address to see shipping costs.', 'woocommerce' ) );
endif;
if ( $show_package_details )
echo '' . esc_html( $package_details ) . '
';
if ( ! empty( $show_shipping_calculator ) )
woocommerce_shipping_calculator();
?>