Support » Plugin: WooCommerce Wirecard Brazil Official » Número da casa (billing_number ou shipping_number) não são exibidos no pedido

  • Os números da residência não estão sendo exibidos no pedido, causando assim um problema para fazer o envio dos pedidos. Para resolver um problema na minha loja, tive que “hookar” os filters woocommerce_order_formatted_billing_address e woocommerce_order_formatted_shipping_address para poder concatenar os nºs (billing_number e shipping_number) informado no checkout.

    add_filter('woocommerce_order_formatted_billing_address', 'my_order_formatted_billing_address', 10, 2);
    function my_order_formatted_billing_address($address, $wc_order) {
        $billing_number = get_post_meta( $wc_order->id, '_billing_number', true );
        $address = array(
            'postcode'      => $wc_order->billing_postcode,
            'last_name'     => $wc_order->billing_last_name,
            'first_name'    => $wc_order->billing_first_name,
    
            'address_1'     => $wc_order->billing_address_1. " Nº " . $billing_number,
            'address_2'     => $wc_order->billing_address_2,
            'city'          => $wc_order->billing_city,
            'state'         => $wc_order->billing_state,
    
            'country'       => $wc_order->billing_country
        );
        return $address;
    }
    
    add_filter('woocommerce_order_formatted_shipping_address', 'my_order_formatted_shipping_address', 10, 2);
    function my_order_formatted_shipping_address($address, $wc_order) {
        $shipping_number = get_post_meta( $wc_order->id, '_shipping_number', true );
        $address = array(
            'postcode'      => $wc_order->shipping_postcode,
            'last_name'     => $wc_order->shipping_last_name,
            'first_name'    => $wc_order->shipping_first_name,
    
            'address_1'     => $wc_order->shipping_address_1. " Nº " . $shipping_number,
            'address_2'     => $wc_order->shipping_address_2,
            'city'          => $wc_order->shipping_city,
            'state'         => $wc_order->shipping_state,
    
            'country'       => $wc_order->shipping_country
        );
        return $address;
    }
    • This topic was modified 6 months, 2 weeks ago by brunosserrao.
    • This topic was modified 6 months, 2 weeks ago by brunosserrao.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Número da casa (billing_number ou shipping_number) não são exibidos no pedido’ is closed to new replies.