ds34222 2015-09-30 19:24
浏览 89

woocommerce ups运输方式

So first I'll say the plugin works fine, returns correct rates and all that perfectly. What I am attempting to do is send to paypal a custom attribute that displays which UPS service that was selected (ground, 2nd day air, 3rd day, etc).

I know the custom attribute is reaching paypal correctly because I tested the code as follows:

 $paypal_args = array(
                    'CUSTOM' => "THIS IS MY SHIPPING"
                     );

And it creates the "CUSTOM" field and displays the text on my paypal dashboard when I'm looking at the order details.

I've tried the following with no success:

  'CUSTOM' => $order -> method_title,
  &
  'CUSTOM' =>$order -> shipping_method_title,

I feel like it's should look something like this: $order -> (whatever variable I'm missing)

  • 写回答

1条回答 默认 最新

  • dongshetao1814 2015-10-01 14:36
    关注

    I'm adding the solution to my problem here just in case anyone stumbles across this issue.

    So from the beginning the code was entered in to the following file on the woothemes UPS shipping method plugin: class-wc-paypal-advanced.php

    I added the following line: 'CUSTOM' => $order ->get_shipping_method(), and what it does now is it sends a "CUSTOM" attribute to paypal which will read "ups ground" or "2nd day air" in my paypal transaction details.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大