首页 文章

woocommerce在成功付款后获取买家的名字和姓氏

提问于
浏览
0

我正在使用woocommerce和paypal for woocommerce插件 . 付款成功后,需要在第三方软件中输入买家的名字,姓氏和电子邮件地址 .

早些时候使用paypal标准我可以掌握这些信息,如下所示

$fname = $order->billing_first_name;
$lname = $order->billing_last_name;

然而,名字和名字都没有通过我从paypal得到的回复 . 订单数组看起来像这样

WC_Order Object
(
    [id] => 10182
    [order_type] => simple
    [prices_include_tax] => 1
    [tax_display_cart] => incl
    [display_totals_ex_tax] => 
    [display_cart_ex_tax] => 
    [post] => WP_Post Object
        (
            [ID] => 10182
            [post_author] => 1
            [post_date] => 2015-03-24 13:10:42
            [post_date_gmt] => 2015-03-24 13:10:42
            [post_content] => 
            [post_title] => Order – March 24, 2015 @ 01:10 PM
            [post_excerpt] => 
            [post_status] => wc-processing
            [comment_status] => open
            [ping_status] => closed
            [post_password] => order_55116250447f7
            [post_name] => order-mar-24-2015-0110-pm
            [to_ping] => 
            [pinged] => 
            [post_modified] => 2015-03-24 13:10:42
            [post_modified_gmt] => 2015-03-24 13:10:42
            [post_content_filtered] => 
            [post_parent] => 0
            [guid] => http://somewebsite.com/?post_type=shop_order&p=10182
            [menu_order] => 0
            [post_type] => shop_order
            [post_mime_type] => 
            [comment_count] => 5
            [filter] => raw
        )

    [order_date] => 2015-03-24 13:10:42
    [modified_date] => 2015-03-24 13:10:42
    [customer_message] => 
    [customer_note] => 
    [post_status] => wc-processing
    [billing_email] => abc@xyz.com
)

我真的很感激这方面的一些帮助 . 我只需要名字和姓氏,即使我必须查询此订单的数据库,我也不在乎

2 回答

  • 0

    我很确定你直接向我提交了一张票,我给了你这个信息,对吗?

    PayPal系统仅返回送货地址 . 因此,这就是我们为WooCommerce订单数据填写的所有信息,并且结算信息被留空了 .

    我们已在Express Checkout设置中添加了一个新选项,以使用相同的地址并填充结算数据 . 这尚未正式发布,因为我们还需要先完成其他一些事情,但它已完全合并到我们的dev branch on GitHub中,这是一个经过全面测试的分支并且被认为是稳定的 . 您可以download it directly并在需要时尽早使用它 .

  • 0

    您可以从WooCommerce的结算明细中获取姓名 .

    $fname = $order->get_billing_first_name();
    $lname = $order->get_billing_last_name();
    

相关问题