Zab Allah
Zab Allah

Reputation: 45

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).

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)

Upvotes: 0

Views: 242

Answers (1)

Zab Allah
Zab Allah

Reputation: 45

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.

Upvotes: 1

Related Questions