简体   繁体   English

woocommerce ups运送方法

[英]woocommerce ups shipping method

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). 我要尝试做的是向Paypal发送一个自定义属性,该属性显示所选的UPS服务(地面,第二天,第三天等)。

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) 我觉得应该看起来像这样:$ order->(无论我缺少什么变量)

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 因此,从一开始就将代码输入到woothemes UPS运输方法插件上的以下文件中: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. 我添加了以下行: 'CUSTOM' => $order ->get_shipping_method(),它现在执行的操作是将一个“ CUSTOM”属性发送给'CUSTOM' => $order ->get_shipping_method(),宝,它将在我的'CUSTOM' => $order ->get_shipping_method(),宝中显示为“ ups ground”或“ 2nd day air”交易明细。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM