Paypal |
1/18/2008 6:05:19 AM |
PHPRunner General questions | |
E
enthusiast author
Hi. |
|
J
|
Jane 1/21/2008 |
Hi, |
P
|
Peppa 2/12/2009 |
Hiya, |
P
|
Peppa 2/12/2009 |
Okay ... got the Postage and Tax down now.... |
P
|
Peppa 7/23/2009 |
Okay ... got the Postage and Tax down now.... Add the following fields to your ppmain table: Shipping Shipping2 Handling Tax Then amend the paypal button "but" from..... global $strTableName; if(!$table) $table=$strTableName; $value=$data[$field]; if($table=="ppmain" && $field=="but") { global $data; $value = "<INPUT type=image alt=\"Make payments with PayPal - it's fast, free and secure!\" src=\"https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=42935&image=1&table=forumreplies\" align=right border=0 name=xclick onclick=\"java script: document.forms.xclick.item_name.value='".$data["Title"]."'; document.forms.xclick.amount.value=".$data["Price"]."; document.forms.xclick.item_number.value=".$data["ID"]."; document.forms.xclick.submit();\">"; } return $value; to ................. Be sure to keep fieldname e.g. xclick.shipping.value=".$data["Shipping"]."; in lowercase (required by paypal) global $strTableName; if(!$table) $table=$strTableName; $value=$data[$field]; if($table=="ppmain" && $field=="but") { global $data; $value = "<INPUT type=image alt=\"Make payments with PayPal - it's fast, free and secure!\" src=\"https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=42935&image=2&table=forumreplies\" align=right border=0 name=xclick onclick=\"java script: document.forms.xclick.item_name.value='".$data["Title"]."'; document.forms.xclick.amount.value=".$data["Price"]."; document.forms.xclick.handling.value=".$data["Handling"]."; document.forms.xclick.shipping.value=".$data["Shipping"]."; document.forms.xclick.shipping2.value=".$data["Shipping2"]."; document.forms.xclick.tax.value=".$data["Tax"]."; document.forms.xclick.item_number.value=".$data["ID"]."; document.forms.xclick.submit();\">"; } return $value; Next............ amend the Event handler's again to include as shown below: //paypal form $info="<FORM name=xclick action=\"https://www.paypal.com/cgi-bin/webscr\" method=post target=_blank> <input type=\"hidden\" name=\"cmd\" value=\"_cart\"> <input type=\"hidden\" name=\"upload\" value=\"1\"> <input type=\"hidden\" name=\"business\" value=\"".$dataInfo["PayPalEmailAddress"]."\"> <input type=\"hidden\" name=\"currency_code\" value=\"".$dataInfo["Currency"]."\"> <input type=\"hidden\" name=\"item_name\" value=\"\"> <input type=\"hidden\" name=\"amount\" value=\"\"> <input type=\"hidden\" name=\"shipping\" value=\"\"> <input type=\"hidden\" name=\"shipping2\" value=\"\"> <input type=\"hidden\" name=\"handling\" value=\"\"> <input type=\"hidden\" name=\"tax\" value=\"\"> <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=\"item_number\" value=\"\"> <input type=\"hidden\" name=\"image_url\" value=\"".$dataInfo["Logo"]."\"> <input type=\"hidden\" name=\"add\" value=\"1\"> </FORM>"; echo $info; This will then carry the amounts you specify over into paypal Be sure to set your paypal profile postage preferences to allow transaction-based postage values to override the profile postage settings (Checkbox at bottom of page) That'll do it. You should now have the option to update the cart quantity in paypal including Shipping cost for single item + additional item shipping cost + Handling + Tax etc. Enjoy.............. Additional TIP.... Do not use quotations in any of your form fields e.g. inputing a measurement i.e 12" (12 inches) as this will stop it working.
|