This topic is locked

ShoppingCart

10/8/2007 3:36:55 AM
Shopping Cart Template general questions
J
JHN author

The cart works great, where is the code page that tells paypal the payment type or is it possible to change that in the interface?

Sergey Kornilov admin 10/9/2007

Check Sales_Order_Main table, event AfterAdd.
The following piece of code displays and submits PayPal form. Add the line in bold to setup a recurring payment:

//paypal form

$info = "<BODY onload=\"document.forms.xclick.submit();\">";

$info.="<FORM name=xclick action=\"https://www.paypal.com/cgi-bin/webscr\"; method=post>
<input type=\"hidden\" name=\"cmd\" value=\"_xclick-subscriptions\">

<input type=\"hidden\" name=\"bn\" value=\"PP-SubscriptionsBF\">

<input type=\"hidden\" name=\"a3\" value=\".$ordertotal.\">

<input type=\"hidden\" name=\"p3\" value=\"1\">

<input type=\"hidden\" name=\"t3\" value=\"M\">

<input type=\"hidden\" name=\"src\" value=\"1\">

<input type=\"hidden\" name=\"sra\" value=\"1\">


<input type=\"hidden\" name=\"business\" value=\"".$dataInfo["PayPalEmailAddress"]."\">

<input type=\"hidden\" name=\"currency_code\" value=\"".$dataInfo["Currency"]."\">";

//while ($data = db_fetch_array($rs))

//echo $data["product_description"];

$info.="<input type=\"hidden\" name=\"item_name\" value=\"".$order_description."\">

<input type=\"hidden\" name=\"quantity\" value=\"1\">

<input type=\"hidden\" name=\"item_number\" value=\"".$_SESSION["order_no"]."\">

<input type=\"hidden\" name=\"shipping\" value=\"".$data6["Freight"]."\">";
$info.="<input type=\"hidden\" name=\"cancel_return\" value=\"".$dataInfo["CancelPage"]."\">

<input type=\"hidden\" name=\"return\" value=\"".$dataInfo["SuccessPage"]."\">

<input type=\"hidden\" name=\"notify_url\" value=\"".$dataInfo["IPNPage"]."\">

<input type=\"hidden\" name=\"image_url\" value=\"".$dataInfo["Logo"]."\">

<input type=\"hidden\" name=\"last_name\" value=\"".$data_order["shipto_name"]."\">

<input type=\"hidden\" name=\"first_name\" value=\"".$data_order["shipto_name"]."\">

<input type=\"hidden\" name=\"email\" value=\"".$_SESSION["UserID"]."\">

<input type=\"hidden\" name=\"address1\" value=\"".$data_order["shipto_address"]."\">

<input type=\"hidden\" name=\"city\" value=\"".$data_order["shipto_city"]."\">

<input type=\"hidden\" name=\"state\" value=\"".$data_order["shipto_state"]."\">

<input type=\"hidden\" name=\"zip\" value=\"".$data_order["shipto_zip"]."\">

<input type=\"hidden\" name=\"country\" value=\"".$data_order["shipto_country"]."\">

</FORM></body>";

echo $info;