I think I have a working solution, after reading the PayPal guidelines for the checkout flow, and acceptable parameters I've attempted to suppress line item details when the shipping method has not been confirmed by making the following change.
Code:
// loop thru all products to prepare details of quantity and price.
for ($i=0, $n=sizeof($order->products), $k=0; $i<$n; $i++, $k++) {
// PayPal won't accept zero-value line-items, so skip this entry if price is zero
if ($order->products[$i]['final_price'] == 0) continue;
// KP Addition
if (!zen_not_null($order->info['shipping_method'])) continue;
I hope this just suppresses all the line items and totals when the shipping method has not been selected. My initial testing seems OK.
Bookmarks