> Zencart中文手册 > zen cart支付传递商品名

默认的Paypal支付模块付款并没有把产品名称POST到Paypal,让人在Paypal付款界面和后台查看一头雾水,看不出是买了什么。

轻微改一下。【还不知道系统有没有更好的解决方法,对zen-cart不太熟】
paypal.PHP
将:
$optionsAggregate = array(
‘cmd’ => ‘_ext-enter’,
‘item_name’ => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE,
‘item_number’ => MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM,
//’num_cart_items’ => sizeof($order->products),
‘amount’ => number_format($this->transaction_amount, $currencies->get_decimal_places($my_currency)),
’shipping’ => ‘0.00′,
);
改为:$paypal_desc= ”;
     for ($i=0; $i<sizeof($order->products); $i++) {
        $paypal_desc = $order->products[$i]["name"] . “+” . $paypal_desc;
     }
     $paypal_desc = preg_replace(‘/n/’,”,substr($paypal_desc,0,-1));
 $optionsAggregate = array(
                   ‘cmd’ => ‘_ext-enter’,
  ’item_name’ => $paypal_desc,
        ‘item_number’ => sizeof($order->products),             
                   //’num_cart_items’ => sizeof($order->products),
                   ‘amount’ => number_format($this->transaction_amount, $currencies->get_decimal_places($my_currency)),
                   ’shipping’ => ‘0.00′,
                    );