【问题标题】:Displaying the shipping method of the order in "Thank you" page在“谢谢”页面显示订单的送货方式
【发布时间】:2017-02-14 10:48:27
【问题描述】:

在 WooCommerce 中,我想在“谢谢”(已收到订单)页面中显示当前订单选择的运输方式的名称……

如何在感谢页面中获取所选运输方式的名称?

我只能得到送货地址,而不是显示送货方式名称。

谢谢

【问题讨论】:

    标签: php wordpress woocommerce shipping orders


    【解决方案1】:

    如果您查看 WC_Abstract_Order 可用的方法,您有 get_shipping_method() 将显示您的订单使用的运输方法的标题。

    现在您可以通过这种方式在代码中将此方法与 $order 对象一起使用

    echo $order->get_shipping_method();
    

    【讨论】:

    • @bewell 欢迎您,为您感到高兴……请始终查看 woocommerce 类的可用方法。
    猜你喜欢
    • 2021-06-12
    • 2021-10-16
    • 2017-12-30
    • 2019-12-05
    • 2019-12-29
    • 2017-01-21
    • 2021-11-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多