When passing aggregate orders to paypal, include item names

This commit is contained in:
Mike Jolley 2012-03-04 13:15:38 +00:00
parent 02ba80c5dc
commit 5a0770fe0c
2 changed files with 8 additions and 1 deletions

View File

@ -236,7 +236,13 @@ class WC_Paypal extends WC_Payment_Gateway {
$paypal_args['discount_amount_cart'] = $order->get_order_discount();
// Don't pass items - paypal borks tax due to prices including tax. PayPal has no option for tax inclusive pricing sadly. Pass 1 item for the order items overall
$paypal_args['item_name_1'] = sprintf(__('Order #%s' , 'woocommerce'), $order->id);
$item_names = array();
if (sizeof($order->get_items())>0) : foreach ($order->get_items() as $item) :
if ($item['qty']) $item_names[] = $item['name'] . ' x ' . $item['qty'];
endforeach; endif;
$paypal_args['item_name_1'] = sprintf(__('Order #%s' , 'woocommerce'), $order->id) . " - " . implode(', ', $item_names);
$paypal_args['quantity_1'] = 1;
$paypal_args['amount_1'] = number_format($order->get_order_total() - $order->get_shipping() + $order->get_order_discount(), 2, '.', '');

View File

@ -152,6 +152,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fixed dates in dashboard stats
* Download expiry was backwards
* Fix styling of new attribute
* When passing aggregate orders to paypal, include item names
= 1.5 - 01/03/2012 =
* Quick edit products