As it seems to me developers never worked out properly such paypal _cart function, here just thought to share update with everyone:
Just open your paypal.php file which is located in /included/modules/payment/paypal.php
Find the following pointless code (who want the store name as items on PayPal?):
and replace it with the following:PHP Code:if (sizeof($optionsLineItems) > 0) {
$optionsLineItems['cmd'] = '_cart';
// $optionsLineItems['num_cart_items'] = sizeof($order->products);
if (isset($optionsLineItems['shipping'])) {
$optionsLineItems['shipping_1'] = $optionsLineItems['shipping'];
unset($optionsLineItems['shipping']);
}
unset($optionsLineItems['subtotal']);
// if line-item details couldn't be kept due to calculation mismatches or discounts etc, default to aggregate mode
if (!isset($optionsLineItems['item_name_1']) || $optionsLineItems['creditsExist'] == TRUE) $optionsLineItems = array();
//if ($optionsLineItems['amount'] != $this->transaction_amount) $optionsLineItems = array();
// debug:
//ipn_debug_email('Line Item Details (if blank, this means there was a data mismatch or credits applied, and thus bypassed): ' . "\n" . print_r($optionsLineItems, true));
unset($optionsLineItems['creditsExist']);
}
$optionsAggregate = array(
'cmd' => '_cart',
'item_name' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE,
'item_number' => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM,
'num_cart_items' => sizeof($order->products),
'amount' => round($this->transaction_amount, $currencies->get_decimal_places($my_currency)),
'shipping' => $oshipping,
);
the upgrade is complete!PHP Code:$optionsLineItems['cmd'] = '_cart';
$optionsLineItems['num_cart_items'] = sizeof($order->products);
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
$item = $i+1;
$tax_value = ($order->products[$i]['tax'] / 100) * $order->products[$i]['final_price'];
$optionsLineItems['item_name_' . $item] = $order->products[$i]['name'];
$optionsLineItems['item_number_' . $item] = $order->products[$i]['model'];
$optionsLineItems['quantity_' . $item] = $order->products[$i]['qty'];
$optionsLineItems['amount_' . $item] = number_format($order->products[$i]['final_price'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
$optionsLineItems['tax_' . $item] = number_format($tax_value * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
}
$optionsLineItems['handling_cart'] = number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)) - $shipping_added;


Reply With Quote
