0
votes

I brought http://www.woothemes.com/products/paypal-express/ plugin for my wordpress site running woocommerce. But the shipping cost is not including during paypal express checkout.

I checked all setting in woocommerce shipping. I also checked other payment gateways they are including shipping cost

Can anyone please suggest how to include shipping cost in paypal express checkout for woocommerce.

1
Unfortunately, my experience with the Woo PayPal extensions left me wanting more...a lot more. As such, I developed my own stand-alone extension, PayPal for WooCommerce, and I can assure you the shipping is passed correctly if you want to give it a try. Oh yeah, it's free, too!Drew Angell

1 Answers

0
votes

The only way to do this is to edit the actual code in the plugi files woocommerce-gateway-paypal-express.php, Basically what I did was use the cart->get_cart_shipping_total() from the file. Unfortunately it comes formatted with html so I had to just explode out a couple things, I"ve included the code below.

$shipping = WC_PayPal_Express_Compatibility::WC()->cart->get_cart_shipping_total();
$shippingarray = explode(";", $shipping);
$shippingarray = explode("</span>", $shippingarray[1]);
$shippingamt = str_replace("_",".", $shippingarray[0]);
$nvpstr .= "&PAYMENTREQUEST_0_SHIPPINGAMT=" . $shippingamt;

Then you also have to edit the total amount line as well to:

$nvpstr .= "&PAYMENTREQUEST_0_AMT="     . number_format($order_total + $shippingamt, 2);