{"id":60755,"date":"2025-04-26T09:34:32","date_gmt":"2025-04-26T01:34:32","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60755\/"},"modified":"2025-04-26T09:34:32","modified_gmt":"2025-04-26T01:34:32","slug":"%e5%ae%9e%e7%8e%b0zencart%e8%ae%a2%e5%8d%95%e7%b1%bb%e4%bc%bc%e6%b7%98%e5%ae%9d%e5%90%8e%e5%8f%b0%e4%bf%ae%e6%94%b9%e8%ae%a2%e5%8d%95%e4%bb%b7%e6%a0%bc%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60755\/","title":{"rendered":"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd"},"content":{"rendered":"<p> Zencart \u4f7f\u7528 Paypal \u4ed8\u6b3e\uff0c\u4f1a\u51fa\u73b0\u6f0f\u5355\u7684\u60c5\u51b5\uff0c\u5373 paypal \u5df2\u7ecf\u6536\u5230\u5ba2\u6237\u7684\u4ed8\u6b3e\uff0c\u4f46\u662f\u7f51\u7ad9\u540e\u53f0\u6ca1\u6709\u5ba2\u6237\u7684\u8ba2\u5355\u3002\u5bfc\u81f4 paypal \u6f0f\u5355\u7684\u539f\u56e0\u5927\u81f4\u4f1a\u662f\u5f53\u5ba2\u6237\u8df3\u8f6c\u5230Paypal \u7f51\u7ad9\u4ed8\u6b3e\u5b8c\u6bd5\u4e4b\u540e\uff0c\u76f4\u63a5\u5173\u95ed\u4e86\u7a97\u53e3\uff0c\u6216\u8005\u7f51\u7edc\u4e0d\u7a33\u5b9a\uff0c\u6ca1\u6709\u6b63\u5e38\u8df3\u8f6c\u5230\u7f51\u7ad9\u3002<\/p>\n<p> \u89e3\u51b3 Paypal \u6f0f\u5355\u95ee\u9898\u7684\u65b9\u6848\u6709\u597d\u51e0\u79cd\uff1a<\/p>\n<p> &nbsp;<\/p>\n<p> \u4e00. \u5f00\u542f Detailed Line Items in Cart \u9009\u9879\u3002<\/p>\n<p> \u539f\u7406\uff1a\u5728 zencart \u540e\u53f0 Module &#8211;&gt; Payment &#8211;&gt; PayPal Website Payments Standard &#8211; IPN \u5f00\u542f Detailed Line Items in Cart \u9009\u9879\u3002\u8fd9\u4e2a\u9009\u9879\u4f1a\u628a\u4f60\u6240\u6709\u7684\u8ba2\u5355\u7269\u54c1\u4fe1\u606f\u4f20\u7ed9 paypal\uff0c\u5f53\u5ba2\u6237\u4ed8\u6b3e\u6210\u529f\u800c\u540e\u53f0\u672a\u80fd\u6210\u529f\u751f\u6210\u8ba2\u5355\u65f6\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7 paypal \u5e10\u53f7\u4ea4\u6613\u4fe1\u606f\u770b\u5230\u5ba2\u6237\u8d2d\u4e70\u4e86\u54ea\u4e9b\u7269\u54c1\u3002<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150714\/2329445449-0.png\" class=\"aligncenter\" title=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe\" alt=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe\" \/><\/p>\n<p> &nbsp;<\/p>\n<p> \u4e8c. \u4f7f\u7528 Paypal Sessions Viewer \u63d2\u4ef6\u627e\u56de Paypal \u6f0f\u6389\u7684\u8ba2\u5355\u3002<\/p>\n<p> \u539f\u7406\uff1azencart \u8d2d\u7269\u8f66\u7684\u7269\u54c1\uff0c\u901a\u8fc7 paypal \u65b9\u5f0f\u4ed8\u6b3e\uff0c\u4f1a\u5728 paypal_session \u8868\u4e2d\u4fdd\u5b58\u6b64\u6b21\u4ed8\u6b3e\u7684\u6240\u6709\u8bb0\u5f55\uff0c\u5982\u679c\u4ed8\u6b3e\u6210\u529f\u540e\uff0c\u4ece paypal \u7f51\u7ad9\u8df3\u8f6c\u5230\u8d2d\u7269\u7f51\u7ad9\u5e76\u751f\u6210\u4e86\u8ba2\u5355\u65f6\uff0czencart\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5220\u9664\u8fd9\u6761 paypal_session \u8bb0\u5f55\uff0c\u5982\u679c\u6ca1\u6709\u6210\u529f\u8df3\u8f6c\u5230\u8d2d\u7269\u7f51\u7ad9\uff0c\u6ca1\u6709\u6210\u529f\u751f\u6210\u8ba2\u5355\uff0c\u90a3\u8fd9\u6761\u4ed8\u6b3e\u8bb0\u5f55\u6570\u636e\u5c31\u4f1a\u4e00\u76f4\u4fdd\u5b58\u5728\u6570\u636e\u5e93\uff0c\u5f53\u4f7f\u7528 Paypal Session Viewer \u63d2\u4ef6\uff0c\u5c31\u80fd\u67e5\u770b\u8fd9\u6761\u8bb0\u5f55\u7684\u6240\u6709\u6570\u636e\uff0c\u5305\u62ec\u5ba2\u6237\u4fe1\u606f\uff0c\u8d2d\u7269\u65f6\u95f4\uff0c\u5546\u54c1\u4fe1\u606f\uff0c\u5982\u679c\u4f60\u786e\u5b9a\u5df2\u6536\u5230\u6b3e\uff0c\u5c31\u53ef\u4ee5\u628a\u8fd9\u6761 paypal_session \u4fe1\u606f\u8f6c\u79fb\u5230\u8ba2\u5355\u4e2d\uff0c\u751f\u6210\u4e00\u4e2a\u8ba2\u5355\u3002<\/p>\n<p> \u63d2\u4ef6\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/www.zen-cart.cn\/english-version-modules\/admin-tools\/paypal-sessions-viewer<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150714\/2329445529-1.png\" class=\"aligncenter\" title=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe1\" alt=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe1\" \/><\/p>\n<p> &nbsp;<\/p>\n<p> \u4e09. \u4fee\u6539\u4ed8\u6b3e\u6d41\u7a0b\uff0c\u5148\u751f\u6210\u8ba2\u5355\u540e\u4ed8\u6b3e\u3002<\/p>\n<p> \u539f\u7406\uff1a\u7528\u8fc7zen-cart\u7684\u4eba\u90fd\u77e5\u9053\uff0czen-cart\u4e2d\u4e0b\u5355\u6b65\u9aa4\u662f\u4e0b\u9762\u8fd9\u6837\u7684(\u5176\u4e2d[]\u4e2d\u7684\u8868\u793a\u4e0d\u662f\u5fc5\u987b\u7684)\uff1a<\/p>\n<p> 1. \u8d2d\u7269\u8f66(shopping cart)<\/p>\n<p> 2. [\u8d27\u8fd0\u65b9\u5f0f(delivery method)]<\/p>\n<p> 3. \u652f\u4ed8\u65b9\u5f0f(payment method)<\/p>\n<p> 4. \u8ba2\u5355\u786e\u8ba4(confirmation)<\/p>\n<p> 5. [\u7b2c\u4e09\u65b9\u7f51\u7ad9\u652f\u4ed8]<\/p>\n<p> 6. \u8ba2\u5355\u5904\u7406(checkout process)\u2014\u2014\u8fd9\u4e00\u6b65\u6bd4\u8f83\u91cd\u8981\uff0c\u56e0\u4e3a\u4f1a\u5728\u8fd9\u91cc\u5c06\u8d2d\u7269\u8f66\u4e2d\u7684\u4fe1\u606f\u5199\u5165\u8ba2\u5355<\/p>\n<p> 7. \u4e0b\u5355\u6210\u529f(checkout success)<\/p>\n<p> \u8fd9\u6837\u7684\u6d41\u7a0b\u5728\u6b63\u5e38\u60c5\u51b5\u4e0b\u662f\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u7684\u3002\u4f46\u662f\uff0c\u4ece\u7b2c5\u6b65\u5230\u7b2c6\u90e8\u7684\u8fc7\u7a0b\u4e2d\uff0c\u7528\u6237\u53ef\u80fd\u4ee5\u4e3a\u4ed8\u6b3e\u6210\u529f\u5c31\u76f4\u63a5\u5173\u95ed\u6389\u7f51\u9875\u4e86\uff0c\u6216\u8005\u7531\u4e8e\u7f51\u7edc\u539f\u56e0\u9020\u6210\u4e0d\u80fd\u6b63\u5e38\u8df3\u8f6c\u5230checkout_process\u9875\u9762\uff0c\u8fd9\u6837\u9020\u6210\u7684\u540e\u679c\u662f\u5f88\u4e25\u91cd\u7684\uff0c\u56e0\u4e3a\u8ba2\u5355\u4e0d\u80fd\u88ab\u6b63\u5e38\u7684\u521b\u5efa\u3002\u57fa\u4e8e\u4e0a\u8ff0\u7684\u5206\u6790\uff0c \u6211\u4eec\u5e0c\u671b\u7a0d\u5fae\u5730\u6539\u53d8\u4e00\u4e0b\u6d41\u7a0b\uff0c\u5373\u5728\u652f\u4ed8\u4e4b\u524d\u8ba2\u5355\u5df2\u7ecf\u521b\u5efa\u597d\u4e86\uff0c\u8fd9\u6837\u5c31\u7b97\u5728\u652f\u4ed8\u65f6\u4e0d\u80fd\u4ece\u7b2c\u4e09\u65b9\u652f\u4ed8\u7f51\u7ad9\u8df3\u8f6c\u56de\u6765\uff0c\u6211\u4eec\u4e5f\u4e0d\u4f1a\u5b58\u5728\u7528\u6237\u4ed8\u6b3e\u6210\u529f\u5374\u5728\u540e\u53f0\u6ca1\u6709\u8ba2\u5355\u7684\u60c5\u51b5\u4e86\u3002<\/p>\n<p> \u672c\u4eba\u662f\u53c2\u7167\u4e1c\u56fd\u5148\u751f\u7684\u8fd9\u7bc7&nbsp;\u4fee\u6539zen-cart\u4e0b\u5355\u548c\u4ed8\u6b3e\u6d41\u7a0b\u4ee5\u9632\u6b62\u6f0f\u5355&nbsp;\u6559\u7a0b\u53bb\u4fee\u6539\u7684\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u6559\u7a0b\u6bd4\u8f83\u8001\uff0c\u800c\u4e14\u4e5f\u6ca1\u6709\u5f88\u5168\u9762\uff0c\u6240\u4ee5\u6211\u6839\u636e\u81ea\u5df1\u7684\u5b9e\u9645\u9700\u6c42\uff0c\u628a\u4ed6\u505a\u7684\u66f4\u5b8c\u5584\uff0c\u66f4\u7ec6\u8282\u5316\u3002<\/p>\n<p> \u7ecf\u8fc7\u4fee\u6539\u540e\u7684\u84dd\u56fe\u57fa\u672c\u662f\u4e0b\u9762\u8fd9\u6837\u7684\uff1a<\/p>\n<p> 1. \u5728checkour_confirmation\u9875\u9762\u786e\u8ba4\u8ba2\u5355\u540e\uff0c\u90fd\u4f1a\u76f4\u63a5proccess\uff0c\u5e76\u4e14\u8fdb\u5165 account_history_info \u9875\u9762,\u53ef\u4ee5\u5728\u8fd9\u91cc\u8fdb\u5165\u4ed8\u6b3e\u9875\u9762\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150714\/2329443523-2.png\" class=\"aligncenter\" title=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe2\" alt=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe2\" \/><\/p>\n<p> 2. \u5982\u679c\u5f53\u65f6\u5ba2\u6237\u6ca1\u80fd\u4ed8\u6b3e\uff0c\u4e5f\u53ef\u8fdb\u5165\u81ea\u5df1\u7684\u540e\u53f0\u5bf9\u5386\u53f2\u8ba2\u5355\u8fdb\u884c\u4ed8\u6b3e\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p> &nbsp;<img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150714\/2329441I5-3.jpg\" class=\"aligncenter\" title=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe3\" alt=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe3\" \/><\/p>\n<p> 3. \u672a\u4ed8\u6b3e\u7684\u8ba2\u5355\uff0c\u53ef\u4ee5\u5728\u540e\u53f0\u4fee\u6539\u4ef7\u683c\uff0c\u50cf\u6dd8\u5b9d\u4e00\u6837\u62cd\u4e0b\u5b9d\u8d1d\u540e\uff0c\u5e97\u4e3b\u7ed9\u4f60\u4fee\u6539\u4ef7\u683c\u540e\u518d\u4ed8\u6b3e\u4e00\u6837\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150714\/2329441447-4.png\" class=\"aligncenter\" title=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe4\" alt=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe4\" \/><\/p>\n<p> \u4e0b\u9762\u6211\u4eec\u6765\u6b63\u5f0f\u4fee\u6539\u4ee3\u7801\uff0c\u9996\u5148\u6211\u5217\u4e3e\u51fa\u6240\u6709\u8981\u4fee\u6539\u7684\u6587\u4ef6\uff1a<\/p>\n<p> 1. includes\/classes\/payment.php<\/p>\n<p> 2. includes\/modules\/payment\/paypal.php<\/p>\n<p> 3. includes\/classes\/order.php<\/p>\n<p> 4. includes\/modules\/pages\/checkout_process\/header_php.php<\/p>\n<p> 5. includes\/modules\/pages\/account_history_info\/header_php.php<\/p>\n<p> 6. includes\/templates\/\u4f60\u7684\u6a21\u677f\u76ee\u5f55\/templates\/tpl_account_history_info_default.php<\/p>\n<p> 7. includes\/templates\/\u4f60\u7684\u6a21\u677f\u76ee\u5f55\/templates\/tpl_account_history_default.php<\/p>\n<p> 8. ipn_main_handler.php<\/p>\n<p> 9. admin(\u540e\u53f0\u76ee\u5f55)\/orders.php<\/p>\n<p> \u56e0\u4e3a\u5148\u751f\u6210\u8ba2\u5355\u518d\u4ed8\u6b3e\uff0c\u4ed8\u6b3e\u6b65\u9aa4\u5c31\u4f1a\u6bd4\u539f\u6765\u53c8\u591a\u4e86\u4e00\u6b65\uff0c\u4e3a\u4e86\u7b80\u5316\u4ed8\u6b3e\u6d41\u7a0b\uff0c\u6211\u5b89\u88c5\u4e86&nbsp;Fast And Easy Checkout For Zencart(\u5feb\u901f\u652f\u4ed8)&nbsp;\u63d2\u4ef6\uff0c\u5b89\u88c5\u6b64\u63d2\u4ef6\u4e4b\u524d\uff0c\u9700\u8981\u5b89\u88c5\u53e6\u5916\u4e00\u4e2a\u63d2\u4ef6&nbsp;Css Js Loader For Zencart\uff0c\u8fd9\u662f\u5feb\u901f\u652f\u4ed8\u63d2\u4ef6\u7684\u4f9d\u8d56\u63d2\u4ef6\u3002\u5feb\u901f\u652f\u4ed8\u4e0e\u5148\u751f\u6210\u8ba2\u5355\u540e\u652f\u4ed8\u6ca1\u4ec0\u4e48\u56e0\u679c\u5173\u7cfb\uff0c\u6240\u4ee5\u5982\u679c\u4f60\u4e0d\u60f3\u5b89\u88c5\u7684\u8bdd\u5b8c\u5168\u53ef\u4ee5\u4e0d\u7406\u3002<\/p>\n<p> \u6309\u6b65\u9aa4\u4fee\u6539\u4e0a\u9762\u5217\u4e3e\u7684\u6587\u4ef6\uff1a<\/p>\n<p> 1. \u9996\u5148\u6211\u4eec\u9700\u8981\u5bf9\u73b0\u6709\u7684\u652f\u4ed8\u6a21\u5757\u8fdb\u884c\u4e00\u4e2a\u6539\u9020\u3002\u9700\u8981\u5bf9\u652f\u4ed8\u65b9\u5f0f\u7684class\u589e\u52a0\u4e00\u4e2a\u5b57\u6bb5paynow_action_url\uff0c\u7528\u6765\u8868\u793a\u8fdb\u884c\u652f\u4ed8\u7684\u9875\u9762 url\uff0c\u53e6\u5916\u8fd8\u9700\u8981\u589e\u52a0\u4e00\u4e2a\u51fd\u6570\uff0cpaynow_button($order_id)\uff0c\u6765\u83b7\u53d6\u652f\u4ed8\u8868\u5355\u7684\u53c2\u6570\u9690\u85cf\u57df\u4ee3\u7801\u3002<\/p>\n<p> \u8981\u589e\u52a0 paynow_action_url \u53d8\u91cf\uff0c\u8bf7\u5728\u7c7bpayment\u7684\u6784\u9020\u51fd\u6570\u4e2d\u6700\u540e\u52a0\u4e0a\u4e0b\u9762\u7684\u4ee3\u7801\uff1a&nbsp;<\/p>\n<pre>\r\nif ( (zen_not_null($module)) &amp;&amp; (in_array($module.'.php', $this-&gt;modules)) &amp;&amp; (isset($GLOBALS[$module]-&gt;paynow_action_url)) ) {\r\n        $this-&gt;paynow_action_url = $GLOBALS[$module]-&gt;paynow_action_url;        \r\n}<\/pre>\n<p> \u8981\u589e\u52a0paynow_button($order_id)\u51fd\u6570\uff0c\u8bf7\u5728payment\u7c7b\u7684\u6700\u540e\u4e00\u4e2a\u51fd\u6570\u4e4b\u540e\u52a0\u4e0a\u5982\u4e0b\u7684\u4ee3\u7801\uff1a<\/p>\n<pre>\r\nfunction paynow_button($order_id){\r\n    if (is_array($this-&gt;modules)) {\r\n      if (is_object($GLOBALS[$this-&gt;selected_module])) {\r\n        return $GLOBALS[$this-&gt;selected_module]-&gt;paynow_button($order_id);\r\n      }\r\n    }\r\n}<\/pre>\n<p> 2. \u4ee5paypal\u652f\u4ed8\u65b9\u5f0f\u4e3a\u4f8b\u5b50\uff0c\u8bf4\u660e\u5982\u4f55\u5177\u4f53\u5b9e\u73b0\u3002\u8fd9\u91cc\u76f4\u63a5\u4fee\u6539 paypal.php \u6587\u4ef6\uff0c\u6ce8\u610f\u5907\u4efd\u6b64\u6587\u4ef6\u3002\u4ee3\u7801\u5982\u4e0b\u6240\u793a\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u8fd9\u91cc\u53bb\u6389\u4e86\u5bf9 form_action_url \u7684\u6307\u5b9a\uff0c\u5e76\u7ed9\u5b9a\u4e86 paynow_action_url\uff0c\u56e0\u4e3a\u6211\u4eec\u5e0c\u671b\u7528\u6237\u70b9\u51fb\u201c\u786e\u8ba4\u8ba2\u5355\u201d\u540e\u76f4\u63a5\u8fdb\u5165checkout_process\uff0c\u6240\u4ee5\u5982\u679c\u4e0d\u6307\u5b9a form_action_url\uff0c\u90a3\u4e48\u786e\u8ba4\u8ba2\u5355\u7684\u8868\u5355\u5c31\u4f1a\u76f4\u63a5\u63d0\u4ea4\u5230 checkout_process \u9875\u9762\u4e86\uff0c\u800c paynow_action_url \u5c31\u662f \u4ee5\u524d\u7684 form_action_url \u7684\u503c\u3002paynow_button \u51fd\u6570\u7684\u5b9e\u73b0\u4e5f\u5f88\u7b80\u5355\uff0c\u8fd9\u91cc\u53ea\u662f\u5c06\u539f\u5148\u7684 process_button() \u51fd\u6570\u7684\u5185\u5bb9\u526a\u5207\u8fc7\u6765\u800c\u5df2\uff0c\u53ea\u4e0d\u8fc7\u6211\u4eec\u6ca1\u6709\u4f7f\u7528\u5168\u5c40\u7684$order\u53d8\u91cf\uff0c\u800c\u662f\u4f7f\u7528 $order = new order($order_id),\u6765\u91cd\u65b0\u6784\u9020\u7684\u4e00\u4e2a\u5bf9\u8c61\uff0c\u8fd9\u6837\u505a\u662f\u4e3a\u5728\u5386\u53f2\u8ba2\u5355\u4e2d\u663e\u793apay now\u6309\u94ae\u505a\u51c6\u5907\u7684\u3002paypal.php\u4fee\u6539\u540e\u7684\u6587\u4ef6\u5982\u4e0b\uff1a<br \/> &nbsp;<\/p>\n<p>  &lt;?php   \/**   &nbsp;* paypal.php payment module class for PayPal Website Payments Standard (IPN) method   &nbsp;*   &nbsp;* @package paymentMethod   &nbsp;* @copyright Copyright 2003-2010 Zen Cart Development Team   &nbsp;* @copyright Portions Copyright 2003 osCommerce   &nbsp;* @license http:\/\/www.zen-cart.com\/license\/2_0.txt GNU Public License V2.0   &nbsp;* @version $Id: paypal.php 15735 2010-03-29 07:13:53Z drbyte $   &nbsp;*\/   &nbsp;   define(&#8216;MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE&#8217;, &#8216;true&#8217;);   &nbsp;   \/**   &nbsp;* &nbsp;ensure dependencies are loaded   &nbsp;*\/   &nbsp; include_once((IS_ADMIN_FLAG === true ? DIR_FS_CATALOG_MODULES : DIR_WS_MODULES) . &#8216;payment\/paypal\/paypal_functions.php&#8217;);   &nbsp;   \/**   &nbsp;* paypal.php payment module class for PayPal Website Payments Standard (IPN) method   &nbsp;*   &nbsp;*\/   class paypal extends base {   &nbsp; \/**   &nbsp; &nbsp;* string representing the payment method   &nbsp; &nbsp;*   &nbsp; &nbsp;* @var string   &nbsp; &nbsp;*\/   &nbsp; var $code;   &nbsp; \/**   &nbsp; &nbsp;* $title is the displayed name for this payment method   &nbsp; &nbsp;*   &nbsp; &nbsp;* @var string   &nbsp; &nbsp; *\/   &nbsp; var $title;   &nbsp; \/**   &nbsp; &nbsp;* $description is a soft name for this payment method   &nbsp; &nbsp;*   &nbsp; &nbsp;* @var string   &nbsp; &nbsp; *\/   &nbsp; var $description;   &nbsp; \/**   &nbsp; &nbsp;* $enabled determines whether this module shows or not&#8230; in catalog.   &nbsp; &nbsp;*   &nbsp; &nbsp;* @var boolean   &nbsp; &nbsp; *\/   &nbsp; var $enabled;   &nbsp; \/**   &nbsp; &nbsp; * constructor   &nbsp; &nbsp; *   &nbsp; &nbsp; * @param int $paypal_ipn_id   &nbsp; &nbsp; * @return paypal   &nbsp; &nbsp; *\/   &nbsp; function paypal($paypal_ipn_id = &#8221;) {   &nbsp; &nbsp; global $order, $messageStack;   &nbsp; &nbsp; $this-&gt;code = &#8216;paypal&#8217;;   &nbsp; &nbsp; $this-&gt;codeVersion = &#8216;1.3.9&#8217;;   &nbsp; &nbsp; if (IS_ADMIN_FLAG === true) {   &nbsp; &nbsp; &nbsp; $this-&gt;title = MODULE_PAYMENT_PAYPAL_TEXT_ADMIN_TITLE; \/\/ Payment Module title in Admin   &nbsp; &nbsp; &nbsp; if (IS_ADMIN_FLAG === true &amp;&amp; defined(&#8216;MODULE_PAYMENT_PAYPAL_IPN_DEBUG&#8217;) &amp;&amp; MODULE_PAYMENT_PAYPAL_IPN_DEBUG != &#8216;Off&#8217;) $this-&gt;title .= &#8216;&lt;span class=&#8221;alert&#8221;&gt; (debug mode active)&lt;\/span&gt;&#8217;;   &nbsp; &nbsp; &nbsp; if (IS_ADMIN_FLAG === true &amp;&amp; MODULE_PAYMENT_PAYPAL_TESTING == &#8216;Test&#8217;) $this-&gt;title .= &#8216;&lt;span class=&#8221;alert&#8221;&gt; (dev\/test mode active)&lt;\/span&gt;&#8217;;   &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; $this-&gt;title = MODULE_PAYMENT_PAYPAL_TEXT_CATALOG_TITLE; \/\/ Payment Module title in Catalog   &nbsp; &nbsp; }   &nbsp; &nbsp; $this-&gt;description = MODULE_PAYMENT_PAYPAL_TEXT_DESCRIPTION;   &nbsp; &nbsp; $this-&gt;sort_order = MODULE_PAYMENT_PAYPAL_SORT_ORDER;   &nbsp; &nbsp; $this-&gt;enabled = ((MODULE_PAYMENT_PAYPAL_STATUS == &#8216;True&#8217;) ? true : false);   &nbsp; &nbsp; if ((int)MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID &gt; 0) {   &nbsp; &nbsp; &nbsp; $this-&gt;order_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID;   &nbsp; &nbsp; }   &nbsp; &nbsp; if (is_object($order)) $this-&gt;update_status();   &nbsp; &nbsp; $this-&gt;paynow_action_url = &#8216;https:\/\/&#8217; . MODULE_PAYMENT_PAYPAL_HANDLER;   &nbsp;   &nbsp; &nbsp; if (PROJECT_VERSION_MAJOR != &#8216;1&#8217; &amp;&amp; substr(PROJECT_VERSION_MINOR, 0, 3) != &#8216;3.9&#8217;) $this-&gt;enabled = false;   &nbsp;   &nbsp; &nbsp; \/\/ verify table structure   &nbsp; &nbsp; if (IS_ADMIN_FLAG === true) $this-&gt;tableCheckup();   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* calculate zone matches and flag settings to determine whether this module should display to customers or not   &nbsp; &nbsp; *   &nbsp; &nbsp; *\/   &nbsp; function update_status() {   &nbsp; &nbsp; global $order, $db;   &nbsp;   &nbsp; &nbsp; if ( ($this-&gt;enabled == true) &amp;&amp; ((int)MODULE_PAYMENT_PAYPAL_ZONE &gt; 0) ) {   &nbsp; &nbsp; &nbsp; $check_flag = false;   &nbsp; &nbsp; &nbsp; $check_query = $db-&gt;Execute(&#8220;select zone_id from &#8221; . TABLE_ZONES_TO_GEO_ZONES . &#8221; where geo_zone_id = &#8216;&#8221; . MODULE_PAYMENT_PAYPAL_ZONE . &#8220;&#8216; and zone_country_id = &#8216;&#8221; . $order-&gt;billing[&#8216;country&#8217;][&#8216;id&#8217;] . &#8220;&#8216; order by zone_id&#8221;);   &nbsp; &nbsp; &nbsp; while (!$check_query-&gt;EOF) {   &nbsp; &nbsp; &nbsp; &nbsp; if ($check_query-&gt;fields[&#8216;zone_id&#8217;] &lt; 1) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $check_flag = true;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; } elseif ($check_query-&gt;fields[&#8216;zone_id&#8217;] == $order-&gt;billing[&#8216;zone_id&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $check_flag = true;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; $check_query-&gt;MoveNext();   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; if ($check_flag == false) {   &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;enabled = false;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* JS validation which does error-checking of data-entry if this module is selected for use   &nbsp; &nbsp;* (Number, Owner, and CVV Lengths)   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return string   &nbsp; &nbsp; *\/   &nbsp; function javascript_validation() {   &nbsp; &nbsp; return false;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Displays payment method name along with Credit Card Information Submission Fields (if any) on the Checkout Payment Page   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return array   &nbsp; &nbsp; *\/   &nbsp; function selection() {   &nbsp; &nbsp; return array(&#8216;id&#8217; =&gt; $this-&gt;code,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;module&#8217; =&gt; MODULE_PAYMENT_PAYPAL_TEXT_CATALOG_LOGO,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;icon&#8217; =&gt; MODULE_PAYMENT_PAYPAL_TEXT_CATALOG_LOGO   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;);   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Normally evaluates the Credit Card Type for acceptance and the validity of the Credit Card Number &amp; Expiration Date   &nbsp; &nbsp;* Since paypal module is not collecting info, it simply skips this step.   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return boolean   &nbsp; &nbsp;*\/   &nbsp; function pre_confirmation_check() {   &nbsp; &nbsp; return false;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Display Credit Card Information on the Checkout Confirmation Page   &nbsp; &nbsp;* Since none is collected for paypal before forwarding to paypal site, this is skipped   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return boolean   &nbsp; &nbsp; *\/   &nbsp; function confirmation() {   &nbsp; &nbsp; return false;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Build the data and actions to process when the &#8220;Submit&#8221; button is pressed on the order-confirmation screen.   &nbsp; &nbsp;* This sends the data to the payment gateway for processing.   &nbsp; &nbsp;* (These are hidden fields on the checkout confirmation page)   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return string   &nbsp; &nbsp; *\/   &nbsp; function process_button() {   &nbsp; &nbsp; return false;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Determine the language to use when visiting the PayPal site   &nbsp; &nbsp;*\/   &nbsp; function getLanguageCode() {   &nbsp; &nbsp; global $order;   &nbsp; &nbsp; $lang_code = &#8221;;   &nbsp; &nbsp; $orderISO = zen_get_countries($order-&gt;customer[&#8216;country&#8217;][&#8216;id&#8217;], true);   &nbsp; &nbsp; $storeISO = zen_get_countries(STORE_COUNTRY, true);   &nbsp; &nbsp; if (in_array(strtoupper($orderISO[&#8216;countries_iso_code_2&#8217;]), array(&#8216;US&#8217;, &#8216;AU&#8217;, &#8216;DE&#8217;, &#8216;FR&#8217;, &#8216;IT&#8217;, &#8216;GB&#8217;, &#8216;ES&#8217;, &#8216;AT&#8217;, &#8216;BE&#8217;, &#8216;CA&#8217;, &#8216;CH&#8217;, &#8216;CN&#8217;, &#8216;NL&#8217;, &#8216;PL&#8217;))) {   &nbsp; &nbsp; &nbsp; $lang_code = strtoupper($orderISO[&#8216;countries_iso_code_2&#8217;]);   &nbsp; &nbsp; } elseif (in_array(strtoupper($storeISO[&#8216;countries_iso_code_2&#8217;]), array(&#8216;US&#8217;, &#8216;AU&#8217;, &#8216;DE&#8217;, &#8216;FR&#8217;, &#8216;IT&#8217;, &#8216;GB&#8217;, &#8216;ES&#8217;, &#8216;AT&#8217;, &#8216;BE&#8217;, &#8216;CA&#8217;, &#8216;CH&#8217;, &#8216;CN&#8217;, &#8216;NL&#8217;, &#8216;PL&#8217;))) {   &nbsp; &nbsp; &nbsp; $lang_code = strtoupper($storeISO[&#8216;countries_iso_code_2&#8217;]);   &nbsp; &nbsp; } elseif (in_array(strtoupper($_SESSION[&#8216;languages_code&#8217;]), array(&#8216;EN&#8217;, &#8216;US&#8217;, &#8216;AU&#8217;, &#8216;DE&#8217;, &#8216;FR&#8217;, &#8216;IT&#8217;, &#8216;GB&#8217;, &#8216;ES&#8217;, &#8216;AT&#8217;, &#8216;BE&#8217;, &#8216;CA&#8217;, &#8216;CH&#8217;, &#8216;CN&#8217;, &#8216;NL&#8217;, &#8216;PL&#8217;))) {   &nbsp; &nbsp; &nbsp; $lang_code = $_SESSION[&#8216;languages_code&#8217;];   &nbsp; &nbsp; &nbsp; if (strtoupper($lang_code) == &#8216;EN&#8217;) $lang_code = &#8216;US&#8217;;   &nbsp; &nbsp; }   &nbsp; &nbsp; \/\/return $orderISO[&#8216;countries_iso_code_2&#8217;];   &nbsp; &nbsp; return strtoupper($lang_code);   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Store transaction info to the order and process any results that come back from the payment gateway   &nbsp; &nbsp;*\/   &nbsp; function before_process() {   &nbsp; &nbsp; return false;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp; * Checks referrer   &nbsp; &nbsp; *   &nbsp; &nbsp; * @param string $zf_domain   &nbsp; &nbsp; * @return boolean   &nbsp; &nbsp; *\/   &nbsp; function check_referrer($zf_domain) {   &nbsp; &nbsp; return true;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp; * Build admin-page components   &nbsp; &nbsp; *   &nbsp; &nbsp; * @param int $zf_order_id   &nbsp; &nbsp; * @return string   &nbsp; &nbsp; *\/   &nbsp; function admin_notification($zf_order_id) {   &nbsp; &nbsp; global $db;   &nbsp; &nbsp; $output = &#8221;;   &nbsp; &nbsp; $sql = &#8220;select * from &#8221; . TABLE_PAYPAL . &#8221; where order_id = &#8216;&#8221; . (int)$zf_order_id . &#8220;&#8216; order by paypal_ipn_id DESC LIMIT 1&#8221;;   &nbsp; &nbsp; $ipn = $db-&gt;Execute($sql);   &nbsp; &nbsp; if ($ipn-&gt;RecordCount() &gt; 0 &amp;&amp; file_exists(DIR_FS_CATALOG . DIR_WS_MODULES . &#8216;payment\/paypal\/paypal_admin_notification.php&#8217;)) require(DIR_FS_CATALOG . DIR_WS_MODULES . &#8216;payment\/paypal\/paypal_admin_notification.php&#8217;);   &nbsp; &nbsp; return $output;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Post-processing activities   &nbsp; &nbsp;* When the order returns from the processor, if PDT was successful, this stores the results in order-status-history and logs data for subsequent reference   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return boolean   &nbsp; &nbsp; *\/   &nbsp; function after_process() {   &nbsp; &nbsp; return false;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Used to display error message details   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return boolean   &nbsp; &nbsp; *\/   &nbsp; function output_error() {   &nbsp; &nbsp; return false;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Check to see whether module is installed   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return boolean   &nbsp; &nbsp; *\/   &nbsp; function check() {   &nbsp; &nbsp; global $db;   &nbsp; &nbsp; if (IS_ADMIN_FLAG === true) {   &nbsp; &nbsp; &nbsp; global $sniffer;   &nbsp; &nbsp; &nbsp; if ($sniffer-&gt;field_exists(TABLE_PAYPAL, &#8216;zen_order_id&#8217;)) &nbsp;$db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE COLUMN zen_order_id order_id int(11) NOT NULL default &#8216;0&#8217;&#8221;);   &nbsp; &nbsp; }   &nbsp; &nbsp; if (!isset($this-&gt;_check)) {   &nbsp; &nbsp; &nbsp; $check_query = $db-&gt;Execute(&#8220;select configuration_value from &#8221; . TABLE_CONFIGURATION . &#8221; where configuration_key = &#8216;MODULE_PAYMENT_PAYPAL_STATUS'&#8221;);   &nbsp; &nbsp; &nbsp; $this-&gt;_check = $check_query-&gt;RecordCount();   &nbsp; &nbsp; }   &nbsp; &nbsp; return $this-&gt;_check;   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Install the payment module and its configuration settings   &nbsp; &nbsp; *   &nbsp; &nbsp; *\/   &nbsp; function install() {   &nbsp; &nbsp; global $db, $messageStack;   &nbsp; &nbsp; if (defined(&#8216;MODULE_PAYMENT_PAYPAL_STATUS&#8217;)) {   &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(&#8216;PayPal Website Payments Standard module already installed.&#8217;, &#8216;error&#8217;);   &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_MODULES, &#8216;set=payment&amp;module=paypal&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; return &#8216;failed&#8217;;   &nbsp; &nbsp; }   &nbsp; &nbsp; if (defined(&#8216;MODULE_PAYMENT_PAYPALWPP_STATUS&#8217;)) {   &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(&#8216;NOTE: PayPal Express Checkout module already installed. You don\\&#8217;t need Standard if you have Express installed.&#8217;, &#8216;error&#8217;);   &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_MODULES, &#8216;set=payment&amp;module=paypalwpp&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; return &#8216;failed&#8217;;   &nbsp; &nbsp; }   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (&#8216;Enable PayPal Module&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_STATUS&#8217;, &#8216;True&#8217;, &#8216;Do you want to accept PayPal payments?&#8217;, &#8216;6&#8217;, &#8216;0&#8217;, &#8216;zen_cfg_select_option(array(\\&#8217;True\\&#8217;, \\&#8217;False\\&#8217;), &#8216;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (&#8216;Business ID&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_BUSINESS_ID&#8217;,'&#8221;.STORE_OWNER_EMAIL_ADDRESS.&#8221;&#8216;, &#8216;Primary email address for your PayPal account.&lt;br \/&gt;NOTE: This must match &lt;strong&gt;EXACTLY &lt;\/strong&gt;the primary email address on your PayPal account settings. &nbsp;It &lt;strong&gt;IS case-sensitive&lt;\/strong&gt;, so please check your PayPal profile preferences at paypal.com and be sure to enter the EXACT same primary email address here.&#8217;, &#8216;6&#8217;, &#8216;2&#8217;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (&#8216;Transaction Currency&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_CURRENCY&#8217;, &#8216;Selected Currency&#8217;, &#8216;Which currency should the order be sent to PayPal as? &lt;br \/&gt;NOTE: if an unsupported currency is sent to PayPal, it will be auto-converted to USD.&#8217;, &#8216;6&#8217;, &#8216;3&#8217;, &#8216;zen_cfg_select_option(array(\\&#8217;Selected Currency\\&#8217;, \\&#8217;Only USD\\&#8217;, \\&#8217;Only AUD\\&#8217;, \\&#8217;Only CAD\\&#8217;, \\&#8217;Only EUR\\&#8217;, \\&#8217;Only GBP\\&#8217;, \\&#8217;Only CHF\\&#8217;, \\&#8217;Only CZK\\&#8217;, \\&#8217;Only DKK\\&#8217;, \\&#8217;Only HKD\\&#8217;, \\&#8217;Only HUF\\&#8217;, \\&#8217;Only JPY\\&#8217;, \\&#8217;Only NOK\\&#8217;, \\&#8217;Only NZD\\&#8217;, \\&#8217;Only PLN\\&#8217;, \\&#8217;Only SEK\\&#8217;, \\&#8217;Only SGD\\&#8217;, \\&#8217;Only THB\\&#8217;, \\&#8217;Only MXN\\&#8217;, \\&#8217;Only ILS\\&#8217;, \\&#8217;Only PHP\\&#8217;, \\&#8217;Only TWD\\&#8217;, \\&#8217;Only BRL\\&#8217;, \\&#8217;Only MYR\\&#8217;), &#8216;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values (&#8216;Payment Zone&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_ZONE&#8217;, &#8216;0&#8217;, &#8216;If a zone is selected, only enable this payment method for that zone.&#8217;, &#8216;6&#8217;, &#8216;4&#8217;, &#8216;zen_get_zone_class_title&#8217;, &#8216;zen_cfg_pull_down_zone_classes(&#8216;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values (&#8216;Set Pending Notification Status&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID&#8217;, &#8216;&#8221; . DEFAULT_ORDERS_STATUS_ID . &nbsp;&#8220;&#8216;, &#8216;Set the status of orders made with this payment module that are not yet completed to this value&lt;br \/&gt;(\\&#8217;Pending\\&#8217; recommended)&#8217;, &#8216;6&#8217;, &#8216;5&#8217;, &#8216;zen_cfg_pull_down_order_statuses(&#8216;, &#8216;zen_get_order_status_name&#8217;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values (&#8216;Set Order Status&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID&#8217;, &#8216;2&#8217;, &#8216;Set the status of orders made with this payment module that have completed payment to this value&lt;br \/&gt;(\\&#8217;Processing\\&#8217; recommended)&#8217;, &#8216;6&#8217;, &#8216;6&#8217;, &#8216;zen_cfg_pull_down_order_statuses(&#8216;, &#8216;zen_get_order_status_name&#8217;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values (&#8216;Set Refund Order Status&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID&#8217;, &#8216;1&#8217;, &#8216;Set the status of orders that have been refunded made with this payment module to this value&lt;br \/&gt;(\\&#8217;Pending\\&#8217; recommended)&#8217;, &#8216;6&#8217;, &#8216;7&#8217;, &#8216;zen_cfg_pull_down_order_statuses(&#8216;, &#8216;zen_get_order_status_name&#8217;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (&#8216;Sort order of display.&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_SORT_ORDER&#8217;, &#8216;0&#8217;, &#8216;Sort order of display. Lowest is displayed first.&#8217;, &#8216;6&#8217;, &#8216;8&#8217;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (&#8216;Address Override&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE&#8217;, &#8216;1&#8217;, &#8216;If set to 1, the customer shipping address selected in Zen Cart will override the customer PayPal-stored address book. The customer will see their address from Zen Cart, but will NOT be able to edit it at PayPal.&lt;br \/&gt;(An invalid address will be treated by PayPal as not-supplied, or override=0)&lt;br \/&gt;0=No Override&lt;br \/&gt;1=ZC address overrides PayPal address choices&#8217;, &#8216;6&#8217;, &#8217;18&#8217;, &#8216;zen_cfg_select_option(array(\\&#8217;0\\&#8217;,\\&#8217;1\\&#8217;), &#8216;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (&#8216;Shipping Address Requirements?&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED&#8217;, &#8216;2&#8217;, &#8216;The buyers shipping address. If set to 0 your customer will be prompted to include a shipping address. If set to 1 your customer will not be asked for a shipping address. If set to 2 your customer will be required to provide a shipping address.&lt;br \/&gt;0=Prompt&lt;br \/&gt;1=Not Asked&lt;br \/&gt;2=Required&lt;br \/&gt;&lt;br \/&gt;&lt;strong&gt;NOTE: If you allow your customers to enter their own shipping address, then MAKE SURE you PERSONALLY manually verify the PayPal confirmation details to verify the proper address when filling orders. When using Website Payments Standard (IPN), Zen Cart does not know if they choose an alternate shipping address at PayPal vs the one entered when placing an order.&lt;\/strong&gt;&#8217;, &#8216;6&#8217;, &#8217;20&#8217;, &#8216;zen_cfg_select_option(array(\\&#8217;0\\&#8217;,\\&#8217;1\\&#8217;,\\&#8217;2\\&#8217;), &#8216;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (&#8216;Detailed Line Items in Cart&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_DETAILED_CART&#8217;, &#8216;No&#8217;, &#8216;Do you want to give line-item details to PayPal? &nbsp;If set to True, line-item details will be shared with PayPal if no discounts apply and if tax and shipping are simple. Otherwise an Aggregate cart summary will be sent.&#8217;, &#8216;6&#8217;, &#8217;22&#8217;, &#8216;zen_cfg_select_option(array(\\&#8217;No\\&#8217;,\\&#8217;Yes\\&#8217;), &#8216;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (&#8216;Page Style&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_PAGE_STYLE&#8217;, &#8216;Primary&#8217;, &#8216;Sets the Custom Payment Page Style for payment pages. The value of page_style is the same as the Page Style Name you chose when adding or editing the page style. You can add and edit Custom Payment Page Styles from the Profile subtab of the My Account tab on the PayPal site. If you would like to always reference your Primary style, set this to \\&#8221;primary.\\&#8221; If you would like to reference the default PayPal page style, set this to \\&#8221;paypal\\&#8221;.&#8217;, &#8216;6&#8217;, &#8217;25&#8217;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (&#8216;Mode for PayPal web services&lt;br \/&gt;&lt;br \/&gt;Default:&lt;br \/&gt;&lt;code&gt;www.paypal.com\/cgi-bin\/webscr&lt;\/code&gt;&lt;br \/&gt;or&lt;br \/&gt;&lt;code&gt;www.paypal.com\/us\/cgi-bin\/webscr&lt;\/code&gt;&lt;br \/&gt;or for the UK,&lt;br \/&gt;&lt;code&gt;www.paypal.com\/uk\/cgi-bin\/webscr&lt;\/code&gt;&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_HANDLER&#8217;, &#8216;www.paypal.com\/cgi-bin\/webscr&#8217;, &#8216;Choose the URL for PayPal live processing&#8217;, &#8216;6&#8217;, &#8217;73&#8217;, &#8221;, now())&#8221;);   &nbsp; &nbsp; \/\/ sandbox: &nbsp;www.sandbox.paypal.com\/cgi-bin\/webscr   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values (&#8216;PDT Token (Payment Data Transfer)&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_PDTTOKEN&#8217;, &#8221;, &#8216;Enter your PDT Token value here in order to activate transactions immediately after processing (if they pass validation).&#8217;, &#8216;6&#8217;, &#8217;25&#8217;, now(), &#8216;zen_cfg_password_display&#8217;)&#8221;);   &nbsp; &nbsp; \/\/ Paypal testing options here   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values (&#8216;Debug Mode&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_IPN_DEBUG&#8217;, &#8216;Off&#8217;, &#8216;Enable debug logging? &lt;br \/&gt;NOTE: This can REALLY clutter your email inbox!&lt;br \/&gt;Logging goes to the \/includes\/modules\/payment\/paypal\/logs folder&lt;br \/&gt;Email goes to the store-owner address.&lt;br \/&gt;Email option NOT recommended.&lt;br \/&gt;&lt;strong&gt;Leave OFF for normal operation.&lt;\/strong&gt;&#8217;, &#8216;6&#8217;, &#8217;71&#8217;, &#8216;zen_cfg_select_option(array(\\&#8217;Off\\&#8217;,\\&#8217;Log File\\&#8217;,\\&#8217;Log and Email\\&#8217;), &#8216;, now())&#8221;);   &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_CONFIGURATION . &#8221; (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values (&#8216;Debug Email Address&#8217;, &#8216;MODULE_PAYMENT_PAYPAL_DEBUG_EMAIL_ADDRESS&#8217;,'&#8221;.STORE_OWNER_EMAIL_ADDRESS.&#8221;&#8216;, &#8216;The email address to use for PayPal debugging&#8217;, &#8216;6&#8217;, &#8217;72&#8217;, now())&#8221;);   &nbsp;   &nbsp; &nbsp; $this-&gt;notify(&#8216;NOTIFY_PAYMENT_PAYPAL_INSTALLED&#8217;);   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Remove the module and all its settings   &nbsp; &nbsp; *   &nbsp; &nbsp; *\/   &nbsp; function remove() {   &nbsp; &nbsp; global $db;   &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_CONFIGURATION . &#8221; where configuration_key LIKE &#8216;MODULE\\_PAYMENT\\_PAYPAL\\_%'&#8221;);   &nbsp; &nbsp; $this-&gt;notify(&#8216;NOTIFY_PAYMENT_PAYPAL_UNINSTALLED&#8217;);   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* Internal list of configuration keys used for configuration of the module   &nbsp; &nbsp;*   &nbsp; &nbsp;* @return array   &nbsp; &nbsp; *\/   &nbsp; function keys() {   &nbsp; &nbsp; $keys_list = array(   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_STATUS&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_BUSINESS_ID&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_PDTTOKEN&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_CURRENCY&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_ZONE&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_SORT_ORDER&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_DETAILED_CART&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE&#8217; ,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED&#8217; ,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_PAGE_STYLE&#8217; ,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_HANDLER&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;MODULE_PAYMENT_PAYPAL_IPN_DEBUG&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );   &nbsp;   &nbsp; &nbsp; \/\/ Paypal testing\/debug options go here:   &nbsp; &nbsp; if (IS_ADMIN_FLAG === true) {   &nbsp; &nbsp; &nbsp; if (isset($_GET[&#8216;debug&#8217;]) &amp;&amp; $_GET[&#8216;debug&#8217;]==&#8217;on&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; $keys_list[]=&#8217;MODULE_PAYMENT_PAYPAL_DEBUG_EMAIL_ADDRESS&#8217;; &nbsp;\/* this defaults to store-owner-email-address *\/   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp; &nbsp; return $keys_list;   &nbsp; }   &nbsp;   &nbsp; function _getPDTresults($orderAmount, $my_currency, $pdtTX) {   &nbsp; &nbsp; global $db;   &nbsp; &nbsp; $ipnData &nbsp;= ipn_postback(&#8216;PDT&#8217;, $pdtTX);   &nbsp; &nbsp; $respdata = $ipnData[&#8216;info&#8217;];   &nbsp;   &nbsp; &nbsp; \/\/ parse the data   &nbsp; &nbsp; $lines = explode(&#8220;\\n&#8221;, $respdata);   &nbsp; &nbsp; $this-&gt;pdtData = array();   &nbsp; &nbsp; for ($i=1; $i&lt;count($lines);$i++){   &nbsp; &nbsp; &nbsp; if (!strstr($lines[$i], &#8220;=&#8221;)) continue;   &nbsp; &nbsp; &nbsp; list($key,$val) = explode(&#8220;=&#8221;, $lines[$i]);   &nbsp; &nbsp; &nbsp; $this-&gt;pdtData[urldecode($key)] = urldecode($val);   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; if ($this-&gt;pdtData[&#8216;txn_id&#8217;] == &#8221; || $this-&gt;pdtData[&#8216;payment_status&#8217;] == &#8221;) {   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;PDT Returned INVALID Data. Must wait for IPN to process instead. &#8216; . &#8220;\\n&#8221; . print_r($this-&gt;pdtData, true));   &nbsp; &nbsp; &nbsp; return FALSE;   &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;PDT Returned Data &#8216; . print_r($this-&gt;pdtData, true));   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; $_POST[&#8216;mc_gross&#8217;] = $this-&gt;pdtData[&#8216;mc_gross&#8217;];   &nbsp; &nbsp; $_POST[&#8216;mc_currency&#8217;] = $this-&gt;pdtData[&#8216;mc_currency&#8217;];   &nbsp; &nbsp; $_POST[&#8216;business&#8217;] = $this-&gt;pdtData[&#8216;business&#8217;];   &nbsp; &nbsp; $_POST[&#8216;receiver_email&#8217;] = $this-&gt;pdtData[&#8216;receiver_email&#8217;];   &nbsp;   &nbsp; &nbsp; $PDTstatus = (ipn_validate_transaction($respdata, $this-&gt;pdtData, &#8216;PDT&#8217;) &amp;&amp; valid_payment($orderAmount, $my_currency, &#8216;PDT&#8217;) &amp;&amp; $this-&gt;pdtData[&#8216;payment_status&#8217;] == &#8216;Completed&#8217;);   &nbsp; &nbsp; if ($this-&gt;pdtData[&#8216;payment_status&#8217;] != &#8221; &amp;&amp; $this-&gt;pdtData[&#8216;payment_status&#8217;] != &#8216;Completed&#8217;) {   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;PDT WARNING :: Order not marked as &#8220;Completed&#8221;. &nbsp;Check for Pending reasons or wait for IPN to complete.&#8217; . &#8220;\\n&#8221; . &#8216;[payment_status] =&gt; &#8216; . $this-&gt;pdtData[&#8216;payment_status&#8217;] . &#8220;\\n&#8221; . &#8216;[pending_reason] =&gt; &#8216; . $this-&gt;pdtData[&#8216;pending_reason&#8217;]);   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; $sql = &#8220;SELECT order_id, paypal_ipn_id, payment_status, txn_type, pending_reason   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM &#8221; . TABLE_PAYPAL . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE txn_id = :transactionID OR parent_txn_id = :transactionID   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ORDER BY order_id DESC &nbsp;&#8220;;   &nbsp; &nbsp; $sql = $db-&gt;bindVars($sql, &#8216;:transactionID&#8217;, $this-&gt;pdtData[&#8216;txn_id&#8217;], &#8216;string&#8217;);   &nbsp; &nbsp; $ipn_id = $db-&gt;Execute($sql);   &nbsp; &nbsp; if ($ipn_id-&gt;RecordCount() != 0) {   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;PDT WARNING :: Transaction already exists. Perhaps IPN already added it. &nbsp;PDT processing ended.&#8217;);   &nbsp; &nbsp; &nbsp; $pdtTXN_is_unique = false;   &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; $pdtTXN_is_unique = true;   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; $PDTstatus = ($pdtTXN_is_unique &amp;&amp; $PDTstatus);   &nbsp;   &nbsp; &nbsp; return $PDTstatus;   &nbsp; }   &nbsp;   &nbsp;   &nbsp; function tableCheckup() {   &nbsp; &nbsp; global $db, $sniffer;   &nbsp; &nbsp; $fieldOkay1 = (method_exists($sniffer, &#8216;field_type&#8217;)) ? $sniffer-&gt;field_type(TABLE_PAYPAL, &#8216;txn_id&#8217;, &#8216;varchar(20)&#8217;, true) : -1;   &nbsp; &nbsp; $fieldOkay2 = ($sniffer-&gt;field_exists(TABLE_PAYPAL, &#8216;module_name&#8217;)) ? true : -1;   &nbsp; &nbsp; $fieldOkay3 = ($sniffer-&gt;field_exists(TABLE_PAYPAL, &#8216;order_id&#8217;)) ? true : -1;   &nbsp;   &nbsp; &nbsp; if ($fieldOkay1 == -1) {   &nbsp; &nbsp; &nbsp; $sql = &#8220;show fields from &#8221; . TABLE_PAYPAL;   &nbsp; &nbsp; &nbsp; $result = $db-&gt;Execute($sql);   &nbsp; &nbsp; &nbsp; while (!$result-&gt;EOF) {   &nbsp; &nbsp; &nbsp; &nbsp; if &nbsp;($result-&gt;fields[&#8216;Field&#8217;] == &#8216;txn_id&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if &nbsp;($result-&gt;fields[&#8216;Type&#8217;] == &#8216;varchar(20)&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fieldOkay1 = true; \/\/ exists and matches required type, so skip to other checkup   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $fieldOkay1 = $result-&gt;fields[&#8216;Type&#8217;]; \/\/ doesn&#8217;t match, so return what it &#8220;is&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; $result-&gt;MoveNext();   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; if ($fieldOkay1 !== true) {   &nbsp; &nbsp; &nbsp; \/\/ temporary fix to table structure for v1.3.7.x &#8212; may remove in later release   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE payment_type payment_type varchar(40) NOT NULL default &#8221;&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE txn_type txn_type varchar(40) NOT NULL default &#8221;&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE payment_status payment_status varchar(32) NOT NULL default &#8221;&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE reason_code reason_code varchar(40) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE pending_reason pending_reason varchar(32) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE invoice invoice varchar(128) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE payer_business_name payer_business_name varchar(128) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE address_name address_name varchar(64) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE address_street address_street varchar(254) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE address_city address_city varchar(120) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE address_state address_state varchar(120) default NULL&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE payer_email payer_email varchar(128) NOT NULL default &#8221;&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE business business varchar(128) NOT NULL default &#8221;&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE receiver_email receiver_email varchar(128) NOT NULL default &#8221;&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE txn_id txn_id varchar(20) NOT NULL default &#8221;&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE parent_txn_id parent_txn_id varchar(20) default NULL&#8221;);   &nbsp; &nbsp; }   &nbsp; &nbsp; if ($fieldOkay2 !== true) {   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; ADD COLUMN module_name varchar(40) NOT NULL default &#8221; after txn_type&#8221;);   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; ADD COLUMN module_mode varchar(40) NOT NULL default &#8221; after module_name&#8221;);   &nbsp; &nbsp; }   &nbsp; &nbsp; if ($fieldOkay3 !== true) {   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;ALTER TABLE &#8221; . TABLE_PAYPAL . &#8221; CHANGE zen_order_id order_id int(11) NOT NULL default &#8216;0&#8217;&#8221;);   &nbsp; &nbsp; }   &nbsp; }   &nbsp;&nbsp;   &nbsp; function paynow_button($order_id) {   &nbsp; &nbsp; &nbsp; global $db, $order, $currencies, $currency;   &nbsp; &nbsp; &nbsp; require_once(DIR_WS_CLASSES . &#8216;order.php&#8217;);   &nbsp; &nbsp; &nbsp; $order = new order($order_id);   &nbsp; &nbsp; &nbsp; $options = array();   &nbsp; &nbsp; &nbsp; $optionsCore = array();   &nbsp; &nbsp; &nbsp; $optionsPhone = array();   &nbsp; &nbsp; &nbsp; $optionsShip = array();   &nbsp; &nbsp; &nbsp; $optionsLineItems = array();   &nbsp; &nbsp; &nbsp; $optionsAggregate = array();   &nbsp; &nbsp; &nbsp; $optionsTrans = array();   &nbsp; &nbsp; &nbsp; $buttonArray = array();   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $this-&gt;totalsum = $order-&gt;info[&#8216;total&#8217;];   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ save the session stuff permanently in case paypal loses the session   &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;ppipn_key_to_remove&#8217;] = session_id();   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_PAYPAL_SESSION . &#8221; where session_id = &#8216;&#8221; . zen_db_input($_SESSION[&#8216;ppipn_key_to_remove&#8217;]) . &#8220;&#8216;&#8221;);   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $sql = &#8220;insert into &#8221; . TABLE_PAYPAL_SESSION . &#8221; (session_id, saved_session, expiry) values (   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; . zen_db_input($_SESSION[&#8216;ppipn_key_to_remove&#8217;]) . &#8220;&#8216;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; . base64_encode(serialize($_SESSION)) . &#8220;&#8216;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; . (time() + (1*60*60*24*2)) . &#8220;&#8216;)&#8221;;   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql);   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $my_currency = select_pp_currency();   &nbsp; &nbsp; &nbsp; if(!empty($order-&gt;info[&#8216;currency&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $my_currency=$order-&gt;info[&#8216;currency&#8217;];   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; $this-&gt;transaction_currency = $my_currency;   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $this-&gt;transaction_amount = ($this-&gt;totalsum * $currencies-&gt;get_value($my_currency));   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $telephone = preg_replace(&#8216;\/\\D\/&#8217;, &#8221;, $order-&gt;customer[&#8216;telephone&#8217;]);   &nbsp; &nbsp; &nbsp; if ($telephone != &#8221;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;H_PhoneNumber&#8217;] = $telephone;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (in_array($order-&gt;customer[&#8216;country&#8217;][&#8216;iso_code_2&#8217;], array(&#8216;US&#8217;,&#8217;CA&#8217;))) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;night_phone_a&#8217;] = substr($telephone,0,3);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;night_phone_b&#8217;] = substr($telephone,3,3);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;night_phone_c&#8217;] = substr($telephone,6,4);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;day_phone_a&#8217;] = substr($telephone,0,3);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;day_phone_b&#8217;] = substr($telephone,3,3);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;day_phone_c&#8217;] = substr($telephone,6,4);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;night_phone_b&#8217;] = $telephone;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsPhone[&#8216;day_phone_b&#8217;] = $telephone;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $optionsCore = array(   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;lc&#8217; =&gt; US,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/&#8217;lc&#8217; =&gt; $order-&gt;customer[&#8216;country&#8217;][&#8216;iso_code_2&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;charset&#8217; =&gt; CHARSET,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;page_style&#8217; =&gt; MODULE_PAYMENT_PAYPAL_PAGE_STYLE,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;custom&#8217; =&gt; zen_session_name() . &#8216;=&#8217; . zen_session_id(),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;invoice&#8217; =&gt; $order-&gt;info[&#8216;num&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;business&#8217; =&gt; MODULE_PAYMENT_PAYPAL_BUSINESS_ID,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;return&#8217; =&gt; zen_href_link(FILENAME_CHECKOUT_PROCESS, &#8216;referer=paypal&#8217;, &#8216;SSL&#8217;),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;cancel_return&#8217; =&gt; zen_href_link(FILENAME_CHECKOUT_PAYMENT, &#8221;, &#8216;SSL&#8217;),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;shopping_url&#8217; =&gt; zen_href_link(FILENAME_SHOPPING_CART, &#8221;, &#8216;SSL&#8217;),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;notify_url&#8217; =&gt; zen_href_link(&#8216;ipn_main_handler.php&#8217;, &#8221;, &#8216;SSL&#8217;,false,false,true),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;redirect_cmd&#8217; =&gt; &#8216;_xclick&#8217;,&#8217;rm&#8217; =&gt; 2,&#8217;bn&#8217; =&gt; &#8216;zencart&#8217;,&#8217;mrb&#8217; =&gt; &#8216;R-6C7952342H795591R&#8217;,&#8217;pal&#8217; =&gt; &#8216;9E82WJBKKGPLQ&#8217;,   &nbsp; &nbsp; &nbsp; );   &nbsp; &nbsp; &nbsp; $optionsCust = array(   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;first_name&#8217; =&gt; replace_accents($order-&gt;customer[&#8216;firstname&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;last_name&#8217; =&gt; replace_accents($order-&gt;customer[&#8216;lastname&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;address1&#8217; =&gt; replace_accents($order-&gt;customer[&#8216;street_address&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;city&#8217; =&gt; replace_accents($order-&gt;customer[&#8216;city&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;state&#8217; =&gt; zen_get_zone_code($order-&gt;customer[&#8216;country&#8217;][&#8216;id&#8217;], $order-&gt;customer[&#8216;zone_id&#8217;], $order-&gt;customer[&#8216;state&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;zip&#8217; =&gt; $order-&gt;customer[&#8216;postcode&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;country&#8217; =&gt; $order-&gt;customer[&#8216;country&#8217;][&#8216;iso_code_2&#8242;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8217;email&#8217; =&gt; $order-&gt;customer[&#8217;email_address&#8217;],   &nbsp; &nbsp; &nbsp; );   &nbsp; &nbsp; &nbsp; \/\/ address line 2 is optional   &nbsp; &nbsp; &nbsp; if ($order-&gt;customer[&#8216;suburb&#8217;] != &#8221;) $optionsCust[&#8216;address2&#8217;] = $order-&gt;customer[&#8216;suburb&#8217;];   &nbsp; &nbsp; &nbsp; \/\/ different format for Japanese address layout:   &nbsp; &nbsp; &nbsp; if ($order-&gt;customer[&#8216;country&#8217;][&#8216;iso_code_2&#8217;] == &#8216;JP&#8217;) $optionsCust[&#8216;zip&#8217;] = substr($order-&gt;customer[&#8216;postcode&#8217;], 0, 3) . &#8216;-&#8216; . substr($order-&gt;customer[&#8216;postcode&#8217;], 3);   &nbsp; &nbsp; &nbsp; if (MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED == 2) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsCust = array(   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;first_name&#8217; =&gt; replace_accents($order-&gt;delivery[&#8216;firstname&#8217;] != &#8221; ? $order-&gt;delivery[&#8216;firstname&#8217;] : $order-&gt;billing[&#8216;firstname&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;last_name&#8217; =&gt; replace_accents($order-&gt;delivery[&#8216;lastname&#8217;] != &#8221; ? $order-&gt;delivery[&#8216;lastname&#8217;] : $order-&gt;billing[&#8216;lastname&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;address1&#8217; =&gt; replace_accents($order-&gt;delivery[&#8216;street_address&#8217;] != &#8221; ? $order-&gt;delivery[&#8216;street_address&#8217;] : $order-&gt;billing[&#8216;street_address&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;city&#8217; =&gt; replace_accents($order-&gt;delivery[&#8216;city&#8217;] != &#8221; ? $order-&gt;delivery[&#8216;city&#8217;] : $order-&gt;billing[&#8216;city&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;state&#8217; =&gt; ($order-&gt;delivery[&#8216;country&#8217;][&#8216;id&#8217;] != &#8221; ? zen_get_zone_code($order-&gt;delivery[&#8216;country&#8217;][&#8216;id&#8217;], $order-&gt;delivery[&#8216;zone_id&#8217;], $order-&gt;delivery[&#8216;state&#8217;]) : zen_get_zone_code($order-&gt;billing[&#8216;country&#8217;][&#8216;id&#8217;], $order-&gt;billing[&#8216;zone_id&#8217;], $order-&gt;billing[&#8216;state&#8217;])),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;zip&#8217; =&gt; ($order-&gt;delivery[&#8216;postcode&#8217;] != &#8221; ? $order-&gt;delivery[&#8216;postcode&#8217;] : $order-&gt;billing[&#8216;postcode&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;country&#8217; =&gt; ($order-&gt;delivery[&#8216;country&#8217;][&#8216;title&#8217;] != &#8221; ? $order-&gt;delivery[&#8216;country&#8217;][&#8216;title&#8217;] : $order-&gt;billing[&#8216;country&#8217;][&#8216;title&#8217;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;country_code&#8217; =&gt; ($order-&gt;delivery[&#8216;country&#8217;][&#8216;iso_code_2&#8217;] != &#8221; ? $order-&gt;delivery[&#8216;country&#8217;][&#8216;iso_code_2&#8217;] : $order-&gt;billing[&#8216;country&#8217;][&#8216;iso_code_2&#8242;]),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8217;email&#8217; =&gt; $order-&gt;customer[&#8217;email_address&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;delivery[&#8216;suburb&#8217;] != &#8221;) $optionsCust[&#8216;address2&#8217;] = $order-&gt;delivery[&#8216;suburb&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;delivery[&#8216;country&#8217;][&#8216;iso_code_2&#8217;] == &#8216;JP&#8217;) $optionsCust[&#8216;zip&#8217;] = substr($order-&gt;delivery[&#8216;postcode&#8217;], 0, 3) . &#8216;-&#8216; . substr($order-&gt;delivery[&#8216;postcode&#8217;], 3);   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; $optionsShip[&#8216;no_shipping&#8217;] = MODULE_PAYMENT_PAYPAL_ADDRESS_REQUIRED;   &nbsp; &nbsp; &nbsp; if (MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE == &#8216;1&#8217;) $optionsShip[&#8216;address_override&#8217;] = MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE;   &nbsp; &nbsp; &nbsp; \/\/ prepare cart contents details where possible   &nbsp; &nbsp; &nbsp; if (MODULE_PAYMENT_PAYPAL_DETAILED_CART == &#8216;Yes&#8217;) $optionsLineItems = ipn_getLineItemDetails();   &nbsp; &nbsp; &nbsp; if (sizeof($optionsLineItems) &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsLineItems[&#8216;cmd&#8217;] = &#8216;_cart&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp;$optionsLineItems[&#8216;num_cart_items&#8217;] = sizeof($order-&gt;products);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (isset($optionsLineItems[&#8216;shipping&#8217;])) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $optionsLineItems[&#8216;shipping_1&#8217;] = $optionsLineItems[&#8216;shipping&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($optionsLineItems[&#8216;shipping&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($optionsLineItems[&#8216;subtotal&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ if line-item details couldn&#8217;t be kept due to calculation mismatches or discounts etc, default to aggregate mode   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!isset($optionsLineItems[&#8216;item_name_1&#8217;]) || $optionsLineItems[&#8216;creditsExist&#8217;] == TRUE) $optionsLineItems = array();   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/if ($optionsLineItems[&#8216;amount&#8217;] != $this-&gt;transaction_amount) $optionsLineItems = array();   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ debug:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ipn_debug_email(&#8216;Line Item Details (if blank, this means there was a data mismatch or credits applied, and thus bypassed): &#8216; . &#8220;\\n&#8221; . print_r($optionsLineItems, true));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($optionsLineItems[&#8216;creditsExist&#8217;]);   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; $optionsAggregate = array(   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;cmd&#8217; =&gt; &#8216;_ext-enter&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;item_name&#8217; =&gt; MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_TITLE,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;item_number&#8217; =&gt; MODULE_PAYMENT_PAYPAL_PURCHASE_DESCRIPTION_ITEMNUM,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/&#8217;num_cart_items&#8217; =&gt; sizeof($order-&gt;products),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;amount&#8217; =&gt; number_format($this-&gt;transaction_amount, $currencies-&gt;get_decimal_places($my_currency)),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;shipping&#8217; =&gt; &#8216;0.00&#8217;,   &nbsp; &nbsp; &nbsp; );   &nbsp; &nbsp; &nbsp; if (MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE == &#8216;true&#8217;) $optionsAggregate[&#8216;tax&#8217;] = &#8216;0.00&#8217;;   &nbsp; &nbsp; &nbsp; if (MODULE_PAYMENT_PAYPAL_TAX_OVERRIDE == &#8216;true&#8217;) $optionsAggregate[&#8216;tax_cart&#8217;] = &#8216;0.00&#8217;;   &nbsp; &nbsp; &nbsp; $optionsTrans = array(   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;upload&#8217; =&gt; (int)(sizeof($order-&gt;products) &gt; 0),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;currency_code&#8217; =&gt; $my_currency,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/&#8217;paypal_order_id&#8217; =&gt; $paypal_order_id,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/&#8217;no_note&#8217; =&gt; &#8216;1&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/&#8217;invoice&#8217; =&gt; &#8221;,   &nbsp; &nbsp; &nbsp; );   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ if line-item info is invalid, use aggregate:   &nbsp; &nbsp; &nbsp; if (sizeof($optionsLineItems) &gt; 0) $optionsAggregate = $optionsLineItems;   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ prepare submission   &nbsp; &nbsp; &nbsp; $options = array_merge($optionsCore, $optionsCust, $optionsPhone, $optionsShip, $optionsTrans, $optionsAggregate);   &nbsp; &nbsp; &nbsp; \/\/ipn_debug_email(&#8216;Keys for submission: &#8216; . print_r($options, true));   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ build the button fields   &nbsp; &nbsp; &nbsp; foreach ($options as $name =&gt; $value) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ remove quotation marks   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $value = str_replace(&#8216;&#8221;&#8216;, &#8221;, $value);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ check for invalid chars   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (preg_match(&#8216;\/[^a-zA-Z_0-9]\/&#8217;, $name)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;datacheck &#8211; ABORTING &#8211; preg_match found invalid submission key: &#8216; . $name . &#8216; (&#8216; . $value . &#8216;)&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ do we need special handling for &amp; and = symbols?   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/if (strpos($value, &#8216;&amp;&#8217;) !== false || strpos($value, &#8216;=&#8217;) !== false) $value = urlencode($value);   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $buttonArray[] = zen_draw_hidden_field($name, $value);   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; $process_button_string = implode(&#8220;\\n&#8221;, $buttonArray) . &#8220;\\n&#8221;;   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;paypal_transaction_info&#8217;] = array($this-&gt;transaction_amount, $this-&gt;transaction_currency);   &nbsp; &nbsp; &nbsp; return $process_button_string;   &nbsp; }   &nbsp;   } <\/p>\n<p> &nbsp;  <\/p>\n<p> 3. \u5728\u7f51\u7ad9\u540e\u53f0 Orders Status\uff08\u5730\u7ed9\u4f60\u5355\u72b6\u6001\uff09\u4e2d\uff0c\u589e\u52a0\u4e00\u9879 Unpaid\uff08\u672a\u4ed8\u6b3e\uff09\u9009\u9879\u3002\u7136\u540e\u4fee\u6539 Order.php \u4e2d create \u65b9\u6cd5\uff0c\u6307\u5b9a\u5982\u679c\u751f\u6210\u8ba2\u5355\u7684\u65f6\u5019\uff0c\u5ba2\u6237\u9009\u62e9\u7684\u4ed8\u6b3e\u65b9\u5f0f\u662f Paypal\uff0c\u90a3\u4e48\u6b64\u8ba2\u5355\u7684\u72b6\u6001\u5c06\u4f1a\u662f Unpaid\u72b6\u6001\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<br \/> &nbsp;<\/p>\n<p>  function create($zf_ot_modules, $zf_mode = 2) {   &nbsp; &nbsp; global $db;   &nbsp; &nbsp; $t1 = date(&#8220;YmdGhs&#8221;);&nbsp;   &nbsp; &nbsp; srand ((float) microtime() * 10000000);&nbsp;   &nbsp; &nbsp; $input = array (&#8220;1&#8221;, &#8220;2&#8221;, &#8220;3&#8221;, &#8220;4&#8221;, &#8220;5&#8221;, &#8220;6&#8221;, &#8220;7&#8221;, &#8220;8&#8221;, &#8220;9&#8221;, &#8220;0&#8221;);&nbsp;   &nbsp; &nbsp; $rand_keys = array_rand ($input, 2);&nbsp;   &nbsp; &nbsp; $l1 = $input[$rand_keys[0]];&nbsp;   &nbsp; &nbsp; $l2 = $input[$rand_keys[1]];&nbsp;   &nbsp; &nbsp; $r1 = rand(0,9);&nbsp;   &nbsp; &nbsp; $ordernum = $t1.$l1.$l2.$r1;&nbsp;   &nbsp;   &nbsp; &nbsp; if ($this-&gt;info[&#8216;total&#8217;] == 0) {   &nbsp; &nbsp; &nbsp; if (DEFAULT_ZERO_BALANCE_ORDERS_STATUS_ID == 0) {   &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;info[&#8216;order_status&#8217;] = DEFAULT_ORDERS_STATUS_ID;   &nbsp; &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; if ($_SESSION[&#8216;payment&#8217;] != &#8216;freecharger&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;info[&#8216;order_status&#8217;] = DEFAULT_ZERO_BALANCE_ORDERS_STATUS_ID;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp; &nbsp; \/\/\u5728\u8fd9\u4e2a\u4f4d\u7f6e\u589e\u52a0\u4e0b\u9762\u7684\u4ee3\u7801\uff0c5\u662f\u540e\u53f0\u6dfb\u52a0\u7684Unpaid\u72b6\u6001\u7684ID\u53f7\uff0c\u4e0d\u5c3d\u76f8\u540c\uff0c\u6ce8\u610f\u67e5\u770b\u3002   &nbsp; &nbsp; if($_SESSION[&#8216;payment&#8217;] == &#8216;paypal&#8217;){   &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;info[&#8216;order_status&#8217;] = 5;   &nbsp; &nbsp; }<br \/>\n<br \/> &nbsp;  <\/p>\n<p> 4. \u5982\u679c\u662f\u901a\u8fc7Paypal\u4ed8\u6b3e\u540e\uff0c\u4ecePaypal\u8fd4\u56de\u7f51\u7ad9\u65f6\uff0c\u4f1a\u4f7f\u7528GET\u65b9\u5f0f\u5e26\u5165\u4e00\u4e9b\u6570\u636e\u5230 includes\/modules\/pages\/checkout_process\/header_php.php \u8fd9\u4e2a\u9875\u9762\uff0c\u800c\u76f4\u63a5\u751f\u6210\u8ba2\u5355\u65f6\uff0c\u5e76\u4e0d\u4f1a\u6709GET\u6570\u636e\u4f20\u8f93\uff0c\u6240\u4ee5\u901a\u8fc7 $_GET[&#8216;referer&#8217;] \u8fd9\u6761\u8fd4\u56de\u503c\u6570\u636e\uff0c\u6765\u5224\u65ad\u662f\u751f\u6210\u8ba2\u5355\uff0c\u8fd8\u662f\u4ed8\u6b3e\u5f52\u6765\u3002\u5982\u679c\u53ea\u662f\u751f\u6210\u8ba2\u5355\u7684\u8bdd\uff0c\u8df3\u8f6c\u5230 tpl_account_history_info_default \u9875\u9762\uff0c\u5982\u679c\u662f\u4ed8\u6b3e\u5f52\u6765\uff0c\u5219\u8df3\u8f6c\u5230 checkout_success \u9875\u9762\uff0c\u8fd9\u6837\u5c31\u907f\u514d\u4e86\u91cd\u590d\u751f\u6210\u8ba2\u5355\u4e86\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<br \/> &nbsp;<\/p>\n<p>  $zco_notifier-&gt;notify(&#8216;NOTIFY_HEADER_START_CHECKOUT_PROCESS&#8217;);   &nbsp;&nbsp;   &nbsp; if(isset($_GET[&#8216;referer&#8217;]) &amp;&amp; $_GET[&#8216;referer&#8217;] == &#8216;paypal&#8217;){   &nbsp; &nbsp; &nbsp; \/\/\u5982\u679c\u662f\u6765\u81eapaypal\u7684\u4ed8\u6b3e\uff0c\u5c31\u76f4\u63a5\u8df3\u8f6c\u5230\u4ed8\u6b3e\u6210\u529f\u9875\u9762   &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, (isset($_GET[&#8216;action&#8217;]) &amp;&amp; $_GET[&#8216;action&#8217;] == &#8216;confirm&#8217; ? &#8216;action=confirm&#8217; : &#8221;), &#8216;SSL&#8217;));   &nbsp; }   &nbsp; else{   &nbsp; &nbsp; &nbsp; require(DIR_WS_MODULES . zen_get_module_directory(&#8216;checkout_process.php&#8217;));   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ load the after_process function from the payment modules   &nbsp; &nbsp; &nbsp; $payment_modules-&gt;after_process();   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;cart&#8217;]-&gt;reset(true);   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ unregister session variables used during checkout   &nbsp; &nbsp; &nbsp; unset($_SESSION[&#8216;sendto&#8217;]);   &nbsp; &nbsp; &nbsp; unset($_SESSION[&#8216;billto&#8217;]);   &nbsp; &nbsp; &nbsp; unset($_SESSION[&#8216;shipping&#8217;]);   &nbsp; &nbsp; &nbsp; unset($_SESSION[&#8216;payment&#8217;]);   &nbsp; &nbsp; &nbsp; unset($_SESSION[&#8216;comments&#8217;]);   &nbsp; &nbsp; &nbsp; $order_total_modules-&gt;clear_posts();\/\/ICW ADDED FOR CREDIT CLASS SYSTEM   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ This should be before the zen_redirect:   &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_HEADER_END_CHECKOUT_PROCESS&#8217;);   &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, &#8216;order_id=&#8217;.$insert_id, &#8216;SSL&#8217;));   &nbsp; }   &nbsp;   &nbsp; require(DIR_WS_INCLUDES . &#8216;application_bottom.php&#8217;);  <\/p>\n<p> &nbsp;<\/p>\n<p> 5. \u5728 tpl_account_history_info_default \u9875\u9762\u4e2d\u663e\u793apay now\u6309\u94ae\u3002\u6253\u5f00\u6587\u4ef6&#8221;includes\/modules\/pages\/account_history_info\/header.php&#8221;\uff0c\u5728\u6587\u4ef6\u7684\u672b\u5c3e\u6dfb\u52a0\u4e0b \u9762\u7684\u4ee3\u7801\uff1a<\/p>\n<p>  require(DIR_WS_CLASSES . &#8216;order.php&#8217;);   $order = new order($_GET[&#8216;order_id&#8217;]);   &nbsp;   \/\/\u5728\u8fd9\u4e2a\u4f4d\u7f6e\u63d2\u5165\u4e0b\u9762\u4e24\u884c\u4ee3\u7801   require_once(DIR_WS_CLASSES . &#8216;payment.php&#8217;);   $payment_modules = new payment($order-&gt;info[&#8216;payment_module_code&#8217;]);<br \/>\n<br \/> &nbsp;  <\/p>\n<p> 6. \u6253\u5f00\u6587\u4ef6&#8221;includes\/templates\/template_default\/templates \/tpl_account_history_info_default.php&#8221;\uff0c\u5e76\u5728\u9002\u5f53\u7684\u4f4d\u7f6e\u52a0\u4e0a\u5982\u4e0b\u7684\u4ee3\u7801\uff0c\u8fd9\u91cc\u5bf9\u8ba2\u5355\u7684\u72b6\u6001\u8fdb\u884c\u4e86\u4e00\u4e2a\u5224\u65ad\uff0c\u5f53\u53ea\u6709\u8ba2\u5355\u7684 \u72b6\u6001\u5728\u672a\u4ed8\u6b3e\u72b6\u6001\uff0c\u624d\u663e\u793a\u8be5\u6309\u94ae\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<br \/> &nbsp;<\/p>\n<p>  &lt;?php   &nbsp; &nbsp; \/\/Unpaid\u662f\u4f60\u5728\u540e\u53f0\u6dfb\u52a0\u7684\u4e3a\u4ed8\u6b3e\u8ba2\u5355\u72b6\u6001   &nbsp; &nbsp; if(isset($payment_modules-&gt;paynow_action_url) &amp;&amp; $payment_modules-&gt;paynow_action_url != &#8221; &amp;&amp; $order-&gt;info[&#8216;orders_status&#8217;] == &#8216;Unpaid&#8217;){   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;div class=&#8221;back&#8221;&gt;&lt;strong&gt;Order has been generated&lt;\/strong&gt; &#8211; please continue to pay&lt;\/div&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; echo zen_draw_form(&#8216;checkout_paynow&#8217;, $payment_modules-&gt;paynow_action_url, &#8216;post&#8217;, &#8216;id=&#8221;checkout_confirmation&#8221; onsubmit=&#8221;submitonce();&#8221; class=&#8221;right&#8221;&#8216;);   &nbsp; &nbsp; &nbsp; &nbsp; echo(&#8216;&lt;div&gt;&#8217;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; if (is_array($payment_modules-&gt;modules)) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $payment_modules-&gt;paynow_button($_GET[&#8216;order_id&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; echo zen_image_submit(&#8220;button_buy_now.gif&#8221;, &#8220;Pay now this order&#8221;,&#8221;name=&#8217;submit'&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; \/\/echo &#8216;&lt;input type=&#8221;image&#8221; src=&#8221;https:\/\/www.sandbox.paypal.com\/en_US\/i\/btn\/btn_buynow_LG.gif&#8221; border=&#8221;0&#8243; name=&#8221;submit&#8221; alt=&#8221;PayPal\u2014\u2014\u6700\u5b89\u5168\u4fbf\u6377\u7684\u5728\u7ebf\u652f\u4ed8\u65b9\u5f0f\uff01&#8221;&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; echo (&#8216;&lt;\/div&gt;&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; echo (&#8216;&lt;\/form&gt;&#8217;);   &nbsp; &nbsp; }   ?&gt;  <\/p>\n<p> &nbsp;<\/p>\n<p> 7. \u4fee\u6539 tpl_account_history_default.php \u9875\u9762\uff0c\u5224\u65ad\u662f\u5426\u4e3a\u672a\u4ed8\u6b3e\u8ba2\u5355\uff0c\u5982\u679c\u662f\uff0c\u5219\u589e\u52a0\u4e00\u4e2a pay_now \u6309\u94ae\uff0c\u7136\u540e\u8df3\u8f6c\u5230 tpl_account_history_info_default.php \u9875\u9762\u8fdb\u884c\u4ed8\u6b3e\uff0c\u5176\u5b9e\u8ddf view \u6309\u94ae\u662f\u4e00\u6837\u7684\uff0c\u53ea\u4e0d\u8fc7\u6362\u4e86\u4e00\u4e2a\u540d\u79f0\uff0c\u6807\u660e\u662f\u672a\u4ed8\u6b3e\u8ba2\u5355\u800c\u5df2\u3002<\/p>\n<p> 8. \u6700\u5173\u952e\u7684\u5730\u65b9\u6765\u4e86\uff0c\u5c31\u662f ipn_main_handler.php \u8fd9\u4e2a\u6587\u4ef6\u3002Paypal \u4ed8\u6b3e\u63a5\u53e3\u8fd4\u56de\u6570\u636e\u65b9\u5f0f\u6709\u4e24\u79cd\uff0c\u4e00\u79cd\u662fPDT\uff0c\u4e00\u79cd\u662fIPN\uff0cPDT\u662f\u540c\u6b65\u4f20\u8f93\uff0c\u4ed8\u6b3e\u6570\u636e\u4f1a\u7acb\u5373\u8fd4\u56de\u5230\u7f51\u7ad9\uff0c\u5e76\u4e14\u662f\u4e00\u6b21\u6027\u7684\u3002IPN\u5219\u662f\u5f02\u6b65\u4f20\u8f93\uff0c\u800c\u4e14\u5982\u679c\u7f51\u7ad9\u6ca1\u6709\u6536\u5230\u6570\u636e\uff0cIPN\u8fd8\u4f1a\u518d\u6b21\u5faa\u73af\u7684\u53d1\u9001\u4ed8\u6b3e\u4fe1\u606f\u5230\u4f60\u7684\u7f51\u7ad9 ipn_main_handler.php \u6587\u4ef6\u8fdb\u884c\u5904\u7406\u5e76\u5199\u5165\u6570\u636e\u5e93\u3002\u6700\u7ec8\u6211\u4eec\u5728\u5ba2\u6237\u8ba2\u5355\u4e2d\uff0c\u5c31\u80fd\u770b\u5230\u5ba2\u6237\u7684Paypal\u4ed8\u6b3e\u4fe1\u606f\uff0c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p> <img decoding=\"async\" src=\"https:\/\/www.ldhost.cn\/helphmb\/uploads\/allimg\/150714\/2329444336-16.png\" class=\"aligncenter\" title=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe5\" alt=\"\u5b9e\u73b0Zencart\u8ba2\u5355\u7c7b\u4f3c\u6dd8\u5b9d\u540e\u53f0\u4fee\u6539\u8ba2\u5355\u4ef7\u683c\u529f\u80fd\u63d2\u56fe5\" \/><\/p>\n<p> \u4e4b\u524d\u7684\u4ed8\u6b3e\u6d41\u7a0b\u4e2d\uff0cPaypal \u4ed8\u6b3e\u6570\u636e\u662f\u901a\u8fc7 PDT \u65b9\u5f0f\u4f20\u8f93\uff0c\u4fee\u6539\u4e86\u4ed8\u6b3e\u6d41\u7a0b\u4e4b\u540e\uff0c\u6211\u4eec\u4e0d\u80fd\u901a\u8fc7 PDT \u65b9\u5f0f\uff0c\u53ea\u80fd\u901a\u8fc7 IPN \u65b9\u5f0f\u4f20\u8f93\u3002ipn_main_handler.php \u6587\u4ef6\u5c31\u662f\u5904\u7406 IPN \u6570\u636e\u4f20\u8f93\u65b9\u5f0f\u7684\u6587\u4ef6\u3002\u4e0d\u8fc7\uff0c\u5f53 ipn_main_handler.php \u63a5\u6536\u5230 Paypal \u4ed8\u6b3e\u6570\u636e\u540e\uff0c\u4f1a\u6839\u636e Paypal \u4ed8\u6b3e\u6570\u636e\u751f\u6210\u4e00\u4e2a\u8ba2\u5355\uff0c\u4f46\u662f\u6211\u4eec\u5df2\u7ecf\u6709\u4e86\u8ba2\u5355\uff0c\u53ea\u9700\u8981\u628a Paypal \u4ed8\u6b3e\u4fe1\u606f\u5199\u5165\u5230\u6570\u636e\u5e93\u4e2d\uff0c\u4e0e\u8ba2\u5355\u5bf9\u5e94\u5373\u53ef\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u4fee\u6539&nbsp; ipn_main_handler.php \u6587\u4ef6\u3002PDT\u548cIPN\u8be6\u7ec6\u4ecb\u7ecd\u94fe\u63a5\uff1ahttp:\/\/wenku.baidu.com\/link?url=xI4DZL8mg9R54aJKfn3zNyP9_yFHkHVvxWltEuAZ9-DXXAS3K3z-z6srRlh_P-EmMXYU-U6oQ_uEwNze7An9PBAUgnPMH-b_iF3d2z7LE_G<\/p>\n<p> \u9996\u5148\uff0c\u6211\u4eec\u8981\u786e\u5b9a\uff0c\u901a\u8fc7 IPN \u65b9\u5f0f\u8fd4\u56de\u7684 Paypal \u4ed8\u6b3e\u4fe1\u606f\u662f\u5c5e\u4e8e\u54ea\u4e2a\u8ba2\u5355\u7684\uff0c\u6211\u5728 paypal.php \u6587\u4ef6\u4e2d\u7b2c 470 \u884c\u589e\u52a0\u4e86 &#8216;invoice&#8217; =&gt; $order-&gt;info[&#8216;id&#8217;]\uff0c\u4f5c\u7528\u5c31\u662f\u5728\u4ed8\u6b3e\u7684\u65f6\u5019\uff0c\u628a\u8fd9\u4e2a\u4fe1\u606f\u53d1\u9001\u7ed9Paypal\uff0c\u4ed8\u6b3e\u6210\u529f\u540e\uff0cPaypal\u4e5f\u4f1a\u901a\u8fc7IPN\u8fd4\u56de\u8fd9\u6761\u4fe1\u606f\u5230 ipn_main_handler.php\u3002\u6839\u636e\u8fd9\u4e2a\u5224\u65ad\uff0c\u5982\u679c\u63a5\u6536\u5230\u4e86 invoice \u6570\u636e\uff0c\u5219\u8df3\u8fc7\u751f\u6210\u8ba2\u5355\u7684\u6b65\u9aa4\uff0c\u53ea\u5199\u5165Paypal\u4ed8\u6b3e\u4fe1\u606f\u5373\u53ef\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<br \/> &nbsp;<\/p>\n<p>  &lt;?php   \/**   &nbsp;* ipn_main_handler.php callback handler for PayPal IPN notifications   &nbsp;*   &nbsp;* @package paymentMethod   &nbsp;* @copyright Copyright 2003-2010 Zen Cart Development Team   &nbsp;* @copyright Portions Copyright 2003 osCommerce   &nbsp;* @license http:\/\/www.zen-cart.com\/license\/2_0.txt GNU Public License V2.0   &nbsp;* @version $Id: ipn_main_handler.php 18014 2010-10-22 03:39:17Z drbyte $   &nbsp;*\/   if (!defined(&#8216;TEXT_RESELECT_SHIPPING&#8217;)) define(&#8216;TEXT_RESELECT_SHIPPING&#8217;, &#8216;You have changed the items in your cart since shipping was last calculated, and costs may have changed. Please verify\/re-select your shipping method.&#8217;);   &nbsp;   \/**   &nbsp;* handle Express Checkout processing:   &nbsp;*\/   if (isset($_GET[&#8216;type&#8217;]) &amp;&amp; $_GET[&#8216;type&#8217;] == &#8216;ec&#8217;) {   &nbsp; \/\/ this is an EC handler request   &nbsp; require(&#8216;includes\/application_top.php&#8217;);   &nbsp;   \/\/ Validate Cart for checkout   &nbsp; $_SESSION[&#8216;valid_to_checkout&#8217;] = true;   &nbsp; $_SESSION[&#8216;cart&#8217;]-&gt;get_products(true);   &nbsp; if ($_SESSION[&#8216;valid_to_checkout&#8217;] == false || $_SESSION[&#8216;cart&#8217;]-&gt;count_contents() &lt;= 0) {   &nbsp; &nbsp; $messageStack-&gt;add_session(&#8216;shopping_cart&#8217;, ERROR_CART_UPDATE, &#8216;error&#8217;);   &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));   &nbsp; }   &nbsp;   &nbsp; \/\/ Stock Check to prevent checkout if cart contents rules violations exist   &nbsp; if ( STOCK_CHECK == &#8216;true&#8217; &amp;&amp; STOCK_ALLOW_CHECKOUT != &#8216;true&#8217; &amp;&amp; isset($_SESSION[&#8216;cart&#8217;]) ) {   &nbsp; &nbsp; $products = $_SESSION[&#8216;cart&#8217;]-&gt;get_products();   &nbsp; &nbsp; for ($i=0, $n=sizeof($products); $i&lt;$n; $i++) {   &nbsp; &nbsp; &nbsp; if (zen_check_stock($products[$i][&#8216;id&#8217;], $products[$i][&#8216;quantity&#8217;])) {   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp; }   &nbsp; \/\/ if cart contents has changed since last pass, reset   &nbsp; if (isset($_SESSION[&#8216;cart&#8217;]-&gt;cartID)) {   &nbsp; &nbsp; if (isset($_SESSION[&#8216;cartID&#8217;])) { &nbsp;\/\/ This will only be set if customer has been to the checkout_shipping page. Will *not* be set if starting via EC Shortcut button, so don&#8217;t want to redirect in that case.   &nbsp; &nbsp; &nbsp; if ($_SESSION[&#8216;cart&#8217;]-&gt;cartID != $_SESSION[&#8216;cartID&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; if (isset($_SESSION[&#8216;shipping&#8217;])) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($_SESSION[&#8216;shipping&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(&#8216;checkout_shipping&#8217;, TEXT_RESELECT_SHIPPING, &#8216;error&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, &#8221;, &#8216;SSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   \/\/ &nbsp;} else {   \/\/ &nbsp; &nbsp;zen_redirect(zen_href_link(FILENAME_TIME_OUT));   &nbsp; }   &nbsp;   &nbsp; require(DIR_WS_CLASSES . &#8216;payment.php&#8217;);   &nbsp; \/\/ See if we were sent a request to clear the session for PayPal.   &nbsp; if (isset($_GET[&#8216;clearSess&#8217;]) || isset($_GET[&#8216;amp;clearSess&#8217;]) || isset($_GET[&#8216;ec_cancel&#8217;]) || isset($_GET[&#8216;amp;ec_cancel&#8217;])) {   &nbsp; &nbsp; \/\/ Unset the PayPal EC information.   &nbsp; &nbsp; unset($_SESSION[&#8216;paypal_ec_temp&#8217;]);   &nbsp; &nbsp; unset($_SESSION[&#8216;paypal_ec_token&#8217;]);   &nbsp; &nbsp; unset($_SESSION[&#8216;paypal_ec_payer_id&#8217;]);   &nbsp; &nbsp; unset($_SESSION[&#8216;paypal_ec_payer_info&#8217;]);   &nbsp; }   &nbsp; \/\/ See if the paypalwpp module is enabled.   &nbsp; if (defined(&#8216;MODULE_PAYMENT_PAYPALWPP_STATUS&#8217;) &amp;&amp; MODULE_PAYMENT_PAYPALWPP_STATUS == &#8216;True&#8217;) {   &nbsp; &nbsp; $paypalwpp_module = &#8216;paypalwpp&#8217;;   &nbsp; &nbsp; \/\/ init the payment object   &nbsp; &nbsp; $payment_modules = new payment($paypalwpp_module);   &nbsp; &nbsp; \/\/ set the payment, if they&#8217;re hitting us here then we know   &nbsp; &nbsp; \/\/ the payment method selected right now.   &nbsp; &nbsp; $_SESSION[&#8216;payment&#8217;] = $paypalwpp_module;   &nbsp; &nbsp; \/\/ check to see if we have a token sent back from PayPal.   &nbsp; &nbsp; if (!isset($_SESSION[&#8216;paypal_ec_token&#8217;]) || empty($_SESSION[&#8216;paypal_ec_token&#8217;])) {   &nbsp; &nbsp; &nbsp; \/\/ We have not gone to PayPal&#8217;s website yet in order to grab   &nbsp; &nbsp; &nbsp; \/\/ a token at this time. &nbsp;This will send the customer over to PayPal&#8217;s   &nbsp; &nbsp; &nbsp; \/\/ website to login and return a token   &nbsp; &nbsp; &nbsp; $$paypalwpp_module-&gt;ec_step1();   &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; \/\/ This will push on the second step of the paypal ec payment   &nbsp; &nbsp; &nbsp; \/\/ module, as we already have a PayPal express checkout token   &nbsp; &nbsp; &nbsp; \/\/ at this point.   &nbsp; &nbsp; &nbsp; $$paypalwpp_module-&gt;ec_step2();   &nbsp; &nbsp; }   &nbsp; }   ?&gt;   &lt;html&gt;   Processing&#8230;   &lt;\/html&gt;   &nbsp; &lt;?php   &nbsp;   &nbsp; \/**   &nbsp; &nbsp;* If we got here, we are an IPN transaction (not Express Checkout):   &nbsp; &nbsp;*\/   &nbsp;   } else {   &nbsp; \/**   &nbsp; &nbsp;* detect odd cases of extra-url-encoded POST data coming back from PayPal   &nbsp; &nbsp;*\/   &nbsp; foreach(array(&#8216;receiver_email&#8217;, &#8216;payer_email&#8217;, &#8216;business&#8217;, &#8216;txn_type&#8217;, &#8216;transaction_subject&#8217;, &#8216;custom&#8217;, &#8216;payment_date&#8217;, &#8216;item_number&#8217;, &#8216;item_name&#8217;, &#8216;first_name&#8217;, &#8216;last_name&#8217;) as $key) {   &nbsp; &nbsp; if (isset($_POST[$key]) &amp;&amp; strstr($_POST[$key], &#8216;%&#8217;)) {   &nbsp; &nbsp; &nbsp; $_POST[$key] = urldecode($_POST[$key]);   &nbsp; &nbsp; }   &nbsp; }   &nbsp; \/**   &nbsp; &nbsp;* detect type of transaction   &nbsp; &nbsp;*\/   &nbsp; $isECtransaction = ((isset($_POST[&#8216;txn_type&#8217;]) &amp;&amp; $_POST[&#8216;txn_type&#8217;]==&#8217;express_checkout&#8217;) || (isset($_POST[&#8216;custom&#8217;]) &amp;&amp; in_array(substr($_POST[&#8216;custom&#8217;], 0, 3), array(&#8216;EC-&#8216;, &#8216;DP-&#8216;, &#8216;WPP&#8217;)))); \/*|| $_POST[&#8216;txn_type&#8217;]==&#8217;cart&#8217;*\/   &nbsp; $isDPtransaction = (isset($_POST[&#8216;custom&#8217;]) &amp;&amp; in_array(substr($_POST[&#8216;custom&#8217;], 0, 3), array(&#8216;DP-&#8216;, &#8216;WPP&#8217;)));   &nbsp; \/**   &nbsp; &nbsp;* set paypal-specific application_top parameters   &nbsp; &nbsp;*\/   &nbsp; $current_page_base = &#8216;paypalipn&#8217;;   &nbsp; $loaderPrefix = &#8216;paypal_ipn&#8217;;   &nbsp; $show_all_errors = FALSE;   &nbsp; require(&#8216;includes\/application_top.php&#8217;);   &nbsp;   &nbsp; $extraDebug = (defined(&#8216;IPN_EXTRA_DEBUG_DETAILS&#8217;) &amp;&amp; IPN_EXTRA_DEBUG_DETAILS == &#8216;All&#8217;);   &nbsp;   &nbsp; if ( &nbsp;(defined(&#8216;MODULE_PAYMENT_PAYPALWPP_DEBUGGING&#8217;) &amp;&amp; strstr(MODULE_PAYMENT_PAYPALWPP_DEBUGGING, &#8216;Log&#8217;)) ||   &nbsp; &nbsp; &nbsp; (defined(&#8216;MODULE_PAYMENT_PAYPAL_IPN_DEBUG&#8217;) &amp;&amp; strstr(MODULE_PAYMENT_PAYPAL_IPN_DEBUG, &#8216;Log&#8217;)) ||   &nbsp; &nbsp; &nbsp; ($_REQUEST[&#8216;ppdebug&#8217;] == &#8216;on&#8217; &amp;&amp; strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER[&#8216;REMOTE_ADDR&#8217;])) || $extraDebug &nbsp;) {   &nbsp; &nbsp; $show_all_errors = true;   &nbsp; &nbsp; $debug_logfile_path = ipn_debug_email(&#8216;Breakpoint: 0 &#8211; Initializing debugging.&#8217;);   &nbsp; &nbsp; if ($debug_logfile_path == &#8221;) $debug_logfile_path = &#8216;includes\/modules\/payment\/paypal\/logs\/ipn_debug_php_errors-&#8216;.time().&#8217;.log&#8217;;   &nbsp; &nbsp; @ini_set(&#8216;log_errors&#8217;, 1);   &nbsp; &nbsp; @ini_set(&#8216;log_errors_max_len&#8217;, 0);   &nbsp; &nbsp; @ini_set(&#8216;display_errors&#8217;, 0); \/\/ do not output errors to screen\/browser\/client (only to log file)   &nbsp; &nbsp; @ini_set(&#8216;error_log&#8217;, DIR_FS_CATALOG . $debug_logfile_path);   &nbsp; &nbsp; error_reporting(version_compare(PHP_VERSION, 5.3, &#8216;&gt;=&#8217;) ? E_ALL &amp; ~E_DEPRECATED &amp; ~E_NOTICE : version_compare(PHP_VERSION, 6.0, &#8216;&gt;=&#8217;) ? E_ALL &amp; ~E_DEPRECATED &amp; ~E_NOTICE &amp; ~E_STRICT : E_ALL &amp; ~E_NOTICE);   &nbsp; }   &nbsp;   &nbsp; ipn_debug_email(&#8216;Breakpoint: Flag Status:&#8217; . &#8220;\\nisECtransaction = &#8221; . (int)$isECtransaction . &#8220;\\nisDPtransaction = &#8221; . (int)$isDPtransaction);   &nbsp; \/**   &nbsp; &nbsp;* do confirmation post-back to PayPal and extract the results for subsequent use   &nbsp; &nbsp;*\/   &nbsp; $info &nbsp;= ipn_postback();   &nbsp; $new_status = 1;   &nbsp; ipn_debug_email(&#8216;Breakpoint: 1 &#8211; Collected data from PayPal notification&#8217;);   &nbsp;   &nbsp; \/**   &nbsp; &nbsp;* validate transaction &#8212; email address, matching txn record, etc   &nbsp; &nbsp;*\/   &nbsp; if (!ipn_validate_transaction($info, $_POST, &#8216;IPN&#8217;) === true) {   &nbsp; &nbsp; if (!$isECtransaction &amp;&amp; $_POST[&#8216;txn_type&#8217;] != &#8221;) {   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN FATAL ERROR :: Transaction did not validate. ABORTED.&#8217;);   &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; }   &nbsp; }   &nbsp;   &nbsp; if ($isDPtransaction) {   &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: This is a Website Payments Pro transaction. &nbsp;The rest of this log file is INFORMATION ONLY, and is not used for real processing.&#8217;);   &nbsp; }   &nbsp;   &nbsp; ipn_debug_email(&#8216;Breakpoint: 2 &#8211; Validated transaction components&#8217;);   &nbsp; if ($_POST [&#8216;exchange_rate&#8217;] == &#8221;) &nbsp;$_POST [exchange_rate] = 1;   &nbsp; if ($_POST [&#8216;num_cart_items&#8217;] == &#8221;) $_POST [num_cart_items] = 1;   &nbsp; if ($_POST [&#8216;settle_amount&#8217;] == &#8221;) &nbsp;$_POST [settle_amount] = 0;   &nbsp;   &nbsp; \/**   &nbsp; &nbsp;* is this a sandbox transaction?   &nbsp; &nbsp;*\/   &nbsp; if (isset($_POST[&#8216;test_ipn&#8217;]) &amp;&amp; $_POST[&#8216;test_ipn&#8217;] == 1) {   &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Processing SANDBOX transaction.&#8217;);   &nbsp; }   &nbsp; if (isset($_POST[&#8216;test_internal&#8217;]) &amp;&amp; $_POST[&#8216;test_internal&#8217;] == 1) {   &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Processing INTERNAL TESTING transaction.&#8217;);   &nbsp; }   &nbsp; if (isset($_POST[&#8216;pending_reason&#8217;]) &amp;&amp; $_POST[&#8216;pending_reason&#8217;] == &#8216;unilateral&#8217;) {   &nbsp; &nbsp; ipn_debug_email(&#8216;*** NOTE: TRANSACTION IS IN *unilateral* STATUS, pending creation of a PayPal account for this receiver_email address.&#8217; . &#8220;\\n&#8221; . &#8216;Please create the account, or make sure the PayPal account is *Verified*.&#8217;);   &nbsp; }   &nbsp;   &nbsp; ipn_debug_email(&#8216;Breakpoint: 3 &#8211; Communication method verified&#8217;);   &nbsp; \/**   &nbsp; &nbsp;* Lookup transaction history information in preparation for matching and relevant updates   &nbsp; &nbsp;*\/   &nbsp; $lookupData &nbsp;= ipn_lookup_transaction($_POST);   &nbsp; $ordersID &nbsp; &nbsp;= $lookupData[&#8216;order_id&#8217;];   &nbsp; $paypalipnID = $lookupData[&#8216;paypal_ipn_id&#8217;];   &nbsp; $txn_type &nbsp; &nbsp;= $lookupData[&#8216;txn_type&#8217;];   &nbsp; $parentLookup = $txn_type;   &nbsp;   &nbsp; ipn_debug_email(&#8216;Breakpoint: 4 &#8211; &#8216; . &#8216;Details: &nbsp;txn_type=&#8217; . $txn_type . &#8216; &nbsp; &nbsp;ordersID = &#8216;. $ordersID . &#8216; &nbsp;IPN_id=&#8217; . $paypalipnID . &#8220;\\n\\n&#8221; . &#8216; &nbsp; Relevant data from POST:&#8217; . &#8220;\\n &nbsp; &nbsp; &#8221; . &#8216;txn_type = &#8216; . $txn_type . &#8220;\\n &nbsp; &nbsp; &#8221; . &#8216;parent_txn_id = &#8216; . ($_POST[&#8216;parent_txn_id&#8217;] ==&#8221; ? &#8216;None&#8217; : $_POST[&#8216;parent_txn_id&#8217;]) . &#8220;\\n &nbsp; &nbsp; &#8221; . &#8216;txn_id = &#8216; . $_POST[&#8216;txn_id&#8217;]);   &nbsp;   &nbsp; if (!$isECtransaction &amp;&amp; !isset($_POST[&#8216;parent_txn_id&#8217;]) &amp;&amp; $txn_type != &#8216;cleared-echeck&#8217;) {   &nbsp; &nbsp; if (defined(&#8216;MODULE_PAYMENT_PAYPAL_PDTTOKEN&#8217;) &amp;&amp; MODULE_PAYMENT_PAYPAL_PDTTOKEN != &#8221;) {   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: IPN pausing: waiting for PDT to process. Sleeping 10 seconds &#8230;&#8217;);   &nbsp; &nbsp; &nbsp; sleep(10);   &nbsp; &nbsp; }   &nbsp; &nbsp; if (ipn_get_stored_session($session_stuff) === false) {   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN ERROR :: No pending Website Payments Standard session data available. &nbsp;Might be a duplicate transaction already entered via PDT.&#8217;);   &nbsp; &nbsp; &nbsp; $ipnFoundSession = false;   &nbsp; &nbsp; }   &nbsp; }   &nbsp;   &nbsp; if ($ipnFoundSession == FALSE &amp;&amp; !$isECtransaction &amp;&amp; !$isDPtransaction &amp;&amp; $txn_type != &#8216;cleared-echeck&#8217;) {   &nbsp; &nbsp; ipn_debug_email(&#8216;NOTICE: IPN Processing Aborted due to missing matching transaction data, as per earlier debug message. Perhaps this transaction was already entered via PDT? Thus there is no need to process this incoming IPN notification.&#8217;);   &nbsp; &nbsp; die();   &nbsp; }   &nbsp;   &nbsp; \/\/ this is used to determine whether a record needs insertion. ie: original echeck notice failed, but now we have cleared, so need parent record established:   &nbsp; $new_record_needed = ($txn_type == &#8216;unique&#8217; ? true : false);   &nbsp; \/**   &nbsp; &nbsp;* evaluate what type of transaction we&#8217;re processing   &nbsp; &nbsp;*\/   &nbsp; $txn_type = ipn_determine_txn_type($_POST, $txn_type);   &nbsp; ipn_debug_email(&#8216;Breakpoint: 5 &#8211; Transaction type (txn_type) = &#8216; . $txn_type . &#8216; &nbsp; [parentLookup=&#8217;.$parentLookup.&#8217;]&#8217;);   &nbsp;   &nbsp; if ($_POST[&#8216;payment_type&#8217;] == &#8216;instant&#8217; &amp;&amp; $isDPtransaction &amp;&amp; ((isset($_POST[&#8216;auth_status&#8217;]) &amp;&amp; $_POST[&#8216;auth_status&#8217;] == &#8216;Completed&#8217;) || $_POST[&#8216;payment_status&#8217;] == &#8216;Completed&#8217;)) {   &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: DP\/Website Payments Pro notice &#8212; IPN Ignored&#8217;);   &nbsp; &nbsp; die();   &nbsp; }   &nbsp;   &nbsp; \/**   &nbsp; &nbsp;* take action based on transaction type and corresponding requirements   &nbsp; &nbsp;*\/   &nbsp; switch ($txn_type) {   &nbsp; &nbsp; case ($_POST[&#8216;txn_type&#8217;] == &#8216;send_money&#8217;):   &nbsp; &nbsp; case ($_POST[&#8216;txn_type&#8217;] == &#8216;merch_payment&#8217;):   &nbsp; &nbsp; case ($_POST[&#8216;txn_type&#8217;] == &#8216;new_case&#8217;):   &nbsp; &nbsp; case ($_POST[&#8216;txn_type&#8217;] == &#8216;masspay&#8217;):   &nbsp; &nbsp; &nbsp; \/\/ these types are irrelevant to ZC transactions   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Transaction txn_type not relevant to Zen Cart processing. IPN handler aborted.&#8217; . $_POST[&#8216;txn_type&#8217;]);   &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; case (substr($_POST[&#8216;txn_type&#8217;],0,7) == &#8216;subscr_&#8217;):   &nbsp; &nbsp; &nbsp; \/\/ For now we filter out subscription payments   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Subscription payment &#8211; Not currently supported by Zen Cart. IPN handler aborted.&#8217;);   &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; &nbsp; break;   &nbsp;   &nbsp; &nbsp; case &#8216;pending-unilateral&#8217;:   &nbsp; &nbsp; &nbsp; \/\/ cannot process this order because the merchant&#8217;s PayPal account isn&#8217;t valid yet   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Please create a valid PayPal account and follow the steps to *Verify* it. IPN handler aborted.&#8217;);   &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; case &#8216;pending-address&#8217;:   &nbsp; &nbsp; case &#8216;pending-intl&#8217;:   &nbsp; &nbsp; case &#8216;pending-multicurrency&#8217;:   &nbsp; &nbsp; case &#8216;pending-verify&#8217;:   &nbsp; &nbsp; &nbsp; if (!$isECtransaction) {   &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: &#8216;.$txn_type.&#8217; transaction &#8212; inserting initial record for reference purposes&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_array($ordersID, $txn_type);   &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_history_array($paypalipnID);   &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL_PAYMENT_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; case (($txn_type == &#8216;express_checkout&#8217; || $isECtransaction) &amp;&amp; !strstr($txn_type, &#8216;cleared&#8217;) &amp;&amp; $parentLookup != &#8216;parent&#8217;):   &nbsp; &nbsp; &nbsp; if ($_POST[&#8216;payment_status&#8217;] == &#8216;Completed&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; \/\/ This is an express-checkout transaction &#8212; IPN may not be needed   &nbsp; &nbsp; &nbsp; &nbsp; if (isset($_POST[&#8216;auth_status&#8217;]) &amp;&amp; $_POST[&#8216;auth_status&#8217;] == &#8216;Completed&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Express Checkout payment notice on completed order &#8212; IPN Ignored&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; if ($_POST[&#8216;payment_type&#8217;] == &#8216;instant&#8217; &amp;&amp; isset($_POST[&#8216;auth_status&#8217;]) &amp;&amp; $_POST[&#8216;auth_status&#8217;] == &#8216;Pending&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: EC\/DP notice on pre-auth order &#8212; IPN Ignored&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5 &#8211; midstream checkpoint&#8217;);   &nbsp; &nbsp; &nbsp; if (!(substr($txn_type,0,8) == &#8216;pending-&#8216; &amp;&amp; (int)$ordersID &lt;= 0) &amp;&amp; !($new_record_needed &amp;&amp; $txn_type == &#8216;echeck-cleared&#8217;) &amp;&amp; $txn_type != &#8216;unique&#8217; &amp;&amp; $txn_type != &#8216;echeck-denied&#8217; &amp;&amp; $txn_type != &#8216;voided&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5 &#8211; Record does not need to be processed since it is not new and is not an update. See earlier notices. Processing aborted.&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; case ($txn_type == &#8216;cart&#8217;):   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: This is a detailed-cart transaction&#8217;);   &nbsp;   &nbsp; &nbsp; case ($txn_type == &#8216;cart&#8217; &amp;&amp; !$isECtransaction):   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: This is a detailed-cart transaction (i)&#8217;);   &nbsp;   &nbsp; &nbsp; case (substr($txn_type,0,8) == &#8216;pending-&#8216; &amp;&amp; (int)$ordersID &lt;= 0):   &nbsp; &nbsp; case ($new_record_needed &amp;&amp; $txn_type == &#8216;echeck-cleared&#8217;):   &nbsp; &nbsp; case &#8216;unique&#8217;:   &nbsp; &nbsp; &nbsp; \/**   &nbsp; &nbsp; &nbsp; &nbsp;* delete IPN session from PayPal table &#8212; housekeeping   &nbsp; &nbsp; &nbsp; &nbsp;*\/   &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_PAYPAL_SESSION . &#8221; where session_id = &#8216;&#8221; . zen_db_input(str_replace(&#8216;zenid=&#8217;, &#8221;, $_POST[&#8216;custom&#8217;])) . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; \/**   &nbsp; &nbsp; &nbsp; &nbsp;* require shipping class   &nbsp; &nbsp; &nbsp; &nbsp;*\/   &nbsp; &nbsp; &nbsp; require(DIR_WS_CLASSES . &#8216;shipping.php&#8217;);   &nbsp; &nbsp; &nbsp; \/**   &nbsp; &nbsp; &nbsp; &nbsp;* require payment class   &nbsp; &nbsp; &nbsp; &nbsp;*\/   &nbsp; &nbsp; &nbsp; require(DIR_WS_CLASSES . &#8216;payment.php&#8217;);   &nbsp; &nbsp; &nbsp; $payment_modules = new payment($_SESSION[&#8216;payment&#8217;]);   &nbsp; &nbsp; &nbsp; $shipping_modules = new shipping($_SESSION[&#8216;shipping&#8217;]);   &nbsp; &nbsp; &nbsp; \/**   &nbsp; &nbsp; &nbsp; &nbsp;* require order class   &nbsp; &nbsp; &nbsp; &nbsp;*\/   &nbsp; &nbsp; &nbsp; \/\/\u8fd9\u91cc\u5224\u65ad\u662f\u5426\u83b7\u53d6\u5230\u4e86invoice\u4fe1\u606f\uff0c\u5982\u679c\u83b7\u53d6\u5230\uff0c\u5219\u63d0\u53d6\u6b64\u8ba2\u5355\u7684\u4fe1\u606f\u3002   &nbsp; &nbsp; &nbsp; require(DIR_WS_CLASSES . &#8216;order.php&#8217;);   &nbsp; &nbsp; &nbsp; if(isset($_POST[&#8216;invoice&#8217;]) &amp;&amp; $_POST[&#8216;invoice&#8217;] != &#8221;){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order = new order($_POST[&#8216;invoice&#8217;]);   &nbsp; &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order = new order();   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; \/**   &nbsp; &nbsp; &nbsp; &nbsp;* require order_total class   &nbsp; &nbsp; &nbsp; &nbsp;*\/   &nbsp; &nbsp; &nbsp; require(DIR_WS_CLASSES . &#8216;order_total.php&#8217;);   &nbsp; &nbsp; &nbsp; $order_total_modules = new order_total();   &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_BEFORE_ORDER_TOTALS_PROCESS&#8217;);   &nbsp; &nbsp; &nbsp; $order_totals = $order_total_modules-&gt;process();   &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_TOTALS_PROCESS&#8217;);   &nbsp;   &nbsp; &nbsp; &nbsp; if (valid_payment($order-&gt;info[&#8216;total&#8217;], $_SESSION[&#8216;currency&#8217;]) === false &amp;&amp; !$isECtransaction &amp;&amp; !$isDPtransaction) {   &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Failed because of currency mismatch.&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u9700\u8981\u6ce8\u610f\u6b64\u5904\uff0c\u8fd9\u91cc\u7684\u4ed8\u6b3e\u8d27\u5e01\u5339\u914d\u68c0\u67e5\uff0c\u56e0\u4e3a\u5728\u53d1\u9001\u4ed8\u6b3e\u6570\u636e\u5230paypal\u65f6\uff0c\u6211\u4eec\u5c31\u6839\u636e\u987e\u5ba2\u7684\u8ba2\u5355\u8d27\u5e01\u65b9\u5f0f\u505a\u51fa\u4e86\u8bbe\u5b9a\u3002   &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u5e76\u4e14\u5ba2\u6237\u66f4\u6539\u5f53\u524d\u9ed8\u8ba4\u8d27\u5e01\u4e5f\u4e0d\u80fd\u6539\u53d8\u4ee5\u751f\u6210\u7684\u8ba2\u5355\u7684\u8d27\u5e01\u79cd\u7c7b\uff0c\u6240\u4ee5\u8fd9\u91cc\u7684\u5224\u65ad\u53ef\u4ee5\u53d6\u6d88\uff0c\u4e0d\u7136\u6b7b\u5728\u8fd9\u91cc\u3002   &nbsp; &nbsp; &nbsp; &nbsp; \/\/die();   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; if ($ipnFoundSession === false &amp;&amp; !$isECtransaction &amp;&amp; !$isDPtransaction) {   &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Unique but no session &#8211; Assumed to be a personal payment, rather than a new Website Payments Standard transaction. Ignoring.&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; die();   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; if (!strstr($txn_type, &#8216;denied&#8217;) &amp;&amp; !strstr($txn_type, &#8216;failed&#8217;) &amp;&amp; !strstr($txn_type, &#8216;voided&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u8fd9\u91cc\u5224\u65ad\uff0c\u5982\u679c\u83b7\u53d6\u5230\u4e86invoice\uff0c\u5219\u8df3\u8fc7\u751f\u4ea7\u8ba2\u5355\u7684\u6b65\u9aa4\uff0c\u4e4b\u5199\u5165Paypal\u4ed8\u6b3e\u4fe1\u606f\u3002   &nbsp; &nbsp; &nbsp; &nbsp; if(isset($_POST[&#8216;invoice&#8217;]) &amp;&amp; $_POST[&#8216;invoice&#8217;] != &#8221;){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $insert_id = $_POST[&#8216;invoice&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5a &#8211; built order &#8212; OID: &#8216; . $insert_id);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_array($insert_id, $txn_type);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5b &#8211; PP table OID: &#8216; . print_r($sql_data_array, true));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5c &#8211; PP table OID saved&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $pp_hist_id = $db-&gt;Insert_ID();   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_AFTER_ORDER_CREATE&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5d &#8211; PP hist ID: &#8216; . $pp_hist_id);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_history_array($pp_hist_id);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5e &#8211; PP hist_data:&#8217; . print_r($sql_data_array, true));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL_PAYMENT_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5f &#8211; PP hist saved&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5g &#8211; new status code: &#8216; . $new_status);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($_POST[&#8216;payment_status&#8217;] ==&#8217;Pending&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = (defined(&#8216;MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID&#8217;) &amp;&amp; (int)MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID &gt; 0 ? (int)MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID : 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5h &#8211; newer status code: &#8216; . (int)$new_status);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#8220;UPDATE &#8221; . TABLE_ORDERS &nbsp;. &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET orders_status = &#8221; . (int)$new_status . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE orders_id = &#8216;&#8221; . (int)$insert_id . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5i &#8211; order table updated&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = array(&#8216;orders_id&#8217; =&gt; (int)$insert_id,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;orders_status_id&#8217; =&gt; (int)$new_status,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;date_added&#8217; =&gt; &#8216;now()&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;comments&#8217; =&gt; &#8216;PayPal status: &#8216; . $_POST[&#8216;payment_status&#8217;] . &#8216; &#8216; . $_POST[&#8216;pending_reason&#8217;]. &#8216; @ &#8216;.$_POST[&#8216;payment_date&#8217;] . (($_POST[&#8216;parent_txn_id&#8217;] !=&#8221;) ? &#8220;\\n&#8221; . &#8216; Parent Trans ID:&#8217; . $_POST[&#8216;parent_txn_id&#8217;] : &#8221;) . &#8220;\\n&#8221; . &#8216; Trans ID:&#8217; . $_POST[&#8216;txn_id&#8217;] . &#8220;\\n&#8221; . &#8216; Amount: &#8216; . $_POST[&#8216;mc_gross&#8217;] . &#8216; &#8216; . $_POST[&#8216;mc_currency&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;customer_notified&#8217; =&gt; 0   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($_POST[&#8216;payment_status&#8217;] ==&#8217;Completed&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = (defined(&#8216;MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID&#8217;) &amp;&amp; (int)MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID &gt; 0 ? (int)MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID : 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5h_1 &#8211; newer status code: &#8216; . (int)$new_status);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#8220;UPDATE &#8221; . TABLE_ORDERS &nbsp;. &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET orders_status = &#8221; . (int)$new_status . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE orders_id = &#8216;&#8221; . (int)$insert_id . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5i_1 &#8211; order table updated&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = array(&#8216;orders_id&#8217; =&gt; (int)$insert_id,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;orders_status_id&#8217; =&gt; (int)$new_status,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;date_added&#8217; =&gt; &#8216;now()&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;comments&#8217; =&gt; &#8216;PayPal status: &#8216; . $_POST[&#8216;payment_status&#8217;] . &#8216; &#8216; . $_POST[&#8216;pending_reason&#8217;]. &#8216; @ &#8216;.$_POST[&#8216;payment_date&#8217;] . (($_POST[&#8216;parent_txn_id&#8217;] !=&#8221;) ? &#8220;\\n&#8221; . &#8216; Parent Trans ID:&#8217; . $_POST[&#8216;parent_txn_id&#8217;] : &#8221;) . &#8220;\\n&#8221; . &#8216; Trans ID:&#8217; . $_POST[&#8216;txn_id&#8217;] . &#8220;\\n&#8221; . &#8216; Amount: &#8216; . $_POST[&#8216;mc_gross&#8217;] . &#8216; &#8216; . $_POST[&#8216;mc_currency&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;customer_notified&#8217; =&gt; 0   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5j &#8211; order stat hist update:&#8217; . print_r($sql_data_array, true));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE == &#8216;1&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array[&#8216;comments&#8217;] = &#8216;**** ADDRESS OVERRIDE ALERT!!! **** CHECK PAYPAL ORDER DETAILS FOR ACTUAL ADDRESS SELECTED BY CUSTOMER!!&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array[&#8216;customer_notified&#8217;] = -1;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5k &#8211; OSH update done&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/$order-&gt;create_add_products($insert_id, 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5L &#8211; adding products&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_number_created&#8217;] = $insert_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order-&gt;send_order_email($insert_id, 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5m &#8211; emailing customer&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/** Prepare sales-tracking data for use by notifier class **\/   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ototal = $order_subtotal = $credits_applied = 0;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0, $n=sizeof($order_totals); $i&lt;$n; $i++) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order_totals[$i][&#8216;code&#8217;] == &#8216;ot_subtotal&#8217;) $order_subtotal = $order_totals[$i][&#8216;value&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($$order_totals[$i][&#8216;code&#8217;]-&gt;credit_class == true) $credits_applied += $order_totals[$i][&#8216;value&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order_totals[$i][&#8216;code&#8217;] == &#8216;ot_total&#8217;) $ototal = $order_totals[$i][&#8216;value&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $commissionable_order = ($order_subtotal &#8211; $credits_applied);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $commissionable_order_formatted = $currencies-&gt;format($commissionable_order);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;order_number&#8217;] = $insert_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;order_subtotal&#8217;] = $order_subtotal;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;credits_applied&#8217;] = $credits_applied;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;order_total&#8217;] = $ototal;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;commissionable_order&#8217;] = $commissionable_order;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;commissionable_order_formatted&#8217;] = $commissionable_order_formatted;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;coupon_code&#8217;] = $order-&gt;info[&#8216;coupon_code&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_HANDLE_AFFILIATES&#8217;, &#8216;paypalipn&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;cart&#8217;]-&gt;reset(true);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5n &#8211; emptying cart&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ordersID = $insert_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $paypalipnID = $pp_hist_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 6 &#8211; Completed IPN order add.&#8217; . &#8216; &nbsp; &nbsp;ordersID = &#8216;. $ordersID . &#8216; &nbsp;IPN tracking record = &#8216; . $paypalipnID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!($new_record_needed &amp;&amp; $txn_type == &#8216;echeck-cleared&#8217;)) &nbsp;break;   &nbsp; &nbsp; &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $insert_id = $order-&gt;create($order_totals);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5a &#8211; built order &#8212; OID: &#8216; . $insert_id);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_array($insert_id, $txn_type);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5b &#8211; PP table OID: &#8216; . print_r($sql_data_array, true));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5c &#8211; PP table OID saved&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $pp_hist_id = $db-&gt;Insert_ID();   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_PAYMENT_MODULES_AFTER_ORDER_CREATE&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5d &#8211; PP hist ID: &#8216; . $pp_hist_id);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_history_array($pp_hist_id);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5e &#8211; PP hist_data:&#8217; . print_r($sql_data_array, true));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL_PAYMENT_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5f &#8211; PP hist saved&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5g &#8211; new status code: &#8216; . $new_status);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($_POST[&#8216;payment_status&#8217;] ==&#8217;Pending&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = (defined(&#8216;MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID&#8217;) &amp;&amp; (int)MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID &gt; 0 ? (int)MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID : 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5h &#8211; newer status code: &#8216; . (int)$new_status);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#8220;UPDATE &#8221; . TABLE_ORDERS &nbsp;. &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SET orders_status = &#8221; . (int)$new_status . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE orders_id = &#8216;&#8221; . (int)$insert_id . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5i &#8211; order table updated&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = array(&#8216;orders_id&#8217; =&gt; (int)$insert_id,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;orders_status_id&#8217; =&gt; (int)$new_status,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;date_added&#8217; =&gt; &#8216;now()&#8217;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;comments&#8217; =&gt; &#8216;PayPal status: &#8216; . $_POST[&#8216;payment_status&#8217;] . &#8216; &#8216; . $_POST[&#8216;pending_reason&#8217;]. &#8216; @ &#8216;.$_POST[&#8216;payment_date&#8217;] . (($_POST[&#8216;parent_txn_id&#8217;] !=&#8221;) ? &#8220;\\n&#8221; . &#8216; Parent Trans ID:&#8217; . $_POST[&#8216;parent_txn_id&#8217;] : &#8221;) . &#8220;\\n&#8221; . &#8216; Trans ID:&#8217; . $_POST[&#8216;txn_id&#8217;] . &#8220;\\n&#8221; . &#8216; Amount: &#8216; . $_POST[&#8216;mc_gross&#8217;] . &#8216; &#8216; . $_POST[&#8216;mc_currency&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;customer_notified&#8217; =&gt; 0   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; );   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5j &#8211; order stat hist update:&#8217; . print_r($sql_data_array, true));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (MODULE_PAYMENT_PAYPAL_ADDRESS_OVERRIDE == &#8216;1&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array[&#8216;comments&#8217;] = &#8216;**** ADDRESS OVERRIDE ALERT!!! **** CHECK PAYPAL ORDER DETAILS FOR ACTUAL ADDRESS SELECTED BY CUSTOMER!!&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array[&#8216;customer_notified&#8217;] = -1;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5k &#8211; OSH update done&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order-&gt;create_add_products($insert_id, 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5L &#8211; adding products&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_number_created&#8217;] = $insert_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order-&gt;send_order_email($insert_id, 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5m &#8211; emailing customer&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/** Prepare sales-tracking data for use by notifier class **\/   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ototal = $order_subtotal = $credits_applied = 0;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0, $n=sizeof($order_totals); $i&lt;$n; $i++) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order_totals[$i][&#8216;code&#8217;] == &#8216;ot_subtotal&#8217;) $order_subtotal = $order_totals[$i][&#8216;value&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($$order_totals[$i][&#8216;code&#8217;]-&gt;credit_class == true) $credits_applied += $order_totals[$i][&#8216;value&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order_totals[$i][&#8216;code&#8217;] == &#8216;ot_total&#8217;) $ototal = $order_totals[$i][&#8216;value&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $commissionable_order = ($order_subtotal &#8211; $credits_applied);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $commissionable_order_formatted = $currencies-&gt;format($commissionable_order);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;order_number&#8217;] = $insert_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;order_subtotal&#8217;] = $order_subtotal;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;credits_applied&#8217;] = $credits_applied;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;order_total&#8217;] = $ototal;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;commissionable_order&#8217;] = $commissionable_order;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;commissionable_order_formatted&#8217;] = $commissionable_order_formatted;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;order_summary&#8217;][&#8216;coupon_code&#8217;] = $order-&gt;info[&#8216;coupon_code&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_CHECKOUT_PROCESS_HANDLE_AFFILIATES&#8217;, &#8216;paypalipn&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_SESSION[&#8216;cart&#8217;]-&gt;reset(true);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 5n &#8211; emptying cart&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $ordersID = $insert_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $paypalipnID = $pp_hist_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;Breakpoint: 6 &#8211; Completed IPN order add.&#8217; . &#8216; &nbsp; &nbsp;ordersID = &#8216;. $ordersID . &#8216; &nbsp;IPN tracking record = &#8216; . $paypalipnID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!($new_record_needed &amp;&amp; $txn_type == &#8216;echeck-cleared&#8217;)) &nbsp;break;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp; &nbsp; case &#8216;parent&#8217;:   &nbsp; &nbsp; case &#8216;cleared-address&#8217;:   &nbsp; &nbsp; case &#8216;cleared-multicurrency&#8217;:   &nbsp; &nbsp; case &#8216;cleared-echeck&#8217;:   &nbsp; &nbsp; case &#8216;cleared-authorization&#8217;:   &nbsp; &nbsp; case &#8216;cleared-verify&#8217;:   &nbsp; &nbsp; case &#8216;cleared-intl&#8217;:   &nbsp; &nbsp; case &#8216;cleared-review&#8217;:   &nbsp; &nbsp; case &#8216;echeck-denied&#8217;:   &nbsp; &nbsp; case &#8216;echeck-cleared&#8217;:   &nbsp; &nbsp; case &#8216;denied-address&#8217;:   &nbsp; &nbsp; case &#8216;denied-multicurrency&#8217;:   &nbsp; &nbsp; case &#8216;denied-echeck&#8217;:   &nbsp; &nbsp; case &#8216;failed-echeck&#8217;:   &nbsp; &nbsp; case &#8216;denied-intl&#8217;:   &nbsp; &nbsp; case &#8216;denied&#8217;:   &nbsp; &nbsp; case &#8216;voided&#8217;:   &nbsp; &nbsp; case &#8216;express-checkout-cleared&#8217;:   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Storing order\/update details for order #&#8217; . $ordersID . &#8216; txn_id: &#8216; . $_POST[&#8216;txn_id&#8217;] . &#8216; PP IPN ID: &#8216; . $paypalipnID);   &nbsp; &nbsp; &nbsp; if ($txn_type == &#8216;parent&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_array($ordersID, $txn_type);   &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL, $sql_data_array);   &nbsp; &nbsp; &nbsp; &nbsp; $paypalipnID = $db-&gt;Insert_ID();   &nbsp; &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_update_array($txn_type);   &nbsp; &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL, $sql_data_array, &#8216;update&#8217;, &#8220;txn_id='&#8221; . ($txn_type == &#8216;cleared-authorization&#8217; ? $_POST[&#8216;parent_txn_id&#8217;] : $_POST[&#8216;txn_id&#8217;]) . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; $sql = &#8220;select paypal_ipn_id from &#8221; . TABLE_PAYPAL . &#8221; where txn_id='&#8221; . $_POST[&#8216;txn_id&#8217;] . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; $result = $db-&gt;Execute($sql);   &nbsp; &nbsp; &nbsp; &nbsp; $paypalipnID = $result-&gt;fields[&#8216;paypal_ipn_id&#8217;];   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; $sql_data_array = ipn_create_order_history_array($paypalipnID);   &nbsp; &nbsp; &nbsp; zen_db_perform(TABLE_PAYPAL_PAYMENT_STATUS_HISTORY, $sql_data_array);   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Added PP status-history record for order #&#8217; . $ordersID . &#8216; txn_id: &#8216; . $_POST[&#8216;txn_id&#8217;] . &#8216; (updated\/child) PP IPN ID: &#8216; . $paypalipnID);   &nbsp;   &nbsp; &nbsp; &nbsp; switch ($txn_type) {   &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;voided&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; case ($_POST[&#8216;payment_status&#8217;] == &#8216;Refunded&#8217; || $_POST[&#8216;payment_status&#8217;] == &#8216;Reversed&#8217; || $_POST[&#8216;payment_status&#8217;] == &#8216;Voided&#8217;):   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/payment_status=Refunded or payment_status=Voided   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = MODULE_PAYMENT_PAYPALWPP_REFUNDED_STATUS_ID;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (defined(&#8216;MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID&#8217;) &amp;&amp; (int)MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID &gt; 0 &amp;&amp; !$isECtransaction) $new_status = MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;echeck-denied&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;denied-echeck&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;failed-echeck&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/payment_status=Denied or failed   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = ($isECtransaction ? MODULE_PAYMENT_PAYPALWPP_REFUNDED_STATUS_ID : MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;echeck-cleared&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = (defined(&#8216;MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID&#8217;) ? MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID : 2);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; case ($txn_type==&#8217;express-checkout-cleared&#8217; || substr($txn_type,0,8) == &#8216;cleared-&#8216;):   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/express-checkout-cleared   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = ($isECtransaction &amp;&amp; defined(&#8216;MODULE_PAYMENT_PAYPALWPP_ORDER_STATUS_ID&#8217;) ? MODULE_PAYMENT_PAYPALWPP_ORDER_STATUS_ID : MODULE_PAYMENT_PAYPAL_ORDER_STATUS_ID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((int)$new_status == 0) $new_status = 2;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; case &#8216;pending-auth&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ pending authorization   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = ($isECtransaction ? MODULE_PAYMENT_PAYPALWPP_REFUNDED_STATUS_ID : MODULE_PAYMENT_PAYPAL_REFUND_ORDER_STATUS_ID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; case (substr($txn_type,0,7) == &#8216;denied-&#8216;):   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ denied for any other reason &#8211; treat as pending for now   &nbsp; &nbsp; &nbsp; &nbsp; case (substr($txn_type,0,8) == &#8216;pending-&#8216;):   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ pending anything   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_status = ($isECtransaction ? MODULE_PAYMENT_PAYPALWPP_ORDER_PENDING_STATUS_ID : MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; \/\/ update order status history with new information   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Set new status &#8216; . $new_status . &#8221; for order ID = &#8221; . &nbsp;$ordersID . ($_POST[&#8216;pending_reason&#8217;] != &#8221; ? &#8216;. &nbsp; Reason_code = &#8216; . $_POST[&#8216;pending_reason&#8217;] : &#8221;) );   &nbsp; &nbsp; &nbsp; if ((int)$new_status == 0) $new_status = 1;   &nbsp; &nbsp; &nbsp; if (in_array($_POST[&#8216;payment_status&#8217;], array(&#8216;Refunded&#8217;, &#8216;Reversed&#8217;, &#8216;Denied&#8217;, &#8216;Failed&#8217;))   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| substr($txn_type,0,8) == &#8216;cleared-&#8216; || $txn_type==&#8217;echeck-cleared&#8217; || $txn_type == &#8216;express-checkout-cleared&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; ipn_update_orders_status_and_history($ordersID, $new_status, $txn_type);   &nbsp; &nbsp; &nbsp; &nbsp; $zco_notifier-&gt;notify(&#8216;NOTIFY_PAYPALIPN_STATUS_HISTORY_UPDATE&#8217;, array($ordersID, $new_status, $txn_type));   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; default:   &nbsp; &nbsp; &nbsp; \/\/ can&#8217;t understand result found. Thus, logging and aborting.   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN WARNING :: Could not process for txn type: &#8216; . $txn_type . &#8220;\\n&#8221; . &#8216; postdata=&#8217; . str_replace(&#8216;&amp;&#8217;, &#8221; \\n&amp;&#8221;, urldecode(print_r($_POST, TRUE))));   &nbsp; }   &nbsp; \/\/ debug info only   &nbsp; switch (TRUE) {   &nbsp; &nbsp; case ($txn_type == &#8216;pending-echeck&#8217; &amp;&amp; (int)$ordersID &gt; 0):   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Pending echeck transaction for existing order. No action required. Waiting for echeck to clear.&#8217;);   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; case ($txn_type == &#8216;pending-multicurrency&#8217; &amp;&amp; (int)$ordersID &gt; 0):   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: Pending multicurrency transaction for existing order. No action required. Waiting for merchant to &#8220;accept&#8221; the order via PayPal account console.&#8217;);   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; case ($txn_type == &#8216;pending-address&#8217; &amp;&amp; (int)$ordersID &gt; 0):   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: &#8220;Pending address&#8221; transaction for existing order. No action required. Waiting for address approval by store owner via PayPal account console.&#8217;);   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; case ($txn_type == &#8216;pending-paymentreview&#8217; &amp;&amp; (int)$ordersID &gt; 0):   &nbsp; &nbsp; &nbsp; ipn_debug_email(&#8216;IPN NOTICE :: &#8220;Pending payment review&#8221; transaction for existing order. No action required. Waiting for PayPal to complete their Payment Review. Do not ship order until review is completed.&#8217;);   &nbsp; &nbsp; &nbsp; break;   &nbsp; }   }  <\/p>\n<p> 9. \u524d\u9762\u7684\u6240\u6709\u6d41\u7a0b\u5b8c\u6210\u4e4b\u540e\uff0c\u5148\u751f\u6210\u8ba2\u5355\u540e\u4ed8\u6b3e\u7684\u529f\u80fd\u5c31\u5df2\u7ecf\u641e\u5b9a\u4e86\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u5728\u540e\u53f0\u4fee\u6539\u4e3a\u4ed8\u6b3e\u8ba2\u5355\u4ef7\u683c\u6570\u91cf\u53ca\u8fd0\u8d39\u7684\u95ee\u9898\u4e86\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<br \/> &nbsp;<\/p>\n<p>  &lt;?php   \/**   &nbsp;* @package admin   &nbsp;* @copyright Copyright 2003-2010 Zen Cart Development Team   &nbsp;* @copyright Portions Copyright 2003 osCommerce   &nbsp;* @license http:\/\/www.zen-cart.com\/license\/2_0.txt GNU Public License V2.0   &nbsp;* @version $Id: orders.php 15994 2010-04-19 17:17:51Z ajeh $   &nbsp;*\/   &nbsp;   &nbsp; require(&#8216;includes\/application_top.php&#8217;);   &nbsp;&nbsp;   &nbsp; require(DIR_WS_CLASSES . &#8216;currencies.php&#8217;);   &nbsp; $currencies = new currencies();   &nbsp;   &nbsp; include(DIR_WS_CLASSES . &#8216;order.php&#8217;);   &nbsp;&nbsp;   &nbsp; \/\/\u8ba2\u5355\u4fee\u6539\u63d0\u4ea4\u540e\u7684\u6570\u636e\u5904\u7406\u4ee3\u7801 EOF   &nbsp;&nbsp;   &nbsp; if(!empty($_POST[&#8216;ot_total&#8217;]) &amp;&amp; isset($_GET[oID]) &amp;&amp; $_GET[oID] !=&#8221;){   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $update_order_id=$_GET[oID];   &nbsp; &nbsp; &nbsp; $products_list=array();   &nbsp; &nbsp; &nbsp; $total_list=array();   &nbsp; &nbsp; &nbsp; foreach($_POST[&#8216;reference_oid&#8217;] as $value1){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $products_list[$value1]=array();   &nbsp; &nbsp; &nbsp; }   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $products_list_loop = $products_list;   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; foreach($_POST as $key2=&gt;$value2){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; foreach ($products_list_loop as $key3=&gt;$value3){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($key3 == ltrim(strrchr($key2,&#8217;_&#8217;),&#8217;_&#8217;)){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $array_key = substr($key2,0,strripos($key2,&#8217;_&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($array_key != &#8216;qty&#8217;){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $products_list[$key3][$array_key] = $value2 \/ $_POST[&#8216;currencies_value&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $products_list[$key3][$array_key] = $value2;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $order_total_value=$_POST[&#8216;ot_total&#8217;] \/ $_POST[&#8216;currencies_value&#8217;];   &nbsp; &nbsp; &nbsp; $order_total_text=$currencies-&gt;format($order_total_value,true,$_POST[&#8216;currencies_key&#8217;],$_POST[&#8216;currencies_value&#8217;]);   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $order_subtotal_value=$_POST[&#8216;ot_subtotal&#8217;] \/ $_POST[&#8216;currencies_value&#8217;];   &nbsp; &nbsp; &nbsp; $order_subtotal_text=$currencies-&gt;format($order_subtotal_value,true,$_POST[&#8216;currencies_key&#8217;],$_POST[&#8216;currencies_value&#8217;]);   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; $order_shipping_value=$_POST[&#8216;ot_shipping&#8217;] \/ $_POST[&#8216;currencies_value&#8217;];;   &nbsp; &nbsp; &nbsp; $order_shipping_text=$currencies-&gt;format($order_shipping_value,true,$_POST[&#8216;currencies_key&#8217;],$_POST[&#8216;currencies_value&#8217;]);   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; $order_gv_text=$_POST[&#8216;ot_gv&#8217;];   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; $order_gv_value=$_POST[&#8216;ot_gv&#8217;];   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; $order_coupon_text=$_POST[&#8216;ot_coupon&#8217;];   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; $order_coupon_value=$_POST[&#8216;ot_coupon&#8217;];   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; foreach($products_list as $key4=&gt;$value4){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_update_order_products=&#8221;update &#8221; . TABLE_ORDERS_PRODUCTS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set products_price = &#8221; . $products_list[$key4][&#8216;price_ex&#8217;] . &#8221; , final_price = &#8221; . $products_list[$key4][&#8216;price_ex&#8217;] . &#8221; , products_quantity = &#8221; . $products_list[$key4][&#8216;qty&#8217;] . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &nbsp;&#8221; . $update_order_id . &#8221; and products_id = &nbsp;&#8221; . $key4;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql_update_order_products);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8220;\u66f4\u65b0\u4ea7\u54c1\u4ef7\u683c\u548c\u6570\u91cf\uff1a &#8221; . $sql_update_order_products . &#8220;&lt;br \/&gt;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var_dump($db-&gt;Execute($sql_update_order_products));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; }   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; if($order_subtotal_text){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_update_subtotal=&#8221;update &#8221; . TABLE_ORDERS_TOTAL . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set text = &#8216;&#8221; . $order_subtotal_text . &#8220;&#8216; , value = &#8221; . $order_subtotal_value .&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;where orders_id = &#8221; . $update_order_id . &#8221; and class = &#8216;ot_subtotal'&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql_update_subtotal);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8220;\u66f4\u65b0\u4ea7\u54c1\u603b\u4ef7\uff1a &#8221; . $sql_update_subtotal . &#8220;&lt;br \/&gt;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var_dump($db-&gt;Execute($sql_update_subtotal));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; }   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; if($order_shipping_text){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_update_shipping=&#8221;update &#8221; . TABLE_ORDERS_TOTAL . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set text = &#8216;&#8221; . $order_shipping_text . &#8220;&#8216; , value = &#8221; . $order_shipping_value .&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;where orders_id = &#8221; . $update_order_id . &#8221; and class = &#8216;ot_shipping'&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql_update_shipping);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8220;\u66f4\u65b0\u8fd0\u8d39\u4ef7\u683c\uff1a &#8221; . $sql_update_shipping . &#8220;&lt;br \/&gt;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var_dump($db-&gt;Execute($sql_update_shipping));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; }   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; if($order_total_text){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_update_total=&#8221;update &#8221; . TABLE_ORDERS_TOTAL . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;set text = &#8216;&#8221; . $order_total_text . &#8220;&#8216; , value = &#8221; . $order_total_value .&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;where orders_id = &#8221; . $update_order_id . &#8221; and class = &#8216;ot_total'&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql_update_total);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8220;\u66f4\u65b0\u8ba2\u5355\u603b\u4ef7\uff1a &#8221; . $sql_update_total . &#8220;&lt;br \/&gt;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var_dump($db-&gt;Execute($sql_update_total));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&#8217;;   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql_update_order=&#8221;update &#8221; . TABLE_ORDERS . &#8221; set order_total = &#8221; .$order_total_value . &#8221; where orders_id = &#8221; . $update_order_id;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($sql_update_order);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8220;\u66f4\u65b0\u8ba2\u5355: &#8221; . $sql_update_order . &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var_dump($db-&gt;Execute($sql_update_order));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; }   &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; echo &#8220;&lt;script language=JavaScript&gt; location.replace(location.href);&lt;\/script&gt;&#8221;;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; echo &#8216;&lt;pre&gt;&#8217;;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; echo &#8220;\u6c47\u7387\uff1a &#8220;.$_POST[&#8216;currencies_value&#8217;] . &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; echo &#8220;\u8f6c\u6210\u9ed8\u8ba4\u8d27\u5e01:&#8221; . $order_total_value \/ $_POST[&#8216;currencies_value&#8217;] . &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&#8217;;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; echo &#8220;\u4ea4\u6613\u8d27\u5e01\u503c\uff1a &#8220;.$order_total_value.&#8221;&lt;br \/&gt;&#8221;;   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; echo &#8220;\u8f6c\u6210\u4ea4\u6613\u8d27\u5e01\u6837\u5f0f\uff1a &#8221; . $currencies-&gt;format(($order_total_value \/ $_POST[&#8216;currencies_value&#8217;]),true,$_POST[&#8216;currencies_key&#8217;],$_POST[&#8216;currencies_value&#8217;]);   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; print_r($products_list);   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; print_r($_POST);   &nbsp; &nbsp; &nbsp; \/\/ &nbsp; &nbsp; &nbsp; echo &#8216;&lt;\/pre&gt;&#8217;;   &nbsp; }   &nbsp;&nbsp;   &nbsp; \/\/\u8ba2\u5355\u4fee\u6539\u63d0\u4ea4\u540e\u7684\u6570\u636e\u5904\u7406\u4ee3\u7801 BOF   &nbsp;&nbsp;   &nbsp; \/\/ prepare order-status pulldown list   &nbsp; $orders_statuses = array();   &nbsp; $orders_status_array = array();   &nbsp; $orders_status = $db-&gt;Execute(&#8220;select orders_status_id, orders_status_name   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from &#8221; . TABLE_ORDERS_STATUS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;where language_id = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216; order by orders_status_id&#8221;);   &nbsp; while (!$orders_status-&gt;EOF) {   &nbsp; &nbsp; $orders_statuses[] = array(&#8216;id&#8217; =&gt; $orders_status-&gt;fields[&#8216;orders_status_id&#8217;],   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216;text&#8217; =&gt; $orders_status-&gt;fields[&#8216;orders_status_name&#8217;] . &#8216; [&#8216; . $orders_status-&gt;fields[&#8216;orders_status_id&#8217;] . &#8216;]&#8217;);   &nbsp; &nbsp; $orders_status_array[$orders_status-&gt;fields[&#8216;orders_status_id&#8217;]] = $orders_status-&gt;fields[&#8216;orders_status_name&#8217;];   &nbsp; &nbsp; $orders_status-&gt;MoveNext();   &nbsp; }   &nbsp;   &nbsp; $action = (isset($_GET[&#8216;action&#8217;]) ? $_GET[&#8216;action&#8217;] : &#8221;);   &nbsp; $order_exists = false;   &nbsp; if (isset($_GET[&#8216;oID&#8217;]) &amp;&amp; trim($_GET[&#8216;oID&#8217;]) == &#8221;) unset($_GET[&#8216;oID&#8217;]);   &nbsp; if ($action == &#8216;edit&#8217; &amp;&amp; !isset($_GET[&#8216;oID&#8217;])) $action = &#8221;;   &nbsp;   &nbsp; if (isset($_GET[&#8216;oID&#8217;])) {   &nbsp; &nbsp; $oID = zen_db_prepare_input(trim($_GET[&#8216;oID&#8217;]));   &nbsp;   &nbsp; &nbsp; $orders = $db-&gt;Execute(&#8220;select orders_id from &#8221; . TABLE_ORDERS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . $oID . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; $order_exists = true;   &nbsp; &nbsp; if ($orders-&gt;RecordCount() &lt;= 0) {   &nbsp; &nbsp; &nbsp; $order_exists = false;   &nbsp; &nbsp; &nbsp; if ($action != &#8221;) $messageStack-&gt;add_session(ERROR_ORDER_DOES_NOT_EXIST . &#8216; &#8216; . $oID, &#8216;error&#8217;);   &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)), &#8216;NONSSL&#8217;));   &nbsp; &nbsp; }   &nbsp; }   &nbsp;   &nbsp; if (zen_not_null($action) &amp;&amp; $order_exists == true) {   &nbsp; &nbsp; switch ($action) {   &nbsp; &nbsp; &nbsp; case &#8216;edit&#8217;:   &nbsp; &nbsp; &nbsp; \/\/ reset single download to on   &nbsp; &nbsp; &nbsp; &nbsp; if ($_GET[&#8216;download_reset_on&#8217;] &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ adjust download_maxdays based on current date   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $check_status = $db-&gt;Execute(&#8220;select customers_name, customers_email_address, orders_status,orders_num,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; date_purchased from &#8221; . TABLE_ORDERS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . $_GET[&#8216;oID&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zc_max_days = zen_date_diff($check_status-&gt;fields[&#8216;date_purchased&#8217;], date(&#8216;Y-m-d H:i:s&#8217;, time())) + DOWNLOAD_MAX_DAYS;   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $update_downloads_query = &#8220;update &#8221; . TABLE_ORDERS_PRODUCTS_DOWNLOAD . &#8221; set download_maxdays='&#8221; . $zc_max_days . &#8220;&#8216;, download_count='&#8221; . DOWNLOAD_MAX_COUNT . &#8220;&#8216; where orders_id='&#8221; . $_GET[&#8216;oID&#8217;] . &#8220;&#8216; and orders_products_download_id='&#8221; . $_GET[&#8216;download_reset_on&#8217;] . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($update_downloads_query);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($_GET[&#8216;download_reset_on&#8217;]);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(SUCCESS_ORDER_UPDATED_DOWNLOAD_ON, &#8216;success&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; \/\/ reset single download to off   &nbsp; &nbsp; &nbsp; &nbsp; if ($_GET[&#8216;download_reset_off&#8217;] &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ adjust download_maxdays based on current date   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ *** fix: adjust count not maxdays to cancel download   \/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$update_downloads_query = &#8220;update &#8221; . TABLE_ORDERS_PRODUCTS_DOWNLOAD . &#8221; set download_maxdays=&#8217;0&#8242;, download_count=&#8217;0&#8242; where orders_id='&#8221; . $_GET[&#8216;oID&#8217;] . &#8220;&#8216; and orders_products_download_id='&#8221; . $_GET[&#8216;download_reset_off&#8217;] . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $update_downloads_query = &#8220;update &#8221; . TABLE_ORDERS_PRODUCTS_DOWNLOAD . &#8221; set download_count=&#8217;0&#8217; where orders_id='&#8221; . $_GET[&#8216;oID&#8217;] . &#8220;&#8216; and orders_products_download_id='&#8221; . $_GET[&#8216;download_reset_off&#8217;] . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unset($_GET[&#8216;download_reset_off&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($update_downloads_query);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(SUCCESS_ORDER_UPDATED_DOWNLOAD_OFF, &#8216;success&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; case &#8216;update_order&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; \/\/ demo active test   &nbsp; &nbsp; &nbsp; &nbsp; if (zen_admin_demo()) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_GET[&#8216;action&#8217;]= &#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(ERROR_ADMIN_DEMO, &#8216;caution&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; $oID = zen_db_prepare_input($_GET[&#8216;oID&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; $status = zen_db_prepare_input($_POST[&#8216;status&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; $comments = zen_db_prepare_input($_POST[&#8216;comments&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; $tracking_number = zen_db_prepare_input($_POST[&#8216;tracking_number&#8217;]);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; $order_updated = false;   &nbsp; &nbsp; &nbsp; &nbsp; $check_status = $db-&gt;Execute(&#8220;select customers_name, customers_email_address, orders_status,orders_num,tracking_number,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; date_purchased from &#8221; . TABLE_ORDERS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . $oID . &#8220;&#8216;&#8221;);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; if ( ($check_status-&gt;fields[&#8216;orders_status&#8217;] != $status) || zen_not_null($comments)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;update &#8221; . TABLE_ORDERS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set orders_status = &#8216;&#8221; . zen_db_input($status) . &#8220;&#8216;, last_modified = now(), tracking_number = &#8216;&#8221; . zen_db_input($tracking_number) . &#8220;&#8216;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . $oID . &#8220;&#8216;&#8221;);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $customer_notified = &#8216;0&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (isset($_POST[&#8216;notify&#8217;]) &amp;&amp; ($_POST[&#8216;notify&#8217;] == &#8216;1&#8217;)) {   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $notify_comments = &#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (isset($_POST[&#8216;notify_comments&#8217;]) &amp;&amp; ($_POST[&#8216;notify_comments&#8217;] == &#8216;on&#8217;) &amp;&amp; zen_not_null($comments)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $notify_comments = EMAIL_TEXT_COMMENTS_UPDATE . $comments . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/send emails   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $message =   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EMAIL_TEXT_ORDER_NUMBER . &#8216; &#8216; . $check_status-&gt;fields[&#8216;orders_num&#8217;] . &#8220;\\n\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EMAIL_TEXT_INVOICE_URL . &#8216; &#8216; . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, &#8216;order_id=&#8217; . $oID, &#8216;SSL&#8217;) . &#8220;\\n\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EMAIL_TEXT_DATE_ORDERED . &#8216; &#8216; . zen_date_long($check_status-&gt;fields[&#8216;date_purchased&#8217;]) . &#8220;\\n\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; strip_tags($notify_comments) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EMAIL_TEXT_STATUS_PLEASE_REPLY;   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_CUSTOMERS_NAME&#8217;] &nbsp; &nbsp;= $check_status-&gt;fields[&#8216;customers_name&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_ORDER_NUMBER&#8217;] = EMAIL_TEXT_ORDER_NUMBER . &#8216; &#8216; . $check_status-&gt;fields[&#8216;orders_num&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_INVOICE_URL&#8217;] &nbsp;= &#8216;&lt;a href=&#8221;&#8216; . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, &#8216;order_id=&#8217; . $oID, &#8216;SSL&#8217;) .'&#8221;&gt;&#8217;.str_replace(&#8216;:&#8217;,&#8221;,EMAIL_TEXT_INVOICE_URL).'&lt;\/a&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_DATE_ORDERED&#8217;] = EMAIL_TEXT_DATE_ORDERED . &#8216; &#8216; . zen_date_long($check_status-&gt;fields[&#8216;date_purchased&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_STATUS_COMMENTS&#8217;] = nl2br($notify_comments);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_STATUS_UPDATED&#8217;] = str_replace(&#8216;\\n&#8217;,&#8221;, EMAIL_TEXT_STATUS_UPDATED);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_STATUS_LABEL&#8217;] = str_replace(&#8216;\\n&#8217;,&#8221;, sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_NEW_STATUS&#8217;] = $orders_status_array[$status];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_STATUS_PLEASE_REPLY&#8217;] = str_replace(&#8216;\\n&#8217;,&#8221;, EMAIL_TEXT_STATUS_PLEASE_REPLY);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_mail($check_status-&gt;fields[&#8216;customers_name&#8217;], $check_status-&gt;fields[&#8216;customers_email_address&#8217;], EMAIL_TEXT_SUBJECT . &#8216; #&#8217; . $check_status-&gt;fields[&#8216;orders_num&#8217;], $message, STORE_NAME, EMAIL_FROM, $html_msg, &#8216;order_status&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $customer_notified = &#8216;1&#8217;;   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/send extra emails   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_STATUS == &#8216;1&#8217; and SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO != &#8221;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_mail(&#8221;, SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO, SEND_EXTRA_ORDERS_STATUS_ADMIN_EMAILS_TO_SUBJECT . &#8216; &#8216; . EMAIL_TEXT_SUBJECT . &#8216; #&#8217; . $check_status-&gt;fields[&#8216;orders_num&#8217;], $message, STORE_NAME, EMAIL_FROM, $html_msg, &#8216;order_status_extra&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } elseif (isset($_POST[&#8216;notify&#8217;]) &amp;&amp; ($_POST[&#8216;notify&#8217;] == &#8216;-1&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ hide comment   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $customer_notified = &#8216;-1&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;insert into &#8221; . TABLE_ORDERS_STATUS_HISTORY . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (orders_id, orders_status_id, date_added, customer_notified, comments)   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; values (&#8216;&#8221; . $oID . &#8220;&#8216;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; . zen_db_input($status) . &#8220;&#8216;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; now(),   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; . zen_db_input($customer_notified) . &#8220;&#8216;,   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; . zen_db_input($comments) &nbsp;. &#8220;&#8216;)&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_updated = true;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; \/\/ trigger any appropriate updates which should be sent back to the payment gateway:   &nbsp; &nbsp; &nbsp; &nbsp; $order = new order($oID);   &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;info[&#8216;payment_module_code&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (file_exists(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_LANGUAGES . $_SESSION[&#8216;language&#8217;] . &#8216;\/modules\/payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module = new $order-&gt;info[&#8216;payment_module_code&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (method_exists($module, &#8216;_doStatusUpdate&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $response = $module-&gt;_doStatusUpdate($oID, $status, $comments, $customer_notified, $check_status-&gt;fields[&#8216;orders_status&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; if ($order_updated == true) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ($status == DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ adjust download_maxdays based on current date   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $zc_max_days = zen_date_diff($check_status-&gt;fields[&#8216;date_purchased&#8217;], date(&#8216;Y-m-d H:i:s&#8217;, time())) + DOWNLOAD_MAX_DAYS;   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $update_downloads_query = &#8220;update &#8221; . TABLE_ORDERS_PRODUCTS_DOWNLOAD . &#8221; set download_maxdays='&#8221; . $zc_max_days . &#8220;&#8216;, download_count='&#8221; . DOWNLOAD_MAX_COUNT . &#8220;&#8216; where orders_id='&#8221; . $oID . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($update_downloads_query);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(SUCCESS_ORDER_UPDATED, &#8216;success&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(WARNING_ORDER_NOT_UPDATED, &#8216;warning&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; case &#8216;deleteconfirm&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; \/\/ demo active test   &nbsp; &nbsp; &nbsp; &nbsp; if (zen_admin_demo()) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $_GET[&#8216;action&#8217;]= &#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $messageStack-&gt;add_session(ERROR_ADMIN_DEMO, &#8216;caution&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)), &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; $oID = zen_db_prepare_input($_GET[&#8216;oID&#8217;]);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; zen_remove_order($oID, $_POST[&#8216;restock&#8217;]);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)), &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; case &#8216;delete_cvv&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; $delete_cvv = $db-&gt;Execute(&#8220;update &#8221; . TABLE_ORDERS . &#8221; set cc_cvv = &#8216;&#8221; . TEXT_DELETE_CVV_REPLACEMENT . &#8220;&#8216; where orders_id = &#8216;&#8221; . (int)$_GET[&#8216;oID&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; case &#8216;mask_cc&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; $result &nbsp;= $db-&gt;Execute(&#8220;select cc_number from &#8221; . TABLE_ORDERS . &#8221; where orders_id = &#8216;&#8221; . (int)$_GET[&#8216;oID&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; $old_num = $result-&gt;fields[&#8216;cc_number&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; $new_num = substr($old_num, 0, 4) . str_repeat(&#8216;*&#8217;, (strlen($old_num) &#8211; 8)) . substr($old_num, -4);   &nbsp; &nbsp; &nbsp; &nbsp; $mask_cc = $db-&gt;Execute(&#8220;update &#8221; . TABLE_ORDERS . &#8221; set cc_number = &#8216;&#8221; . $new_num . &#8220;&#8216; where orders_id = &#8216;&#8221; . (int)$_GET[&#8216;oID&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp;   &nbsp; &nbsp; &nbsp; case &#8216;doRefund&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; $order = new order($oID);   &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;info[&#8216;payment_module_code&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (file_exists(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_LANGUAGES . $_SESSION[&#8216;language&#8217;] . &#8216;\/modules\/payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module = new $order-&gt;info[&#8216;payment_module_code&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (method_exists($module, &#8216;_doRefund&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module-&gt;_doRefund($oID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; case &#8216;doAuth&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; $order = new order($oID);   &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;info[&#8216;payment_module_code&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (file_exists(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_LANGUAGES . $_SESSION[&#8216;language&#8217;] . &#8216;\/modules\/payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module = new $order-&gt;info[&#8216;payment_module_code&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (method_exists($module, &#8216;_doAuth&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module-&gt;_doAuth($oID, $order-&gt;info[&#8216;total&#8217;], $order-&gt;info[&#8216;currency&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; case &#8216;doCapture&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; $order = new order($oID);   &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;info[&#8216;payment_module_code&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (file_exists(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_LANGUAGES . $_SESSION[&#8216;language&#8217;] . &#8216;\/modules\/payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module = new $order-&gt;info[&#8216;payment_module_code&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (method_exists($module, &#8216;_doCapt&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module-&gt;_doCapt($oID, &#8216;Complete&#8217;, $order-&gt;info[&#8216;total&#8217;], $order-&gt;info[&#8216;currency&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; case &#8216;doVoid&#8217;:   &nbsp; &nbsp; &nbsp; &nbsp; $order = new order($oID);   &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;info[&#8216;payment_module_code&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (file_exists(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once(DIR_FS_CATALOG_LANGUAGES . $_SESSION[&#8216;language&#8217;] . &#8216;\/modules\/payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module = new $order-&gt;info[&#8216;payment_module_code&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (method_exists($module, &#8216;_doVoid&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $module-&gt;_doVoid($oID);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; zen_redirect(zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=edit&#8217;, &#8216;NONSSL&#8217;));   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; }   &nbsp; }   ?&gt;   &lt;!doctype html public &#8220;-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN&#8221;&gt;   &lt;html &lt;?php echo HTML_PARAMS; ?&gt;&gt;   &lt;head&gt;   &lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=&lt;?php echo CHARSET; ?&gt;&#8221;&gt;   &lt;title&gt;&lt;?php echo TITLE; ?&gt;&lt;\/title&gt;   &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; href=&#8221;includes\/stylesheet.css&#8221;&gt;   &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; media=&#8221;print&#8221; href=&#8221;includes\/stylesheet_print.css&#8221;&gt;   &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; href=&#8221;includes\/cssjsmenuhover.css&#8221; media=&#8221;all&#8221; id=&#8221;hoverJS&#8221;&gt;   &lt;script language=&#8221;javascript&#8221; src=&#8221;includes\/menu.js&#8221;&gt;&lt;\/script&gt;   &lt;script language=&#8221;javascript&#8221; src=&#8221;includes\/general.js&#8221;&gt;&lt;\/script&gt;   &lt;script type=&#8221;text\/javascript&#8221;&gt;   &nbsp; &lt;!&#8211;   &nbsp; function init()   &nbsp; {   &nbsp; &nbsp; cssjsmenu(&#8216;navbar&#8217;);   &nbsp; &nbsp; if (document.getElementById)   &nbsp; &nbsp; {   &nbsp; &nbsp; &nbsp; var kill = document.getElementById(&#8216;hoverJS&#8217;);   &nbsp; &nbsp; &nbsp; kill.disabled = true;   &nbsp; &nbsp; }   &nbsp; }   &nbsp; \/\/ &#8211;&gt;   &lt;\/script&gt;   &lt;script language=&#8221;javascript&#8221; type=&#8221;text\/javascript&#8221;&gt;&lt;!&#8211;   function couponpopupWindow(url) {   &nbsp; window.open(url,&#8217;popupWindow&#8217;,&#8217;toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,left=150&#8242;)   }   \/\/&#8211;&gt;&lt;\/script&gt;   &lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text\/css&#8221; href=&#8221;includes\/javascript\/spiffyCal\/spiffyCal_v2_1.css&#8221;&gt;   &lt;script language=&#8221;JavaScript&#8221; src=&#8221;includes\/javascript\/spiffyCal\/spiffyCal_v2_1.js&#8221;&gt;&lt;\/script&gt;   &nbsp;   &lt;?php \/\/\u5f15\u5165\u4e00\u4e2ajquery\u5e93\uff0c\u7136\u540e\u5c31\u662f\u63a7\u5236\u4fee\u6539\u4ef7\u683c\u7684Jquery\u4ee3\u7801 EOF ?&gt;   &lt;script language=&#8221;JavaScript&#8221; src=&#8221;includes\/javascript\/jquery.min.js&#8221;&gt;&lt;\/script&gt;   &lt;script type=&#8221;text\/javascript&#8221;&gt;   $(document).ready(function(){   &nbsp; &nbsp; $(&#8220;#orders_edit&#8221;).click(function(){   &nbsp; &nbsp; &nbsp; $(&#8220;#orders_submit&#8221;).show();   &nbsp; &nbsp; &nbsp; $(&#8220;#orders_reset&#8221;).show();   &nbsp; &nbsp; &nbsp; $(&#8220;#orders_edit&#8221;).hide();   &nbsp; &nbsp; &nbsp; $(&#8220;#products_list_changes&#8221;).show();   &nbsp; &nbsp; &nbsp; $(&#8220;#products_list_default&#8221;).hide();   &nbsp; &nbsp; });   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; $(&#8220;#orders_reset&#8221;).click(function(){   &nbsp; &nbsp; &nbsp; location.replace(location.href);   &nbsp; &nbsp; });   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; $(&#8220;#orders_submit&#8221;).click(function(){   &nbsp; &nbsp; &nbsp; &nbsp; if($(&#8220;input[name=&#8217;ot_total&#8217;]&#8221;).val()&lt;0){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alert(&#8220;\u603b\u4ef7\u683c\u4e3a\u8d1f\u6570\uff0c\u8fd9\u4e0d\u7b26\u5408\u89c4\u5b9a&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; });   &nbsp;&nbsp;   &nbsp; &nbsp; $(&#8220;#products_list_changes input&#8221;).keypress(function(event) { &nbsp;   &nbsp; &nbsp; &nbsp; var keyCode = event.which; &nbsp;   &nbsp; &nbsp; &nbsp; if (keyCode == 46 || (keyCode &gt;= 48 &amp;&amp; keyCode &lt;=57) || keyCode == 8)&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return true; &nbsp;   &nbsp; &nbsp; &nbsp; else &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return false; &nbsp;   &nbsp; &nbsp; }).focus(function() { &nbsp;   &nbsp; &nbsp; &nbsp; this.style.imeMode=&#8217;disabled&#8217;; &nbsp;   &nbsp; &nbsp; });&nbsp;   });   &nbsp;   function init()   {   cssjsmenu(&#8216;navbar&#8217;);   if (document.getElementById)   {   &nbsp; var kill = document.getElementById(&#8216;hoverJS&#8217;);   &nbsp; kill.disabled = true;   }   }   &nbsp;   function selectAll(){   &nbsp; var checklist = document.getElementsByName (&#8220;order_id[]&#8221;);   &nbsp; &nbsp; if(document.getElementById(&#8220;select_all&#8221;).checked)   &nbsp; &nbsp; {   &nbsp; &nbsp; for(var i=0;i&lt;checklist.length;i++)   &nbsp; &nbsp; {   &nbsp; &nbsp; &nbsp; &nbsp;checklist[i].checked = 1;   &nbsp; &nbsp; }   &nbsp; }else{   &nbsp; &nbsp;for(var j=0;j&lt;checklist.length;j++)   &nbsp; &nbsp;{   &nbsp; &nbsp; &nbsp; checklist[j].checked = 0;   &nbsp; &nbsp;}   &nbsp;}   }   &nbsp;&nbsp;   \/\/\u52a0\u6cd5\u8fd0\u7b97   function accAdd(arg1,arg2){   &nbsp; &nbsp; var r1,r2,m;   &nbsp; &nbsp; try{r1=arg1.toString().split(&#8220;.&#8221;)[1].length}catch(e){r1=0}   &nbsp; &nbsp; try{r2=arg2.toString().split(&#8220;.&#8221;)[1].length}catch(e){r2=0}   &nbsp; &nbsp; m=Math.pow(10,Math.max(r1,r2))   &nbsp; &nbsp; return ((arg1*m+arg2*m)\/m).toFixed(2);   &nbsp; }&nbsp;   &nbsp;   \/\/\u51cf\u6cd5\u8fd0\u7b97   function accSub(arg1, arg2) {   &nbsp; &nbsp; var r1, r2, m, n;   &nbsp; &nbsp; try { r1 = arg1.toString().split(&#8220;.&#8221;)[1].length } catch (e) { r1 = 0 }   &nbsp; &nbsp; try { r2 = arg2.toString().split(&#8220;.&#8221;)[1].length } catch (e) { r2 = 0 }   &nbsp; &nbsp; m = Math.pow(10, Math.max(r1, r2));   &nbsp; &nbsp; n = (r1 &gt;= r2) ? r1 : r2;   &nbsp; &nbsp; return ((arg1 * m &#8211; arg2 * m) \/ m).toFixed(n);   &nbsp; }   &nbsp;   \/\/\u4e58\u6cd5\u8fd0\u7b97   function accMul(arg1,arg2)   {   &nbsp; var m=0,s1=arg1.toString(),s2=arg2.toString();   &nbsp; try{m+=s1.split(&#8220;.&#8221;)[1].length}catch(e){}   &nbsp; try{m+=s2.split(&#8220;.&#8221;)[1].length}catch(e){}   &nbsp; return Number(s1.replace(&#8220;.&#8221;,&#8221;&#8221;))*Number(s2.replace(&#8220;.&#8221;,&#8221;&#8221;))\/Math.pow(10,m)   }&nbsp;   &nbsp;   \/\/\u9664\u6cd5\u8fd0\u7b97   function accDiv(arg1, arg2) {   &nbsp; &nbsp; var t1 = 0, t2 = 0, r1, r2;   &nbsp; &nbsp; try { t1 = arg1.toString().split(&#8220;.&#8221;)[1].length } catch (e) { }   &nbsp; &nbsp; try { t2 = arg2.toString().split(&#8220;.&#8221;)[1].length } catch (e) { }   &nbsp; &nbsp; with (Math) {   &nbsp; &nbsp; &nbsp; &nbsp; r1 = Number(arg1.toString().replace(&#8220;.&#8221;, &#8220;&#8221;))   &nbsp; &nbsp; &nbsp; &nbsp; r2 = Number(arg2.toString().replace(&#8220;.&#8221;, &#8220;&#8221;))   &nbsp; &nbsp; &nbsp; &nbsp; return (r1 \/ r2) * pow(10, t2 &#8211; t1);   &nbsp; &nbsp; }   &nbsp; }   &nbsp;   function change_price_ex(order_id,final_price){   &nbsp; &nbsp; var products_qty_simple = &#8220;qty_&#8221;+order_id;   &nbsp; &nbsp; var products_qty = $(&#8220;input[name='&#8221;+products_qty_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp; var price_ex_value_simple = &#8220;price_ex_&#8221;+order_id;   &nbsp; &nbsp; var price_ex_value = $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; if(isNaN(price_ex_value)){   &nbsp; &nbsp; &nbsp; &nbsp; alert(&#8220;\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u6570\u5b57\uff0c\u4ef7\u683c\u5c06\u6062\u590d\u5230\u539f\u59cb\u503c\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u6b63\u786e\u7684\u4ef7\u683c\u3002&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val(final_price);   &nbsp; &nbsp; &nbsp; &nbsp; var price_ex_value = $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; var numindex = parseInt(price_ex_value.indexOf(&#8220;.&#8221;),10);   &nbsp; &nbsp; &nbsp; &nbsp; if(numindex &gt; 0){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var head = price_ex_value.substring(0,numindex);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var bottom = price_ex_value.substring(numindex,numindex+3);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var fianlNum = head+bottom;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val(fianlNum);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var price_ex_value = fianlNum;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp; &nbsp; var total_ex_value = (accMul(price_ex_value,products_qty)).toFixed(2);   &nbsp; &nbsp; var total_ex = &#8220;total_ex_&#8221;+order_id;   &nbsp; &nbsp; var total_ex_hidden = &#8220;total_ex_hidden_&#8221;+order_id;   &nbsp; &nbsp; var price_inc = &#8220;price_inc_&#8221;+order_id;   &nbsp; &nbsp; var total_inc = &#8220;total_inc_&#8221;+order_id;   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_ex+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp; $(&#8220;#&#8221;+total_ex_hidden).text(total_ex_value);   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+price_inc+&#8221;&#8216;]&#8221;).val(price_ex_value);   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_inc+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; var str=0;   &nbsp; &nbsp; $(&#8220;#price_total p&#8221;).each(function (i){   &nbsp; &nbsp; &nbsp; &nbsp; str = &nbsp;accAdd(str,parseFloat($(this).text()));   &nbsp; &nbsp; })   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val(str);   &nbsp;   &nbsp; &nbsp; var ot_subtotal = parseFloat($(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_coupon = $(&#8220;input[name=&#8217;ot_coupon&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_coupon==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_coupon=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_gv = $(&#8220;input[name=&#8217;ot_gv&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_gv==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_gv=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_shipping = parseFloat($(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_total = accSub(accSub(accAdd(ot_subtotal,ot_shipping),ot_coupon),ot_gv);   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_total&#8217;]&#8221;).val(ot_total);   }   &nbsp;   function change_qty(order_id){   &nbsp; &nbsp; var products_qty_simple = &#8220;qty_&#8221;+order_id;   &nbsp; &nbsp; var products_qty = parseInt($(&#8220;input[name='&#8221;+products_qty_simple+&#8221;&#8216;]&#8221;).val());   &nbsp; &nbsp; if(isNaN(products_qty) || products_qty==0){   &nbsp; &nbsp; &nbsp; &nbsp; products_qty=&#8221;&#8221;;   &nbsp; &nbsp; }   &nbsp; &nbsp; var price_ex_value_simple = &#8220;price_ex_&#8221;+order_id;   &nbsp; &nbsp; var price_ex_value = $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+products_qty_simple+&#8221;&#8216;]&#8221;).val(products_qty);   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; var total_ex_value = (accMul(price_ex_value,products_qty)).toFixed(2);   &nbsp; &nbsp; var total_ex = &#8220;total_ex_&#8221;+order_id;   &nbsp; &nbsp; var total_ex_hidden = &#8220;total_ex_hidden_&#8221;+order_id;   &nbsp; &nbsp; var price_inc = &#8220;price_inc_&#8221;+order_id;   &nbsp; &nbsp; var total_inc = &#8220;total_inc_&#8221;+order_id;   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_ex+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp; $(&#8220;#&#8221;+total_ex_hidden).text(total_ex_value);   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_inc+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; var str=0;   &nbsp; &nbsp; $(&#8220;#price_total p&#8221;).each(function (i){   &nbsp; &nbsp; &nbsp; &nbsp; str = &nbsp;accAdd(str,parseFloat($(this).text()));   &nbsp; &nbsp; })   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val(str);   &nbsp;   &nbsp; &nbsp; var ot_subtotal = parseFloat($(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_coupon = $(&#8220;input[name=&#8217;ot_coupon&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_coupon==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_coupon=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_gv = $(&#8220;input[name=&#8217;ot_gv&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_gv==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_gv=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_shipping = parseFloat($(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_total = accSub(accSub(accAdd(ot_subtotal,ot_shipping),ot_coupon),ot_gv);   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_total&#8217;]&#8221;).val(ot_total);   }   &nbsp;   function change_shipping(shipping_total){   &nbsp; &nbsp; var ot_shipping = $(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val();   &nbsp; &nbsp; if(isNaN(ot_shipping)){   &nbsp; &nbsp; &nbsp; &nbsp; alert(&#8220;\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u6570\u5b57\uff0c\u8fd0\u8d39\u5c06\u6062\u590d\u5230\u539f\u59cb\u503c\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u6b63\u786e\u7684\u8fd0\u8d39\u3002&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val(shipping_total);   &nbsp; &nbsp; &nbsp; &nbsp; var ot_shipping = parseFloat($(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val());   &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; var numindex = parseInt(ot_shipping.indexOf(&#8220;.&#8221;),10);   &nbsp; &nbsp; &nbsp; &nbsp; if(numindex &gt; 0){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var head = ot_shipping.substring(0,numindex);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var bottom = ot_shipping.substring(numindex,numindex+3);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var fianlNum = head+bottom;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val(fianlNum);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var ot_shipping = fianlNum;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_subtotal = parseFloat($(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_coupon = $(&#8220;input[name=&#8217;ot_coupon&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_coupon==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_coupon=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_gv = $(&#8220;input[name=&#8217;ot_gv&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_gv==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_gv=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_total = accSub(accSub(accAdd(ot_subtotal,ot_shipping),ot_coupon),ot_gv);   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_total&#8217;]&#8221;).val(ot_total);   }   &nbsp;   function price_ex_onlive(order_id,final_price){   &nbsp; &nbsp; var products_qty_simple = &#8220;qty_&#8221;+order_id;   &nbsp; &nbsp; var products_qty = $(&#8220;input[name='&#8221;+products_qty_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp; var price_ex_value_simple = &#8220;price_ex_&#8221;+order_id;   &nbsp; &nbsp; var price_ex_value = $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; if(price_ex_value==&#8221;&#8221;){   &nbsp; &nbsp; &nbsp; &nbsp; alert(&#8220;\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u6570\u5b57\uff0c\u4ef7\u683c\u5c06\u6062\u590d\u5230\u539f\u59cb\u503c\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u6b63\u786e\u7684\u4ef7\u683c\u3002&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val(final_price);   &nbsp; &nbsp; &nbsp; &nbsp; var price_ex_value = $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp; }   &nbsp; &nbsp; var total_ex_value = (accMul(price_ex_value,products_qty)).toFixed(2);   &nbsp; &nbsp; var total_ex = &#8220;total_ex_&#8221;+order_id;   &nbsp; &nbsp; var total_ex_hidden = &#8220;total_ex_hidden_&#8221;+order_id;   &nbsp; &nbsp; var price_inc = &#8220;price_inc_&#8221;+order_id;   &nbsp; &nbsp; var total_inc = &#8220;total_inc_&#8221;+order_id;   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_ex+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp; $(&#8220;#&#8221;+total_ex_hidden).text(total_ex_value);   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+price_inc+&#8221;&#8216;]&#8221;).val(price_ex_value);   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_inc+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; var str=0;   &nbsp; &nbsp; $(&#8220;#price_total p&#8221;).each(function (i){   &nbsp; &nbsp; &nbsp; &nbsp; str = &nbsp;accAdd(str,parseFloat($(this).text()));   &nbsp; &nbsp; })   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val(str);   &nbsp;   &nbsp; &nbsp; var ot_subtotal = parseFloat($(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_coupon = $(&#8220;input[name=&#8217;ot_coupon&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_coupon==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_coupon=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_gv = $(&#8220;input[name=&#8217;ot_gv&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_gv==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_gv=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_shipping = parseFloat($(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_total = accSub(accSub(accAdd(ot_subtotal,ot_shipping),ot_coupon),ot_gv);   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_total&#8217;]&#8221;).val(ot_total);   }   &nbsp;   function qty_onlive(order_id,qty){   &nbsp; &nbsp; var products_qty_simple = &#8220;qty_&#8221;+order_id;   &nbsp; &nbsp; var products_qty = parseInt($(&#8220;input[name='&#8221;+products_qty_simple+&#8221;&#8216;]&#8221;).val());   &nbsp; &nbsp; if(isNaN(products_qty) || products_qty==0){   &nbsp; &nbsp; &nbsp; &nbsp; alert(&#8220;\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u6570\u5b57\uff0c\u6570\u91cf\u5c06\u6062\u590d\u5230\u539f\u59cb\u503c\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u6b63\u786e\u7684\u6570\u91cf\u3002&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; products_qty=qty;   &nbsp; &nbsp; }   &nbsp; &nbsp; var price_ex_value_simple = &#8220;price_ex_&#8221;+order_id;   &nbsp; &nbsp; var price_ex_value = $(&#8220;input[name='&#8221;+price_ex_value_simple+&#8221;&#8216;]&#8221;).val();   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+products_qty_simple+&#8221;&#8216;]&#8221;).val(products_qty);   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; var total_ex_value = (accMul(price_ex_value,products_qty)).toFixed(2);   &nbsp; &nbsp; var total_ex = &#8220;total_ex_&#8221;+order_id;   &nbsp; &nbsp; var total_ex_hidden = &#8220;total_ex_hidden_&#8221;+order_id;   &nbsp; &nbsp; var price_inc = &#8220;price_inc_&#8221;+order_id;   &nbsp; &nbsp; var total_inc = &#8220;total_inc_&#8221;+order_id;   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_ex+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp; $(&#8220;#&#8221;+total_ex_hidden).text(total_ex_value);   &nbsp; &nbsp; $(&#8220;input[name='&#8221;+total_inc+&#8221;&#8216;]&#8221;).val(total_ex_value);   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; var str=0;   &nbsp; &nbsp; $(&#8220;#price_total p&#8221;).each(function (i){   &nbsp; &nbsp; &nbsp; &nbsp; str = &nbsp;accAdd(str,parseFloat($(this).text()));   &nbsp; &nbsp; })   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val(str);   &nbsp;   &nbsp; &nbsp; var ot_subtotal = parseFloat($(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_coupon = $(&#8220;input[name=&#8217;ot_coupon&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_coupon==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_coupon=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_gv = $(&#8220;input[name=&#8217;ot_gv&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_gv==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_gv=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_shipping = parseFloat($(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_total = accSub(accSub(accAdd(ot_subtotal,ot_shipping),ot_coupon),ot_gv);   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_total&#8217;]&#8221;).val(ot_total);   }   &nbsp;   function shipping_onlive(shipping_total){   &nbsp; &nbsp; var ot_shipping = $(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_shipping==&#8221;&#8221;){   &nbsp; &nbsp; &nbsp; &nbsp; alert(&#8220;\u4f60\u8f93\u5165\u7684\u4e0d\u662f\u6570\u5b57\uff0c\u8fd0\u8d39\u5c06\u6062\u590d\u5230\u539f\u59cb\u503c\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u6b63\u786e\u7684\u8fd0\u8d39\u3002&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val(shipping_total);   &nbsp; &nbsp; &nbsp; &nbsp; var ot_shipping = parseFloat($(&#8220;input[name=&#8217;ot_shipping&#8217;]&#8221;).val());   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_subtotal = parseFloat($(&#8220;input[name=&#8217;ot_subtotal&#8217;]&#8221;).val());   &nbsp; &nbsp; var ot_coupon = $(&#8220;input[name=&#8217;ot_coupon&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_coupon==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_coupon=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_gv = $(&#8220;input[name=&#8217;ot_gv&#8217;]&#8221;).val();   &nbsp; &nbsp; if(ot_gv==undefined){   &nbsp; &nbsp; &nbsp; &nbsp; ot_gv=0;   &nbsp; &nbsp; }   &nbsp; &nbsp; var ot_total = accSub(accSub(accAdd(ot_subtotal,ot_shipping),ot_coupon),ot_gv);   &nbsp; &nbsp; $(&#8220;input[name=&#8217;ot_total&#8217;]&#8221;).val(ot_total);   }   &nbsp;   &lt;?php \/\/\u5f15\u5165\u4e00\u4e2ajquery\u5e93\uff0c\u7136\u540e\u5c31\u662f\u63a7\u5236\u4fee\u6539\u4ef7\u683c\u7684Jquery\u4ee3\u7801 BOF ?&gt;   &nbsp;   &lt;\/script&gt;   &lt;\/head&gt;   &lt;body onLoad=&#8221;init()&#8221;&gt;   &lt;div id=&#8221;spiffycalendar&#8221; class=&#8221;text&#8221;&gt;&lt;\/div&gt;   &lt;!&#8211; header \/\/&#8211;&gt;   &lt;div class=&#8221;header-area&#8221;&gt;   &lt;?php   &nbsp; require(DIR_WS_INCLUDES . &#8216;header.php&#8217;);   ?&gt;   &lt;\/div&gt;   &lt;!&#8211; header_eof \/\/&#8211;&gt;   &nbsp;   &lt;!&#8211; body \/\/&#8211;&gt;   &lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;2&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &lt;tr&gt;   &lt;!&#8211; body_text \/\/&#8211;&gt;   &nbsp;   &lt;?php if ($action == &#8221;) { ?&gt;   &lt;!&#8211; search &#8211;&gt;   &nbsp; &nbsp; &lt;td width=&#8221;100%&#8221; valign=&#8221;top&#8221;&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;0&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&lt;?php echo zen_draw_form(&#8216;search&#8217;, FILENAME_ORDERS, &#8221;, &#8216;get&#8217;, &#8221;, true); ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&#8221;65%&#8221; class=&#8221;pageHeading&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, 1, HEADING_IMAGE_HEIGHT); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td colspan=&#8221;2&#8243; class=&#8221;smallText&#8221; align=&#8221;right&#8221;&gt;   &lt;?php   \/\/ show reset search   &nbsp; if ((isset($_GET[&#8216;search&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search&#8217;])) or $_GET[&#8216;cID&#8217;] !=&#8221; or isset($_GET[&#8216;start&#8217;]) or isset($_GET[&#8216;end&#8217;])) {   &nbsp; &nbsp; echo &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, &#8221;, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_reset.gif&#8217;, IMAGE_RESET) . &#8216;&lt;\/a&gt;&lt;br \/&gt;&#8217;;   &nbsp; }   ?&gt;   &lt;?php   &nbsp; echo &nbsp;&#8216;Search by orders num or Customer Information:&#8217; . zen_draw_input_field(&#8216;search&#8217;) . zen_hide_session_id();   &nbsp; if (isset($_GET[&#8216;search&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search&#8217;])) {   &nbsp; &nbsp; $keywords = zen_db_input(zen_db_prepare_input($_GET[&#8216;search&#8217;]));   &nbsp; &nbsp; echo &#8216;&lt;br\/ &gt;&#8217; . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;   &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/form&gt;   &nbsp;   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;?php echo zen_draw_form(&#8216;search_orders_products&#8217;, FILENAME_ORDERS, &#8221;, &#8216;get&#8217;, &#8221;, true); ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, 1, HEADING_IMAGE_HEIGHT); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td colspan=&#8221;2&#8243; class=&#8221;smallText&#8221; align=&#8221;right&#8221;&gt;   &lt;?php   \/\/ show reset search orders_products   &nbsp; if ((isset($_GET[&#8216;search_orders_products&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search_orders_products&#8217;])) or $_GET[&#8216;cID&#8217;] !=&#8221;) {   &nbsp; &nbsp; echo &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, &#8221;, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_reset.gif&#8217;, IMAGE_RESET) . &#8216;&lt;\/a&gt;&lt;br \/&gt;&#8217;;   &nbsp; }   ?&gt;   &lt;?php   &nbsp; echo HEADING_TITLE_SEARCH_DETAIL_ORDERS_PRODUCTS . &#8216; &#8216; . zen_draw_input_field(&#8216;search_orders_products&#8217;) . zen_hide_session_id();   &nbsp; if (isset($_GET[&#8216;search_orders_products&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search_orders_products&#8217;])) {   &nbsp; &nbsp; $keywords_orders_products = zen_db_input(zen_db_prepare_input($_GET[&#8216;search_orders_products&#8217;]));   &nbsp; &nbsp; echo &#8216;&lt;br\/ &gt;&#8217; . TEXT_INFO_SEARCH_DETAIL_FILTER_ORDERS_PRODUCTS . zen_db_prepare_input($keywords_orders_products);   &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/form&gt;   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&#8221;100%&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table &nbsp;cellspacing=&#8221;0&#8243; cellpadding=&#8221;0&#8243; width=&#8221;100%&#8221; border=&#8221;0&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tbody&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221;&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, 1, HEADING_IMAGE_HEIGHT); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;table cellspacing=&#8221;0&#8243; cellpadding=&#8221;0&#8243; width=&#8221;0%&#8221; border=&#8221;0&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tbody&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;form method=&#8221;get&#8221; action=&#8221;orders.php&#8221; name=&#8221;new_special&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php if(!empty($_GET[&#8216;cID&#8217;])) {?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=&#8221;hidden&#8221; name=&#8221;cID&#8221; value=&lt;?php echo $_GET[&#8216;cID&#8217;]; ?&gt;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php } ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;script language=&#8221;javascript&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var StartDate = new ctlSpiffyCalendarBox(&#8220;StartDate&#8221;, &#8220;new_special&#8221;, &#8220;start&#8221;, &#8220;btnDate1&#8243;,&#8221;&lt;?php echo (($sInfo-&gt;specials_date_available == &#8216;0001-01-01&#8217;) ? &#8221; : zen_date_short($sInfo-&gt;specials_date_available)); ?&gt;&#8221;,scBTNMODE_CUSTOMBLUE);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var EndDate = new ctlSpiffyCalendarBox(&#8220;EndDate&#8221;, &#8220;new_special&#8221;, &#8220;end&#8221;, &#8220;btnDate2&#8243;,&#8221;&lt;?php echo (($sInfo-&gt;expires_date == &#8216;0001-01-01&#8217;) ? &#8221; : zen_date_short($sInfo-&gt;expires_date)); ?&gt;&#8221;,scBTNMODE_CUSTOMBLUE);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/script&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;script&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.onreadystatechange = function () { &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(document.readyState==&#8221;complete&#8221;) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var obj=document.getElementById(&#8220;total&#8221;).innerHTML;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(&#8220;allOrderTotal&#8221;).innerHTML=&#8221;$&#8221;+obj;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function showTotal(){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var obj=document.getElementById(&#8220;total&#8221;).innerHTML;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(&#8220;allOrderTotal&#8221;).innerHTML=&#8221;$&#8221;+obj;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/script&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;left&#8221; colspan=2&gt;All Order Total: &lt;span id=&#8221;allOrderTotal&#8221;&gt;&lt;\/span&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&#8221;5%&#8221; align=&#8221;right&#8221;&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221;&gt;&lt;?php echo &#8220;Orders start date&#8221;; ?&gt;&amp;nbsp;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221;&gt;&lt;script language=&#8221;javascript&#8221;&gt;StartDate.writeControl(); StartDate.dateFormat=&#8221;&lt;?php echo &#8220;yyyy\/MM\/dd&#8221;; ?&gt;&#8221;;&lt;\/script&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&#8221;5%&#8221; align=&#8221;right&#8221;&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221;&gt;&lt;?php echo &#8220;Orders end date&#8221;; ?&gt;&amp;nbsp;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221;&gt;&lt;script language=&#8221;javascript&#8221;&gt;EndDate.writeControl(); EndDate.dateFormat=&#8221;&lt;?php echo &#8220;yyyy\/MM\/dd&#8221;; ?&gt;&#8221;;&lt;\/script&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&#8221;180px&#8221; align=&#8221;center&#8221;&gt;&lt;?php echo zen_image_submit(&#8216;button_search.gif&#8217;,&#8221;)?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/form&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tbody&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tbody&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;!&#8211; search &#8211;&gt;   &lt;?php } ?&gt;   &nbsp;   &nbsp;   &lt;?php   &nbsp; if (($action == &#8216;edit&#8217;) &amp;&amp; ($order_exists == true)) {   &nbsp; &nbsp; $order = new order($oID);   &nbsp; &nbsp; if ($order-&gt;info[&#8216;payment_module_code&#8217;]) {   &nbsp; &nbsp; &nbsp; if (file_exists(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;)) {   &nbsp; &nbsp; &nbsp; &nbsp; require(DIR_FS_CATALOG_MODULES . &#8216;payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; require(DIR_FS_CATALOG_LANGUAGES . $_SESSION[&#8216;language&#8217;] . &#8216;\/modules\/payment\/&#8217; . $order-&gt;info[&#8216;payment_module_code&#8217;] . &#8216;.php&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; $module = new $order-&gt;info[&#8216;payment_module_code&#8217;];   \/\/ &nbsp; &nbsp; &nbsp; &nbsp;echo $module-&gt;admin_notification($oID);   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&#8221;100%&#8221;&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;0&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221;&gt;&lt;?php echo HEADING_TITLE; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, 1, HEADING_IMAGE_HEIGHT); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo &#8216;&lt;a href=&#8221;javascript:history.back()&#8221;&gt;&#8217; . zen_image_button(&#8216;button_back.gif&#8217;, IMAGE_BACK) . &#8216;&lt;\/a&gt;&#8217;; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;table width=&#8221;100%&#8221; border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td colspan=&#8221;3&#8243;&gt;&lt;?php echo zen_draw_separator(); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td valign=&#8221;top&#8221;&gt;&lt;table width=&#8221;100%&#8221; border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_CUSTOMER; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo zen_address_format($order-&gt;customer[&#8216;format_id&#8217;], $order-&gt;customer, 1, &#8221;, &#8216;&lt;br \/&gt;&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td colspan=&#8221;2&#8243;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8216;5&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_TELEPHONE_NUMBER; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;customer[&#8216;telephone&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_EMAIL_ADDRESS; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo &#8216;&lt;a href=&#8221;mailto:&#8217; . $order-&gt;customer[&#8217;email_address&#8217;] . &#8216;&#8221;&gt;&#8217; . $order-&gt;customer[&#8217;email_address&#8217;] . &#8216;&lt;\/a&gt;&#8217;; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo TEXT_INFO_IP_ADDRESS; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;info[&#8216;ip_address&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td valign=&#8221;top&#8221;&gt;&lt;table width=&#8221;100%&#8221; border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_SHIPPING_ADDRESS; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo zen_address_format($order-&gt;delivery[&#8216;format_id&#8217;], $order-&gt;delivery, 1, &#8221;, &#8216;&lt;br \/&gt;&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td valign=&#8221;top&#8221;&gt;&lt;table width=&#8221;100%&#8221; border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_BILLING_ADDRESS; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo zen_address_format($order-&gt;billing[&#8216;format_id&#8217;], $order-&gt;billing, 1, &#8221;, &#8216;&lt;br \/&gt;&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8217;10&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_ORDER_ID . $order-&gt;info[&#8216;num&#8217;]; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;table border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_DATE_PURCHASED; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;main&#8221;&gt;&lt;?php echo zen_date_long($order-&gt;info[&#8216;date_purchased&#8217;]); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_PAYMENT_METHOD; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;info[&#8216;payment_method&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; &nbsp; if (zen_not_null($order-&gt;info[&#8216;cc_type&#8217;]) || zen_not_null($order-&gt;info[&#8216;cc_owner&#8217;]) || zen_not_null($order-&gt;info[&#8216;cc_number&#8217;])) {   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td colspan=&#8221;2&#8243;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8217;10&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo ENTRY_CREDIT_CARD_TYPE; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;info[&#8216;cc_type&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo ENTRY_CREDIT_CARD_OWNER; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;info[&#8216;cc_owner&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo ENTRY_CREDIT_CARD_NUMBER; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;info[&#8216;cc_number&#8217;] . (zen_not_null($order-&gt;info[&#8216;cc_number&#8217;]) &amp;&amp; !strstr($order-&gt;info[&#8216;cc_number&#8217;],&#8217;X&#8217;) &amp;&amp; !strstr($order-&gt;info[&#8216;cc_number&#8217;],&#8217;********&#8217;) ? &#8216;&amp;nbsp;&amp;nbsp;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, &#8216;&amp;action=mask_cc&amp;oID=&#8217; . $oID, &#8216;NONSSL&#8217;) . &#8216;&#8221; class=&#8221;noprint&#8221;&gt;&#8217; . TEXT_MASK_CC_NUMBER . &#8216;&lt;\/a&gt;&#8217; : &#8221;); ?&gt;&lt;td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php if (zen_not_null($order-&gt;info[&#8216;cc_cvv&#8217;])) { ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo ENTRY_CREDIT_CARD_CVV; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;info[&#8216;cc_cvv&#8217;] . (zen_not_null($order-&gt;info[&#8216;cc_cvv&#8217;]) &amp;&amp; !strstr($order-&gt;info[&#8216;cc_cvv&#8217;],TEXT_DELETE_CVV_REPLACEMENT) ? &#8216;&amp;nbsp;&amp;nbsp;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, &#8216;&amp;action=delete_cvv&amp;oID=&#8217; . $oID, &#8216;NONSSL&#8217;) . &#8216;&#8221; class=&#8221;noprint&#8221;&gt;&#8217; . TEXT_DELETE_CVV_FROM_DATABASE . &#8216;&lt;\/a&gt;&#8217; : &#8221;); ?&gt;&lt;td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php } ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo ENTRY_CREDIT_CARD_EXPIRES; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;?php echo $order-&gt;info[&#8216;cc_expires&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; &nbsp; &nbsp; if (method_exists($module, &#8216;admin_notification&#8217;)) {   ?&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8217;10&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo $module-&gt;admin_notification($oID); ?&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8217;10&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   }   ?&gt;   &nbsp;   &lt;?php&nbsp;   &nbsp; &nbsp; \/\/\u4ece\u8fd9\u91cc\u5f00\u59cb\uff0c\u8bbe\u5b9a\u4e3a\u4ed8\u6b3e\u8ba2\u5355\u624d\u80fd\u4fee\u6539\u4ef7\u683c\uff0c5\u4e3a\u4e3a\u4ed8\u6b3e\u9009\u9879\u7684ID   &nbsp; &nbsp; if($order-&gt;info[&#8216;orders_status&#8217;] == 5){   ?&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;form action=&#8221;&#8221; method=&#8221;post&#8221;&gt;&lt;td align=&#8221;right&#8221;&gt;&lt;input type=&#8221;hidden&#8221; name=&#8221;currencies_key&#8221; value=&#8221;&lt;?php echo $order-&gt;info[&#8216;currency&#8217;]; ?&gt;&#8221;&gt;&lt;input type=&#8221;hidden&#8221; name=&#8221;currencies_value&#8221; value=&#8221;&lt;?php echo $order-&gt;info[&#8216;currency_value&#8217;]; ?&gt;&#8221;&gt;&lt;input type=&#8221;button&#8221; value=&#8221;\u7f16\u8f91&#8221; id=&#8221;orders_edit&#8221;&gt;&lt;input style=&#8221;display: none&#8221; type=&#8221;submit&#8221; value=&#8221;\u63d0\u4ea4&#8221; id=&#8221;orders_submit&#8221;&gt;&lt;input style=&#8221;display: none&#8221; type=&#8221;button&#8221; value=&#8221;\u53d6\u6d88&#8221; id=&#8221;orders_reset&#8221;&gt;&lt;\/td&gt;&lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr id=&#8221;products_list_changes&#8221; style=&#8221;display: none&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr class=&#8221;dataTableHeadingRow&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221;&gt;&lt;?php echo Image; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; colspan=&#8221;2&#8243;&gt;&lt;?php echo TABLE_HEADING_PRODUCTS; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221;&gt;&lt;?php echo TABLE_HEADING_PRODUCTS_MODEL; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt; &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp;   &lt;?php   &nbsp;   &nbsp; &nbsp; for ($i=0, $n=sizeof($order-&gt;products); $i&lt;$n; $i++) { &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; $price_input='&lt;input onblur=&#8221;price_ex_onlive(&#8216;.$order-&gt;products[$i][&#8216;id&#8217;].&#8217;,&#8217;.preg_replace( &#8216;\/[^\\d\\.]\/&#8217;, &#8221;,$currencies-&gt;format($order-&gt;products[$i][&#8216;final_price&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;])).&#8217;)&#8221; onKeyUp=&#8221;change_price_ex(&#8216;.$order-&gt;products[$i][&#8216;id&#8217;].&#8217;,&#8217;.preg_replace( &#8216;\/[^\\d\\.]\/&#8217;, &#8221;,$currencies-&gt;format($order-&gt;products[$i][&#8216;final_price&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;])).&#8217;)&#8221; size=&#8221;6&#8243; type=&#8221;text&#8221; value=&#8221;&#8216;;&nbsp;   &nbsp; &nbsp; &nbsp; $qty_input = &#8216;&lt;input onblur=&#8221;qty_onlive(&#8216;.$order-&gt;products[$i][&#8216;id&#8217;].&#8217;,&#8217;.$order-&gt;products[$i][&#8216;qty&#8217;].&#8217;)&#8221; onKeyUp=&#8221;change_qty(&#8216;.$order-&gt;products[$i][&#8216;id&#8217;].&#8217;)&#8221; size=&#8221;6&#8243; type=&#8221;text&#8221; value=&#8221;&#8216;;   &nbsp; &nbsp; &nbsp; $total_input='&lt;input readonly size=&#8221;6&#8243; type=&#8221;text&#8221; value=&#8221;&#8216;;&nbsp;   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr class=&#8221;dataTableRow&#8221;&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;img src=&#8221;..\/images\/&#8217;.$order-&gt;products[$i][&#8216;image&#8217;].'&#8221; heiht=&#8221;80&#8243; width=&#8221;80&#8243;\/&gt;&lt;\/td&gt;&#8217;.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; valign=&#8221;top&#8221; align=&#8221;right&#8221; style=&#8221;color:c00&#8243;&gt;&#8217; . $qty_input . $order-&gt;products[$i][&#8216;qty&#8217;] . &#8216;&#8221; name=&#8221;qty_&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221;&gt;&amp;nbsp;x&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; valign=&#8221;top&#8221;&gt;&lt;a href=&#8221;&#8216;.HTTP_SERVER.DIR_WS_CATALOG.&#8217;index.php?main_page=product_info&amp;products_id=&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221; target=_blank&gt;&#8217;. $order-&gt;products[$i][&#8216;name&#8217;];   &nbsp;   &nbsp; &nbsp; &nbsp; if (isset($order-&gt;products[$i][&#8216;attributes&#8217;]) &amp;&amp; (sizeof($order-&gt;products[$i][&#8216;attributes&#8217;]) &gt; 0)) {   &nbsp; &nbsp; &nbsp; &nbsp; for ($j = 0, $k = sizeof($order-&gt;products[$i][&#8216;attributes&#8217;]); $j &lt; $k; $j++) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&lt;nobr&gt;&lt;small&gt;&amp;nbsp;&lt;i&gt; &#8211; &#8216; . $order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;option&#8217;] . &#8216;: &#8216; . nl2br(zen_output_string_protected($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;value&#8217;]));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;price&#8217;] != &#8216;0&#8217;) echo &#8216; (&#8216; . $order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;prefix&#8217;] . $currencies-&gt;format($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;price&#8217;] * $order-&gt;products[$i][&#8216;qty&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) . &#8216;)&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;product_attribute_is_free&#8217;] == &#8216;1&#8217; and $order-&gt;products[$i][&#8216;product_is_free&#8217;] == &#8216;1&#8217;) echo TEXT_INFO_ATTRIBUTE_FREE;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;\/i&gt;&lt;\/small&gt;&lt;\/nobr&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/a&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; valign=&#8221;top&#8221;&gt;&#8217; . $order-&gt;products[$i][&#8216;model&#8217;] . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&#8217; . zen_display_tax_value($order-&gt;products[$i][&#8216;tax&#8217;]) . &#8216;%&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&#8217; .$price_input.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; preg_replace( &#8216;\/[^\\d\\.]\/&#8217;, &#8221;,$currencies-&gt;format($order-&gt;products[$i][&#8216;final_price&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;])).   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; name=&#8221;price_ex_&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221;&gt;&#8217;.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format($order-&gt;products[$i][&#8216;onetime_charges&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&lt;strong&gt;&#8217; . $total_input.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; preg_replace( &#8216;\/[^\\d\\.]\/&#8217;, &#8221;,$currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;final_price&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]), true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;])).   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; name=&#8221;price_inc_&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221;&gt;&#8217;.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;onetime_charges&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]), true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&#8217; . $total_input.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; preg_replace( &#8216;\/[^\\d\\.]\/&#8217;, &#8221;,$currencies-&gt;format($order-&gt;products[$i][&#8216;final_price&#8217;] * $order-&gt;products[$i][&#8216;qty&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;])) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; name=&#8221;total_ex_&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221;&gt;&#8217;.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format($order-&gt;products[$i][&#8216;onetime_charges&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&#8217; .$total_input.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; preg_replace( &#8216;\/[^\\d\\.]\/&#8217;, &#8221;,$currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;final_price&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]) * $order-&gt;products[$i][&#8216;qty&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;])) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&#8221; name=&#8221;total_inc_&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221;&gt;&#8217;.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;onetime_charges&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]), true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/tr&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;input type=&#8221;hidden&#8221; name=&#8221;reference_oid[]&#8221; value=&#8221;&#8216;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221;&gt;&#8217;;   &nbsp; &nbsp; }   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; echo &#8216;&lt;div style=&#8221;display:none&#8221; id=&#8221;price_total&#8221;&gt;&#8217;;   &nbsp; &nbsp; for ($i=0, $n=sizeof($order-&gt;products); $i&lt;$n; $i++){   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;p id=&#8221;total_ex_hidden_&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221; &gt;&#8217;.preg_replace( &#8216;\/[^\\d\\.]\/&#8217;, &#8221;,$currencies-&gt;format($order-&gt;products[$i][&#8216;final_price&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;])) * $order-&gt;products[$i][&#8216;qty&#8217;].'&lt;\/p&gt;&#8217;;   &nbsp; &nbsp; }   &nbsp; &nbsp; echo &#8216;&lt;div&gt;&#8217;;   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221; colspan=&#8221;9&#8243;&gt;&lt;table border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &lt;?php   &nbsp; &nbsp; for ($i = 0, $n = sizeof($order-&gt;totals); $i &lt; $n; $i++) {   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td align=&#8221;right&#8221; class=&#8221;&#8216;. str_replace(&#8216;_&#8217;, &#8216;-&#8216;, $order-&gt;totals[$i][&#8216;class&#8217;]) . &#8216;-Text&#8221;&gt;&#8217; . $order-&gt;totals[$i][&#8216;title&#8217;] . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; ;   &nbsp; &nbsp; &nbsp; if($order-&gt;totals[$i][&#8216;class&#8217;] == &#8220;ot_shipping&#8221;){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td align=&#8221;right&#8221; &nbsp;class=&#8221;&#8216;. str_replace(&#8216;_&#8217;, &#8216;-&#8216;, $order-&gt;totals[$i][&#8216;class&#8217;]) . &#8216;-Amount&#8221;&gt;&lt;input onblur=&#8221;shipping_onlive(&#8216;.preg_replace(&#8220;\/[^\\d\\.]\/&#8221;, &#8220;&#8221;, $order-&gt;totals[$i][&#8216;text&#8217;]).&#8217;)&#8221; onKeyUp=&#8221;change_shipping(&#8216;.preg_replace(&#8220;\/[^\\d\\.]\/&#8221;, &#8220;&#8221;, $order-&gt;totals[$i][&#8216;text&#8217;]).&#8217;)&#8221; size=&#8221;6&#8243; type=&#8221;text&#8221; value=&#8221;&#8216; . preg_replace(&#8220;\/[^\\d\\.]\/&#8221;, &#8220;&#8221;, $order-&gt;totals[$i][&#8216;text&#8217;]) . &#8216;&#8221; name=&#8221;&#8216;.$order-&gt;totals[$i][&#8216;class&#8217;].'&#8221;&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; else{   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td align=&#8221;right&#8221; class=&#8221;&#8216;. str_replace(&#8216;_&#8217;, &#8216;-&#8216;, $order-&gt;totals[$i][&#8216;class&#8217;]) . &#8216;-Amount&#8221;&gt;&lt;input readonly size=&#8221;6&#8243; type=&#8221;text&#8221; value=&#8221;&#8216; . preg_replace(&#8220;\/[^\\d\\.]\/&#8221;, &#8220;&#8221;, $order-&gt;totals[$i][&#8216;text&#8217;]) . &#8216;&#8221; name=&#8221;&#8216;.$order-&gt;totals[$i][&#8216;class&#8217;].'&#8221;&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/tr&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;\/form&gt;   &lt;?php   }   ?&gt;   &lt;?php \/\/\u4fee\u6539\u4e3a\u4ed8\u6b3e\u8ba2\u5355\u4ee3\u7801\u4ece\u8fd9\u91cc\u7ed3\u675f ?&gt;   &nbsp;   &nbsp; &nbsp; &nbsp; &lt;tr id=&#8221;products_list_default&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr class=&#8221;dataTableHeadingRow&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221;&gt;&lt;?php echo Image; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; colspan=&#8221;2&#8243;&gt;&lt;?php echo TABLE_HEADING_PRODUCTS; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221;&gt;&lt;?php echo TABLE_HEADING_PRODUCTS_MODEL; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; &nbsp; for ($i=0, $n=sizeof($order-&gt;products); $i&lt;$n; $i++) { &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr class=&#8221;dataTableRow&#8221;&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td&gt;&lt;img src=&#8221;..\/images\/&#8217;.$order-&gt;products[$i][&#8216;image&#8217;].'&#8221; heiht=&#8221;80&#8243; width=&#8221;80&#8243;\/&gt;&lt;\/td&gt;&#8217;.   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; valign=&#8221;top&#8221; align=&#8221;right&#8221; style=&#8221;color:c00&#8243;&gt;&#8217; . $order-&gt;products[$i][&#8216;qty&#8217;] . &#8216;&amp;nbsp;x&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; valign=&#8221;top&#8221;&gt;&lt;a href=&#8221;&#8216;.HTTP_SERVER.DIR_WS_CATALOG.&#8217;index.php?main_page=product_info&amp;products_id=&#8217;.$order-&gt;products[$i][&#8216;id&#8217;].'&#8221; target=_blank&gt;&#8217;. $order-&gt;products[$i][&#8216;name&#8217;];   &nbsp;   &nbsp; &nbsp; &nbsp; if (isset($order-&gt;products[$i][&#8216;attributes&#8217;]) &amp;&amp; (sizeof($order-&gt;products[$i][&#8216;attributes&#8217;]) &gt; 0)) {   &nbsp; &nbsp; &nbsp; &nbsp; for ($j = 0, $k = sizeof($order-&gt;products[$i][&#8216;attributes&#8217;]); $j &lt; $k; $j++) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br \/&gt;&lt;nobr&gt;&lt;small&gt;&amp;nbsp;&lt;i&gt; &#8211; &#8216; . $order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;option&#8217;] . &#8216;: &#8216; . nl2br(zen_output_string_protected($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;value&#8217;]));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;price&#8217;] != &#8216;0&#8217;) echo &#8216; (&#8216; . $order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;prefix&#8217;] . $currencies-&gt;format($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;price&#8217;] * $order-&gt;products[$i][&#8216;qty&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) . &#8216;)&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;product_attribute_is_free&#8217;] == &#8216;1&#8217; and $order-&gt;products[$i][&#8216;product_is_free&#8217;] == &#8216;1&#8217;) echo TEXT_INFO_ATTRIBUTE_FREE;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;\/i&gt;&lt;\/small&gt;&lt;\/nobr&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/a&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; valign=&#8221;top&#8221;&gt;&#8217; . $order-&gt;products[$i][&#8216;model&#8217;] . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&#8217; . zen_display_tax_value($order-&gt;products[$i][&#8216;tax&#8217;]) . &#8216;%&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&#8217; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $currencies-&gt;format($order-&gt;products[$i][&#8216;final_price&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format($order-&gt;products[$i][&#8216;onetime_charges&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&#8217; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;final_price&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]), true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;onetime_charges&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]), true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&#8217; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $currencies-&gt;format($order-&gt;products[$i][&#8216;final_price&#8217;] * $order-&gt;products[$i][&#8216;qty&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format($order-&gt;products[$i][&#8216;onetime_charges&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; valign=&#8221;top&#8221;&gt;&lt;strong&gt;&#8217; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;final_price&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]) * $order-&gt;products[$i][&#8216;qty&#8217;], true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ($order-&gt;products[$i][&#8216;onetime_charges&#8217;] != 0 ? &#8216;&lt;br \/&gt;&#8217; . $currencies-&gt;format(zen_add_tax($order-&gt;products[$i][&#8216;onetime_charges&#8217;], $order-&gt;products[$i][&#8216;tax&#8217;]), true, $order-&gt;info[&#8216;currency&#8217;], $order-&gt;info[&#8216;currency_value&#8217;]) : &#8221;) .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;&lt;\/strong&gt;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/tr&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221; colspan=&#8221;9&#8243;&gt;&lt;table border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &lt;?php   &nbsp; &nbsp; for ($i = 0, $n = sizeof($order-&gt;totals); $i &lt; $n; $i++) {   &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td align=&#8221;right&#8221; class=&#8221;&#8216;. str_replace(&#8216;_&#8217;, &#8216;-&#8216;, $order-&gt;totals[$i][&#8216;class&#8217;]) . &#8216;-Text&#8221;&gt;&#8217; . $order-&gt;totals[$i][&#8216;title&#8217;] . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td align=&#8221;right&#8221; class=&#8221;&#8216;. str_replace(&#8216;_&#8217;, &#8216;-&#8216;, $order-&gt;totals[$i][&#8216;class&#8217;]) . &#8216;-Amount&#8221;&gt;&#8217; . $order-&gt;totals[$i][&#8216;text&#8217;] . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/tr&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp;   &lt;?php   &nbsp; \/\/ show downloads   &nbsp; require(DIR_WS_MODULES . &#8216;orders_download.php&#8217;);   ?&gt;   &nbsp;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8217;10&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;table border=&#8221;1&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;5&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;center&#8221;&gt;&lt;strong&gt;&lt;?php echo TABLE_HEADING_DATE_ADDED; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;center&#8221;&gt;&lt;strong&gt;&lt;?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;center&#8221;&gt;&lt;strong&gt;&lt;?php echo TABLE_HEADING_STATUS; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;center&#8221;&gt;&lt;strong&gt;&lt;?php echo TABLE_HEADING_COMMENTS; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; &nbsp; $orders_history = $db-&gt;Execute(&#8220;select orders_status_id, date_added, customer_notified, comments   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &#8221; . TABLE_ORDERS_STATUS_HISTORY . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . zen_db_input($oID) . &#8220;&#8216;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; order by date_added&#8221;);   &nbsp;   &nbsp; &nbsp; if ($orders_history-&gt;RecordCount() &gt; 0) {   &nbsp; &nbsp; &nbsp; while (!$orders_history-&gt;EOF) {   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;smallText&#8221; align=&#8221;center&#8221;&gt;&#8217; . zen_datetime_short($orders_history-&gt;fields[&#8216;date_added&#8217;]) . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;smallText&#8221; align=&#8221;center&#8221;&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; if ($orders_history-&gt;fields[&#8216;customer_notified&#8217;] == &#8216;1&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo zen_image(DIR_WS_ICONS . &#8216;tick.gif&#8217;, TEXT_YES) . &#8220;&lt;\/td&gt;\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; } else if ($orders_history-&gt;fields[&#8216;customer_notified&#8217;] == &#8216;-1&#8217;) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo zen_image(DIR_WS_ICONS . &#8216;locked.gif&#8217;, TEXT_HIDDEN) . &#8220;&lt;\/td&gt;\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo zen_image(DIR_WS_ICONS . &#8216;unlocked.gif&#8217;, TEXT_VISIBLE) . &#8220;&lt;\/td&gt;\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;smallText&#8221;&gt;&#8217; . $orders_status_array[$orders_history-&gt;fields[&#8216;orders_status_id&#8217;]] . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;smallText&#8221;&gt;&#8217; . nl2br(zen_db_output($orders_history-&gt;fields[&#8216;comments&#8217;])) . &#8216;&amp;nbsp;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/tr&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; $orders_history-&gt;MoveNext();   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;smallText&#8221; colspan=&#8221;5&#8243;&gt;&#8217; . TEXT_NO_ORDER_HISTORY . &#8216;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/tr&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main noprint&#8221;&gt;&lt;br \/&gt;&lt;strong&gt;&lt;?php echo TABLE_HEADING_COMMENTS; ?&gt;&lt;\/strong&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;noprint&#8221;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8216;5&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;?php echo zen_draw_form(&#8216;status&#8217;, FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;)) . &#8216;action=update_order&#8217;, &#8216;post&#8217;, &#8221;, true); ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main noprint&#8221;&gt;&lt;?php echo zen_draw_textarea_field(&#8216;comments&#8217;, &#8216;soft&#8217;, &#8217;60&#8217;, &#8216;5&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, &#8216;1&#8217;, &#8217;10&#8217;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;table border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243; class=&#8221;noprint&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;table border=&#8221;0&#8243; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo &#8220;Tracking Number:&#8221;; ?&gt;&lt;\/strong&gt; &lt;?php echo zen_draw_input_field(&#8216;tracking_number&#8217;, $order-&gt;info[&#8216;tracking_number&#8217;]); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_STATUS; ?&gt;&lt;\/strong&gt; &lt;?php echo zen_draw_pull_down_menu(&#8216;status&#8217;, $orders_statuses, $order-&gt;info[&#8216;orders_status&#8217;]); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_NOTIFY_CUSTOMER; ?&gt;&lt;\/strong&gt; [&lt;?php echo zen_draw_radio_field(&#8216;notify&#8217;, &#8216;1&#8217;, true) . &#8216;-&#8216; . TEXT_EMAIL . &#8216; &#8216; . zen_draw_radio_field(&#8216;notify&#8217;, &#8216;0&#8217;, FALSE) . &#8216;-&#8216; . TEXT_NOEMAIL . &#8216; &#8216; . zen_draw_radio_field(&#8216;notify&#8217;, &#8216;-1&#8217;, FALSE) . &#8216;-&#8216; . TEXT_HIDE; ?&gt;]&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;main&#8221;&gt;&lt;strong&gt;&lt;?php echo ENTRY_NOTIFY_COMMENTS; ?&gt;&lt;\/strong&gt; &lt;?php echo zen_draw_checkbox_field(&#8216;notify_comments&#8217;, &#8221;, true); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;td&gt;&lt;br \/&gt;&lt;\/td&gt;&lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td valign=&#8221;top&#8221;&gt;&lt;?php echo zen_image_submit(&#8216;button_update.gif&#8217;, IMAGE_UPDATE); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/form&gt;&lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td colspan=&#8221;2&#8243; align=&#8221;right&#8221; class=&#8221;noprint&#8221;&gt;&lt;?php echo &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS_INVOICE, &#8216;oID=&#8217; . $_GET[&#8216;oID&#8217;]) . &#8216;&#8221; TARGET=&#8221;_blank&#8221;&gt;&#8217; . zen_image_button(&#8216;button_invoice.gif&#8217;, IMAGE_ORDERS_INVOICE) . &#8216;&lt;\/a&gt; &lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS_PACKINGSLIP, &#8216;oID=&#8217; . $_GET[&#8216;oID&#8217;]) . &#8216;&#8221; TARGET=&#8221;_blank&#8221;&gt;&#8217; . zen_image_button(&#8216;button_packingslip.gif&#8217;, IMAGE_ORDERS_PACKINGSLIP) . &#8216;&lt;\/a&gt; &lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;action&#8217;))) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_orders.gif&#8217;, IMAGE_ORDERS) . &#8216;&lt;\/a&gt;&#8217;; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   \/\/ check if order has open gv   &nbsp; &nbsp; &nbsp; &nbsp; $gv_check = $db-&gt;Execute(&#8220;select order_id, unique_id   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &#8221; . TABLE_COUPON_GV_QUEUE .&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where order_id = &#8216;&#8221; . $_GET[&#8216;oID&#8217;] . &#8220;&#8216; and release_flag=&#8217;N&#8217; limit 1&#8243;);   &nbsp; &nbsp; &nbsp; &nbsp; if ($gv_check-&gt;RecordCount() &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $goto_gv = &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_GV_QUEUE, &#8216;order=&#8217; . $_GET[&#8216;oID&#8217;]) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_gift_queue.gif&#8217;,IMAGE_GIFT_QUEUE) . &#8216;&lt;\/a&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&lt;td align=&#8221;right&#8221;&gt;&lt;table width=&#8221;225&#8243;&gt;&lt;tr&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td align=&#8221;center&#8221;&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $goto_gv . &#8216;&amp;nbsp;&amp;nbsp;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/td&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp;&lt;\/tr&gt;&lt;\/table&gt;&lt;\/td&gt;&lt;\/tr&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; }   ?&gt;   &lt;?php   &nbsp; } else {   ?&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td width=&#8221;100%&#8221;&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;0&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221;&gt;&lt;?php echo HEADING_TITLE; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;pageHeading&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo zen_draw_separator(&#8216;pixel_trans.gif&#8217;, 1, HEADING_IMAGE_HEIGHT); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td align=&#8221;right&#8221;&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;0&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;?php echo zen_draw_form(&#8216;orders_num&#8217;, FILENAME_ORDERS, &#8221;, &#8216;get&#8217;, &#8221;, true); ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo &#8216;order_num&#8217; . &#8216; &#8216; . zen_draw_input_field(&#8216;orders_num&#8217;, &#8221;, &#8216;size=&#8221;12&#8243;&#8216;) . zen_hide_session_id(); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/form&gt;&lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;&lt;?php echo zen_draw_form(&#8216;status&#8217;, FILENAME_ORDERS, &#8221;, &#8216;get&#8217;, &#8221;, true); ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;right&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo HEADING_TITLE_STATUS . &#8216; &#8216; . zen_draw_pull_down_menu(&#8216;status&#8217;, array_merge(array(array(&#8216;id&#8217; =&gt; &#8221;, &#8216;text&#8217; =&gt; TEXT_ALL_ORDERS)), $orders_statuses), $_GET[&#8216;status&#8217;], &#8216;onChange=&#8221;this.form.submit();&#8221;&#8216;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo zen_hide_session_id();   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/form&gt;&lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;0&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td class=&#8221;smallText&#8221;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo TEXT_LEGEND . &#8216; &#8216; . zen_image(DIR_WS_IMAGES . &#8216;icon_status_red.gif&#8217;, TEXT_BILLING_SHIPPING_MISMATCH, 10, 10) . &#8216; &#8216; . TEXT_BILLING_SHIPPING_MISMATCH; ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo zen_image(DIR_WS_IMAGES . &#8216;icon_green_on.gif&#8217;, IMAGE_ICON_STATUS_ON).&#8221;PCB Order&#8221;; ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo zen_image(DIR_WS_IMAGES . &#8216;icon_red_on.gif&#8217;, IMAGE_ICON_STATUS_ON).&#8221;PRE Order&#8221;; ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php echo zen_image(DIR_WS_IMAGES . &#8216;icon_yellow_on.gif&#8217;, IMAGE_ICON_STATUS_ON).&#8221;Customer Comments&#8221;; ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td valign=&#8221;top&#8221;&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr class=&#8221;dataTableHeadingRow&#8221;&gt;   &lt;?php   \/\/ Sort Listing   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch ($_GET[&#8216;list_order&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#8220;id-asc&#8221;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;c.customers_id&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#8220;firstname&#8221;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;c.customers_firstname&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#8220;firstname-desc&#8221;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;c.customers_firstname DESC&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#8220;lastname&#8221;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;c.customers_lastname, c.customers_firstname&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#8220;lastname-desc&#8221;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;c.customers_lastname DESC, c.customers_firstname&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#8220;company&#8221;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;a.entry_company&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case &#8220;company-desc&#8221;:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;a.entry_company DESC&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default:   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $disp_order = &#8220;c.customers_id DESC&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;center&#8221;&gt;&lt;?php echo TABLE_HEADING_ORDERS_ID; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;left&#8221; width=&#8221;50&#8243;&gt;&lt;?php echo TABLE_HEADING_PAYMENT_METHOD; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221;&gt;&lt;?php echo TABLE_HEADING_CUSTOMERS; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_ORDER_TOTAL; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;center&#8221;&gt;&lt;?php echo TABLE_HEADING_DATE_PURCHASED; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_STATUS; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;center&#8221;&gt;&lt;?php echo TABLE_HEADING_CUSTOMER_COMMENTS; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;center&#8221;&gt;&lt;input type=&#8221;checkbox&#8221; id=&#8221;select_all&#8221; onclick=&#8221;selectAll()&#8221;&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableHeadingContent&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo TABLE_HEADING_ACTION; ?&gt;&amp;nbsp;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp;   &lt;?php   \/\/ Only one or the other search   \/\/ create search_orders_products filter   &nbsp; $search = &#8221;;   &nbsp; $new_table = &#8221;;   &nbsp; $new_fields = &#8221;;   &nbsp; if (isset($_GET[&#8216;search_orders_products&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search_orders_products&#8217;])) {   &nbsp; &nbsp; $new_fields = &#8221;;   &nbsp; &nbsp; $search_distinct = &#8216; distinct &#8216;;   &nbsp; &nbsp; $new_table = &#8221; left join &#8221; . TABLE_ORDERS_PRODUCTS . &#8221; op on (op.orders_id = o.orders_id) &#8220;;   &nbsp; &nbsp; $keywords = zen_db_input(zen_db_prepare_input($_GET[&#8216;search_orders_products&#8217;]));   &nbsp; &nbsp; $search = &#8221; and (op.products_model like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or op.products_name like &#8216;%&#8221; . $keywords . &#8220;%&#8217;)&#8221;;   &nbsp; &nbsp; if (substr(strtoupper($_GET[&#8216;search_orders_products&#8217;]), 0, 3) == &#8216;ID:&#8217;) {   &nbsp; &nbsp; &nbsp; $keywords = TRIM(substr($_GET[&#8216;search_orders_products&#8217;], 3));   &nbsp; &nbsp; &nbsp; $search = &#8221; and op.products_id ='&#8221; . (int)$keywords . &#8220;&#8216;&#8221;;   &nbsp; &nbsp; }   &nbsp; } else {   ?&gt;   &lt;?php   \/\/ create search filter   &nbsp; $search = &#8221;;   &nbsp; if (isset($_GET[&#8216;search&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search&#8217;])) {   &nbsp; &nbsp; $search_distinct = &#8216; &#8216;;   &nbsp; &nbsp; $keywords = zen_db_input(zen_db_prepare_input($_GET[&#8216;search&#8217;]));   &nbsp; &nbsp; $search = &#8221; and (o.customers_city like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.orders_num like &#8216;%&#8221; . $keywords .&#8221;%&#8217; or o.customers_postcode like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.date_purchased like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.billing_name like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.billing_company like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.billing_street_address like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.delivery_city like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.delivery_postcode like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.delivery_name like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.delivery_company like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.delivery_street_address like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.billing_city like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.billing_postcode like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.customers_email_address like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.customers_name like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.customers_company like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.customers_street_address &nbsp;like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.customers_telephone like &#8216;%&#8221; . $keywords . &#8220;%&#8217; or o.ip_address &nbsp;like &#8216;%&#8221; . $keywords . &#8220;%&#8217;)&#8221;;   &nbsp; &nbsp; $new_table = &#8221;;   \/\/ &nbsp; &nbsp;$new_fields = &#8220;, o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.ip_address &#8220;;   &nbsp; }   &nbsp; if(isset($_GET[&#8216;orders_num&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;orders_num&#8217;])){   &nbsp; &nbsp; $search_distinct = &#8216; &#8216;;   &nbsp; &nbsp; $keywords = zen_db_input(zen_db_prepare_input($_GET[&#8216;orders_num&#8217;]));   &nbsp; &nbsp; $search = &#8221; and (o.orders_num like &#8216;%&#8221; .$keywords .&#8221;%&#8217;) &#8220;;   &nbsp; &nbsp; $new_table = &#8221;;   &nbsp; }   } \/\/ eof: search orders or orders_products   &nbsp; &nbsp; $new_fields = &#8220;, o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.ip_address &#8220;;   ?&gt;   &lt;?php   &nbsp; &nbsp; &nbsp; if (isset($_GET[&#8216;cID&#8217;])) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $cID = zen_db_prepare_input($_GET[&#8216;cID&#8217;]);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/add code   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(isset($_GET[&#8216;start&#8217;]) || isset($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($_GET[&#8216;start&#8217;]) &amp;&amp; empty($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $start_time = strtr($_GET[&#8216;start&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_time = &#8221; and o.date_purchased &gt;= &#8216;&#8221;.$start_time.&#8221;&#8216; &#8220;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(empty($_GET[&#8216;start&#8217;]) &amp;&amp; !empty($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $end_time = strtr($_GET[&#8216;end&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_time = &#8221; and o.date_purchased &lt;= &#8216;&#8221;.$end_time.&#8221;&#8216; &#8220;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($_GET[&#8216;start&#8217;]) &amp;&amp; !empty($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $start_time = strtr($_GET[&#8216;start&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $end_time = strtr($_GET[&#8216;end&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;).&#8221; 23:59:59&#8243;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_time = &#8221; and o.date_purchased &gt;= &#8216; &#8221; .$start_time. &#8220;&#8216; and o.date_purchased &lt;= &#8216;&#8221;.$end_time.&#8221;&#8216; &#8220;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $orders_query_raw = &nbsp; &#8220;select o.orders_id, orders_num, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.date_purchased, o.order_total as total, s.orders_status_name, ot.text as order_total&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_fields . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from (&#8221; . TABLE_ORDERS_STATUS . &#8221; s, &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TABLE_ORDERS . &#8221; o &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_table . &#8220;)   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left join &#8221; . TABLE_ORDERS_TOTAL . &#8221; ot on (o.orders_id = ot.orders_id and ot.class = &#8216;ot_total&#8217;) &#8221; . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where o.customers_id = &#8216;&#8221; . (int)$cID . &#8220;&#8216; and o.orders_status = s.orders_status_id &#8220;.$order_time.&#8221; and s.language_id = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216; order by orders_id DESC&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }else{ &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $orders_query_raw = &nbsp; &#8220;select o.orders_id, orders_num, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.order_total as total, s.orders_status_name, ot.text as order_total&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_fields . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from (&#8221; . TABLE_ORDERS_STATUS . &#8221; s, &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TABLE_ORDERS . &#8221; o &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_table . &#8220;)   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left join &#8221; . TABLE_ORDERS_TOTAL . &#8221; ot on (o.orders_id = ot.orders_id and ot.class = &#8216;ot_total&#8217;) &#8221; . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where o.customers_id = &#8216;&#8221; . (int)$cID . &#8220;&#8216; and o.orders_status = s.orders_status_id and s.language_id = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216; order by orders_id DESC&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; }&nbsp;   &nbsp; &nbsp; &nbsp; elseif ($_GET[&#8216;status&#8217;] != &#8221;) {   &nbsp; &nbsp; &nbsp; $status = zen_db_prepare_input($_GET[&#8216;status&#8217;]);   &nbsp; &nbsp; &nbsp; $orders_query_raw = &#8220;select o.orders_id, orders_num, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.order_total as total, s.orders_status_name, ot.text as order_total&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_fields . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from (&#8221; . TABLE_ORDERS_STATUS . &#8221; s, &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TABLE_ORDERS . &#8221; o &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_table . &#8220;)   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left join &#8221; . TABLE_ORDERS_TOTAL . &#8221; ot on (o.orders_id = ot.orders_id and ot.class = &#8216;ot_total&#8217;) &#8221; . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where o.orders_status = s.orders_status_id and s.language_id = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216; and s.orders_status_id = &#8216;&#8221; . (int)$status . &#8220;&#8216; &nbsp;&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search . &#8221; order by o.orders_id DESC&#8221;;   &nbsp;   &nbsp; &nbsp; }   &nbsp; &nbsp; else {   &nbsp; &nbsp; &nbsp; \/\/add code   &nbsp; &nbsp; &nbsp; if(isset($_GET[&#8216;start&#8217;]) || isset($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($_GET[&#8216;start&#8217;]) &amp;&amp; empty($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $start_time = strtr($_GET[&#8216;start&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_time = &#8221; and orders_status &lt;&gt; 11 and o.date_purchased &gt;= &#8216;&#8221;.$start_time.&#8221;&#8216; &#8220;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(empty($_GET[&#8216;start&#8217;]) &amp;&amp; !empty($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $end_time = strtr($_GET[&#8216;end&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_time = &#8221; and orders_status &lt;&gt; 11 and o.date_purchased &lt;= &#8216;&#8221;.$end_time.&#8221;&#8216; &#8220;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($_GET[&#8216;start&#8217;]) &amp;&amp; !empty($_GET[&#8216;end&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $start_time = strtr($_GET[&#8216;start&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $end_time = strtr($_GET[&#8216;end&#8217;], &#8220;\/&#8221;, &#8220;-&#8220;).&#8221; 23:59:59&#8243;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_time = &#8221; and orders_status &lt;&gt; 11 and o.date_purchased &gt;= &#8216; &#8221; .$start_time. &#8220;&#8216; and o.date_purchased &lt;= &#8216;&#8221;.$end_time.&#8221;&#8216; &#8220;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $orders_query_raw = &#8220;select &#8221; . $search_distinct . &#8221; o.orders_id, orders_num, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.date_purchased, o.date_purchased, o.order_total as total, s.orders_status_name, ot.text as order_total&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_fields . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from (&#8221; . TABLE_ORDERS_STATUS . &#8221; s, &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TABLE_ORDERS . &#8221; o &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_table . &#8220;)   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left join &#8221; . TABLE_ORDERS_TOTAL . &#8221; ot on (o.orders_id = ot.orders_id and ot.class = &#8216;ot_total&#8217;) &#8221; . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where (o.orders_status = s.orders_status_id and s.language_id = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216;) &nbsp;&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search . $order_time. &#8221; order by o.orders_id DESC&#8221;;   &nbsp; &nbsp; &nbsp; }else{ &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $orders_query_raw = &#8220;select &#8221; . $search_distinct . &#8221; o.orders_id, orders_num, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, o.date_purchased, o.order_total as total, s.orders_status_name, ot.text as order_total&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_fields . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from (&#8221; . TABLE_ORDERS_STATUS . &#8221; s, &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TABLE_ORDERS . &#8221; o &#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $new_table . &#8220;)   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left join &#8221; . TABLE_ORDERS_TOTAL . &#8221; ot on (o.orders_id = ot.orders_id and ot.class = &#8216;ot_total&#8217;) &#8221; . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where (o.orders_status = s.orders_status_id and s.language_id = &#8216;&#8221; . (int)$_SESSION[&#8216;languages_id&#8217;] . &#8220;&#8216;) &nbsp;&#8221; .   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $search . &#8221; order by o.orders_id DESC&#8221;;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; }   &nbsp;   \/\/ Split Page   \/\/ reset page when page is unknown   if (($_GET[&#8216;page&#8217;] == &#8221; or $_GET[&#8216;page&#8217;] &lt;= 1) and $_GET[&#8216;oID&#8217;] != &#8221;) {   &nbsp; $check_page = $db-&gt;Execute($orders_query_raw);   &nbsp; $check_count=1;   &nbsp; if ($check_page-&gt;RecordCount() &gt; MAX_DISPLAY_SEARCH_RESULTS_ORDERS) {   &nbsp; &nbsp; while (!$check_page-&gt;EOF) {   &nbsp; &nbsp; &nbsp; if ($check_page-&gt;fields[&#8216;orders_id&#8217;] == $_GET[&#8216;oID&#8217;]) {   &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; $check_count++;   &nbsp; &nbsp; &nbsp; $check_page-&gt;MoveNext();   &nbsp; &nbsp; }   &nbsp; &nbsp; $_GET[&#8216;page&#8217;] = round((($check_count\/MAX_DISPLAY_SEARCH_RESULTS_ORDERS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS_ORDERS) !=0 ? .5 : 0)),0);   &nbsp; } else {   &nbsp; &nbsp; $_GET[&#8216;page&#8217;] = 1;   &nbsp; }   }   &nbsp;   &nbsp; &nbsp; \/\/all order total   &nbsp; &nbsp; $orders = $db-&gt;Execute($orders_query_raw);   &nbsp; &nbsp; $total=&#8221;&#8221;;   &nbsp; &nbsp; while (!$orders-&gt;EOF) {   &nbsp; &nbsp; &nbsp; &nbsp; $total+=$orders-&gt;fields[&#8216;total&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; $orders-&gt;MoveNext();   &nbsp; &nbsp; }   &nbsp; &nbsp; if(!empty($total)){   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;div id=&#8221;total&#8221; style=&#8221;display:none&#8221;&gt;&#8217;.$total.'&lt;\/div&gt;&#8217;;   &nbsp; &nbsp; }   &nbsp;   \/\/ &nbsp; &nbsp;$orders_query_numrows = &#8221;;   &nbsp; &nbsp; $orders_split = new splitPageResults($_GET[&#8216;page&#8217;], MAX_DISPLAY_SEARCH_RESULTS_ORDERS, $orders_query_raw, $orders_query_numrows);   &nbsp; &nbsp; $orders = $db-&gt;Execute($orders_query_raw);   &nbsp; &nbsp; echo zen_draw_form(&#8216;status&#8217;, FILENAME_ORDERS, &#8221;, &#8216;post&#8217;, &#8221;, true);   &nbsp; &nbsp; while (!$orders-&gt;EOF) {   &nbsp; &nbsp; if ((!isset($_GET[&#8216;oID&#8217;]) || (isset($_GET[&#8216;oID&#8217;]) &amp;&amp; ($_GET[&#8216;oID&#8217;] == $orders-&gt;fields[&#8216;orders_id&#8217;]))) &amp;&amp; !isset($oInfo)) {   &nbsp; &nbsp; &nbsp; &nbsp; $oInfo = new objectInfo($orders-&gt;fields);   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; if (isset($oInfo) &amp;&amp; is_object($oInfo) &amp;&amp; ($orders-&gt;fields[&#8216;orders_id&#8217;] == $oInfo-&gt;orders_id)) {   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr id=&#8221;defaultSelected&#8221; class=&#8221;dataTableRowSelected&#8221; onmouseover=&#8221;rowOverEffect(this)&#8221; onmouseout=&#8221;rowOutEffect(this)&#8221; onclick=&#8221;document.location.href=\\&#8221; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)) . &#8216;oID=&#8217; . $oInfo-&gt;orders_id . &#8216;&amp;action=edit&#8217;, &#8216;NONSSL&#8217;) . &#8216;\\'&#8221;&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; &nbsp; \/\/echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr class=&#8221;dataTableRow&#8221; onmouseover=&#8221;rowOverEffect(this)&#8221; onmouseout=&#8221;rowOutEffect(this)&#8221; onclick=&#8221;document.location.href=\\&#8221; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;)) . &#8216;oID=&#8217; . $orders-&gt;fields[&#8216;orders_id&#8217;], &#8216;NONSSL&#8217;) . &#8216;\\'&#8221;&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr class=&#8221;dataTableRow&#8221; onmouseover=&#8221;rowOverEffect(this)&#8221; onmouseout=&#8221;rowOutEffect(this)&#8221;&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; $show_difference = &#8221;;   &nbsp; &nbsp; &nbsp; if (($orders-&gt;fields[&#8216;delivery_name&#8217;] != $orders-&gt;fields[&#8216;billing_name&#8217;] and $orders-&gt;fields[&#8216;delivery_name&#8217;] != &#8221;)) {   &nbsp; &nbsp; &nbsp; &nbsp; $show_difference = zen_image(DIR_WS_IMAGES . &#8216;icon_status_red.gif&#8217;, TEXT_BILLING_SHIPPING_MISMATCH, 10, 10) . &#8216;&amp;nbsp;&#8217;;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; if (($orders-&gt;fields[&#8216;delivery_street_address&#8217;] != $orders-&gt;fields[&#8216;billing_street_address&#8217;] and $orders-&gt;fields[&#8216;delivery_street_address&#8217;] != &#8221;)) {   &nbsp; &nbsp; &nbsp; &nbsp; $show_difference = zen_image(DIR_WS_IMAGES . &#8216;icon_status_red.gif&#8217;, TEXT_BILLING_SHIPPING_MISMATCH, 10, 10) . &#8216;&amp;nbsp;&#8217;;   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; $show_payment_type = $orders-&gt;fields[&#8216;payment_module_code&#8217;] . &#8216;&lt;br \/&gt;&#8217; . $orders-&gt;fields[&#8216;shipping_module_code&#8217;];   ?&gt;   &lt;?php   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($_GET[&#8216;cID&#8217;]) || !empty($_GET[&#8216;search&#8217;]) || !empty($_GET[&#8216;orders_num&#8217;]) || !empty($_GET[&#8216;search_orders_products&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $attributes = $db-&gt;Execute(&#8220;select products_options_id   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &#8221; . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . $orders-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216; and products_options_id =&#8217;5&#8242;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_products = $db-&gt;Execute(&#8220;select products_total_quantity   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &#8220;. TABLE_ORDERS_PRODUCTS .&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id=&#8221; .$orders-&gt;fields[&#8216;orders_id&#8217;] . &#8221; AND products_total_quantity &lt; 0 ORDER BY products_total_quantity &#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else{   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $attributes = $db-&gt;Execute(&#8220;select products_options_id   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &#8221; . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . $orders-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216; and products_options_id =&#8217;5&#8242;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($attributes-&gt;fields)){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $orders-&gt;MoveNext();   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $order_products = $db-&gt;Execute(&#8220;select products_total_quantity   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &#8220;. TABLE_ORDERS_PRODUCTS .&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id=&#8221; .$orders-&gt;fields[&#8216;orders_id&#8217;] . &#8221; AND products_total_quantity &lt; 0 ORDER BY products_total_quantity &#8220;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($order_products-&gt;fields) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $orders-&gt;MoveNext();   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $onclick = &#8216;onclick=&#8221;document.location.href=\\&#8221; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;)) . &#8216;oID=&#8217; . $orders-&gt;fields[&#8216;orders_id&#8217;], &#8216;NONSSL&#8217;) . &#8216;\\'&#8221;&#8216;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(empty($show_difference)) $p=&#8217;&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else $p=&#8221;;   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;left&#8221; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo $show_difference.$p.$orders-&gt;fields[&#8216;orders_num&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;left&#8221; width=&#8221;50&#8243; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo $show_payment_type; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_CUSTOMERS, &#8216;cID=&#8217; . $orders-&gt;fields[&#8216;customers_id&#8217;], &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image(DIR_WS_ICONS . &#8216;preview.gif&#8217;, ICON_PREVIEW . &#8216; &#8216; . TABLE_HEADING_CUSTOMERS) . &#8216;&lt;\/a&gt;&amp;nbsp;&#8217; . $orders-&gt;fields[&#8216;customers_name&#8217;] . ($orders-&gt;fields[&#8216;customers_company&#8217;] != &#8221; ? &#8216;&lt;br \/&gt;&#8217; . $orders-&gt;fields[&#8216;customers_company&#8217;] : &#8221;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo strip_tags($orders-&gt;fields[&#8216;order_total&#8217;]); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;center&#8221; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo zen_datetime_short($orders-&gt;fields[&#8216;date_purchased&#8217;]); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo $orders-&gt;fields[&#8216;orders_status_name&#8217;]; ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;center&#8221; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo (zen_get_orders_comments($orders-&gt;fields[&#8216;orders_id&#8217;]) == &#8221; ? &#8221; : zen_image(DIR_WS_IMAGES . &#8216;icon_yellow_on.gif&#8217;, TEXT_COMMENTS_YES, 16, 16)); ?&gt;&lt;?php echo (!empty($attributes-&gt;fields) ? zen_image(DIR_WS_IMAGES . &#8216;icon_green_on.gif&#8217;, IMAGE_ICON_STATUS_ON):&#8221;); ?&gt;&lt;?php echo (!empty($order_products-&gt;fields) ? zen_image(DIR_WS_IMAGES . &#8216;icon_red_on.gif&#8217;, ICON_EDIT) : &#8220;&#8221;); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;center&#8221;&gt;&lt;input type=&#8221;checkbox&#8221; name=&#8221;order_id[]&#8221; value=&#8221;&lt;?php echo $orders-&gt;fields[&#8216;orders_id&#8217;]; ?&gt;&#8221;&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;dataTableContent&#8221; align=&#8221;right&#8221; &lt;?php echo $onclick; ?&gt; &gt;&lt;?php echo &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)) . &#8216;oID=&#8217; . $orders-&gt;fields[&#8216;orders_id&#8217;] . &#8216;&amp;action=edit&#8217;, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image(DIR_WS_IMAGES . &#8216;icon_edit.gif&#8217;, ICON_EDIT) . &#8216;&lt;\/a&gt;&#8217;; ?&gt;&lt;?php if (isset($oInfo) &amp;&amp; is_object($oInfo) &amp;&amp; ($orders-&gt;fields[&#8216;orders_id&#8217;] == $oInfo-&gt;orders_id)) { echo zen_image(DIR_WS_IMAGES . &#8216;icon_arrow_right.gif&#8217;, &#8221;); } else { echo &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;)) . &#8216;oID=&#8217; . $orders-&gt;fields[&#8216;orders_id&#8217;], &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image(DIR_WS_IMAGES . &#8216;icon_info.gif&#8217;, IMAGE_ICON_INFO) . &#8216;&lt;\/a&gt;&#8217;; } ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; &nbsp; &nbsp; $orders-&gt;MoveNext();   &nbsp; &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;right&#8221; &nbsp;colspan=&#8221;8&#8243;&gt;&lt;input type=&#8221;submit&#8221; value=&#8221;Export Orders&#8221;&gt;&lt;\/form&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td colspan=&#8221;5&#8243;&gt;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; valign=&#8221;top&#8221;&gt;&lt;?php echo $orders_split-&gt;display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_ORDERS, $_GET[&#8216;page&#8217;], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;right&#8221;&gt;&lt;?php echo $orders_split-&gt;display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS_ORDERS, MAX_DISPLAY_PAGE_LINKS, $_GET[&#8216;page&#8217;], zen_get_all_get_params(array(&#8216;page&#8217;, &#8216;oID&#8217;, &#8216;action&#8217;))); ?&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; if (isset($_GET[&#8216;search&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search&#8217;])) {   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td class=&#8221;smallText&#8221; align=&#8221;right&#8221; colspan=&#8221;2&#8243;&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;?php   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, &#8221;, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_reset.gif&#8217;, IMAGE_RESET) . &#8216;&lt;\/a&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (isset($_GET[&#8216;search&#8217;]) &amp;&amp; zen_not_null($_GET[&#8216;search&#8217;])) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $keywords = zen_db_input(zen_db_prepare_input($_GET[&#8216;search&#8217;]));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo &#8216;&lt;br\/ &gt;&#8217; . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &lt;?php   &nbsp; $heading = array();   &nbsp; $contents = array();   &nbsp;   &nbsp; switch ($action) {   &nbsp; &nbsp; case &#8216;delete&#8217;:   &nbsp; &nbsp; &nbsp; $heading[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;strong&gt;&#8217; . TEXT_INFO_HEADING_DELETE_ORDER . &#8216;&lt;\/strong&gt;&#8217;);   &nbsp;   &nbsp; &nbsp; &nbsp; $contents = array(&#8216;form&#8217; =&gt; zen_draw_form(&#8216;orders&#8217;, FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)) . &#8216;oID=&#8217; . $oInfo-&gt;orders_id . &#8216;&amp;action=deleteconfirm&#8217;, &#8216;post&#8217;, &#8221;, true));   \/\/ &nbsp; &nbsp; &nbsp;$contents[] = array(&#8216;text&#8217; =&gt; TEXT_INFO_DELETE_INTRO . &#8216;&lt;br \/&gt;&lt;br \/&gt;&lt;strong&gt;&#8217; . $cInfo-&gt;customers_firstname . &#8216; &#8216; . $cInfo-&gt;customers_lastname . &#8216;&lt;\/strong&gt;&#8217;);   &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; TEXT_INFO_DELETE_INTRO . &#8216;&lt;br \/&gt;&lt;br \/&gt;&lt;strong&gt;&#8217; . ENTRY_ORDER_ID . $oInfo-&gt;orders_num . &#8216;&lt;br \/&gt;&#8217; . $oInfo-&gt;order_total . &#8216;&lt;br \/&gt;&#8217; . $oInfo-&gt;customers_name . ($oInfo-&gt;customers_company != &#8221; ? &#8216;&lt;br \/&gt;&#8217; . $oInfo-&gt;customers_company : &#8221;) . &#8216;&lt;\/strong&gt;&#8217;);   &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . zen_draw_checkbox_field(&#8216;restock&#8217;) . &#8216; &#8216; . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY);   &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;center&#8217;, &#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . zen_image_submit(&#8216;button_delete.gif&#8217;, IMAGE_DELETE) . &#8216; &lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)) . &#8216;oID=&#8217; . $oInfo-&gt;orders_id, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_cancel.gif&#8217;, IMAGE_CANCEL) . &#8216;&lt;\/a&gt;&#8217;);   &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; default:   &nbsp; &nbsp; &nbsp; if (isset($oInfo) &amp;&amp; is_object($oInfo)) {   &nbsp; &nbsp; &nbsp; &nbsp; $heading[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;strong&gt;[&#8216; . $oInfo-&gt;orders_id . &#8216;]&amp;nbsp;&amp;nbsp;&#8217; . zen_datetime_short($oInfo-&gt;date_purchased) . &#8216;&lt;\/strong&gt;&#8217;);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;center&#8217;, &#8216;text&#8217; =&gt; &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)) . &#8216;oID=&#8217; . $oInfo-&gt;orders_id . &#8216;&amp;action=edit&#8217;, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_edit.gif&#8217;, IMAGE_EDIT) . &#8216;&lt;\/a&gt; &lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)) . &#8216;oID=&#8217; . $oInfo-&gt;orders_id . &#8216;&amp;action=delete&#8217;, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_delete.gif&#8217;, IMAGE_DELETE) . &#8216;&lt;\/a&gt;&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;center&#8217;, &#8216;text&#8217; =&gt; &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS_INVOICE, &#8216;oID=&#8217; . $oInfo-&gt;orders_id) . &#8216;&#8221; TARGET=&#8221;_blank&#8221;&gt;&#8217; . zen_image_button(&#8216;button_invoice.gif&#8217;, IMAGE_ORDERS_INVOICE) . &#8216;&lt;\/a&gt; &lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS_PACKINGSLIP, &#8216;oID=&#8217; . $oInfo-&gt;orders_id) . &#8216;&#8221; TARGET=&#8221;_blank&#8221;&gt;&#8217; . zen_image_button(&#8216;button_packingslip.gif&#8217;, IMAGE_ORDERS_PACKINGSLIP) . &#8216;&lt;\/a&gt;&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;center&#8217;, &#8216;text&#8217; =&gt; &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, &#8216;cID=&#8217; . $oInfo-&gt;customers_id) . &#8216;&#8221; &#8220;&gt;&#8217; . zen_image_button(&#8216;button_allroder.gif&#8217;, &#8220;All order&#8221;) . &#8216;&lt;\/a&gt;&#8217;);   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . TEXT_DATE_ORDER_CREATED . &#8216; &#8216; . zen_date_short($oInfo-&gt;date_purchased));   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . $oInfo-&gt;customers_email_address);   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; TEXT_INFO_IP_ADDRESS . &#8216; &#8216; . $oInfo-&gt;ip_address);   &nbsp; &nbsp; &nbsp; &nbsp; if (zen_not_null($oInfo-&gt;last_modified)) $contents[] = array(&#8216;text&#8217; =&gt; TEXT_DATE_ORDER_LAST_MODIFIED . &#8216; &#8216; . zen_date_short($oInfo-&gt;last_modified));   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . TEXT_INFO_PAYMENT_METHOD . &#8216; &#8216; &nbsp;. $oInfo-&gt;payment_method);   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . ENTRY_SHIPPING . &#8216; &#8216; &nbsp;. $oInfo-&gt;shipping_method);   &nbsp;   \/\/ check if order has open gv   &nbsp; &nbsp; &nbsp; &nbsp; $gv_check = $db-&gt;Execute(&#8220;select order_id, unique_id   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from &#8221; . TABLE_COUPON_GV_QUEUE .&#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where order_id = &#8216;&#8221; . $oInfo-&gt;orders_id . &#8220;&#8216; and release_flag=&#8217;N&#8217; limit 1&#8243;);   &nbsp; &nbsp; &nbsp; &nbsp; if ($gv_check-&gt;RecordCount() &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $goto_gv = &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_GV_QUEUE, &#8216;order=&#8217; . $oInfo-&gt;orders_id) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_gift_queue.gif&#8217;,IMAGE_GIFT_QUEUE) . &#8216;&lt;\/a&gt;&#8217;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . zen_image(DIR_WS_IMAGES . &#8216;pixel_black.gif&#8217;,&#8221;,&#8217;100%&#8217;,&#8217;3&#8242;));   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;center&#8217;, &#8216;text&#8217; =&gt; $goto_gv);   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp;   \/\/ indicate if comments exist   &nbsp; &nbsp; &nbsp; $orders_history_query = $db-&gt;Execute(&#8220;select orders_status_id, date_added, customer_notified, comments from &#8221; . TABLE_ORDERS_STATUS_HISTORY . &#8221; where orders_id = &#8216;&#8221; . $oInfo-&gt;orders_id . &#8220;&#8216; and comments !='&#8221; . &#8220;&#8216;&#8221; );   &nbsp; &nbsp; &nbsp; if ($orders_history_query-&gt;RecordCount() &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;left&#8217;, &#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . TABLE_HEADING_COMMENTS);   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&lt;br \/&gt;&#8217; . zen_image(DIR_WS_IMAGES . &#8216;pixel_black.gif&#8217;,&#8221;,&#8217;100%&#8217;,&#8217;3&#8242;));   &nbsp; &nbsp; &nbsp; $order = new order($oInfo-&gt;orders_id);   &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;Products Ordered: &#8216; . sizeof($order-&gt;products) );   &nbsp; &nbsp; &nbsp; for ($i=0; $i&lt;sizeof($order-&gt;products); $i++) {   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; $order-&gt;products[$i][&#8216;qty&#8217;] . &#8216;&amp;nbsp;x&amp;nbsp;&#8217; . $order-&gt;products[$i][&#8216;name&#8217;]);   &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; if (sizeof($order-&gt;products[$i][&#8216;attributes&#8217;]) &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($j=0; $j&lt;sizeof($order-&gt;products[$i][&#8216;attributes&#8217;]); $j++) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;text&#8217; =&gt; &#8216;&amp;nbsp;&lt;i&gt; &#8211; &#8216; . $order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;option&#8217;] . &#8216;: &#8216; . nl2br(zen_output_string_protected($order-&gt;products[$i][&#8216;attributes&#8217;][$j][&#8216;value&#8217;])) . &#8216;&lt;\/i&gt;&lt;\/nobr&gt;&#8217; );   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp; if ($i &gt; MAX_DISPLAY_RESULTS_ORDERS_DETAILS_LISTING and MAX_DISPLAY_RESULTS_ORDERS_DETAILS_LISTING != 0) {   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;left&#8217;, &#8216;text&#8217; =&gt; TEXT_MORE);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; if (sizeof($order-&gt;products) &gt; 0) {   &nbsp; &nbsp; &nbsp; &nbsp; $contents[] = array(&#8216;align&#8217; =&gt; &#8216;center&#8217;, &#8216;text&#8217; =&gt; &#8216;&lt;a href=&#8221;&#8216; . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array(&#8216;oID&#8217;, &#8216;action&#8217;)) . &#8216;oID=&#8217; . $oInfo-&gt;orders_id . &#8216;&amp;action=edit&#8217;, &#8216;NONSSL&#8217;) . &#8216;&#8221;&gt;&#8217; . zen_image_button(&#8216;button_edit.gif&#8217;, IMAGE_EDIT) . &#8216;&lt;\/a&gt;&#8217;);   &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; break;   &nbsp; }   &nbsp;   &nbsp; if ( (zen_not_null($heading)) &amp;&amp; (zen_not_null($contents)) ) {   &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td width=&#8221;25%&#8221; valign=&#8221;top&#8221;&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp;   &nbsp; &nbsp; $box = new box;   &nbsp; &nbsp; echo $box-&gt;infoBox($heading, $contents);   &nbsp;   &nbsp; &nbsp; echo &#8216; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/td&gt;&#8217; . &#8220;\\n&#8221;;   &nbsp; }   ?&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &nbsp; &nbsp; &nbsp; &lt;\/tr&gt;   &lt;?php   &nbsp; }   ?&gt;   &nbsp; &nbsp; &lt;\/table&gt;&lt;\/td&gt;   &lt;!&#8211; body_text_eof \/\/&#8211;&gt;   &nbsp; &lt;\/tr&gt;   &lt;\/table&gt;   &lt;!&#8211; body_eof \/\/&#8211;&gt;   &nbsp;   &lt;!&#8211; footer \/\/&#8211;&gt;   &lt;div class=&#8221;footer-area&#8221;&gt;   &lt;?php require(DIR_WS_INCLUDES . &#8216;footer.php&#8217;); ?&gt;   &lt;\/div&gt;   &lt;!&#8211; footer_eof \/\/&#8211;&gt;   &lt;br \/&gt;   &lt;\/body&gt;   &lt;\/html&gt;   &lt;?php require(DIR_WS_INCLUDES . &#8216;application_bottom.php&#8217;); ?&gt;  <\/p>\n<p> 10. \u4fee\u6539\u4ed8\u6b3e\u540e\uff0c\u7ed9\u5ba2\u6237\u53d1\u9001\u90ae\u4ef6\u7684\u95ee\u9898\u3002\u6ce8\u9500 includes\/modules\/checkout_process.php \u6587\u4ef6\u7684 $order-&gt;send_order_email($insert_id, 2);&nbsp; \u8fd9\u662f\u751f\u6210\u8ba2\u5355\u7684\u65f6\u5019\u53d1\u9001\u8ba2\u5355\u90ae\u4ef6\uff0c\u4e0d\u662f\u4ed8\u6b3e\u6210\u529f\u65f6\u53d1\u9001\u90ae\u4ef6\uff0c\u6240\u4ee5\u9700\u8981\u6ce8\u9500\u6389\uff0c\u5f53\u7136\u4f60\u4e5f\u53ef\u4ee5\u81ea\u5df1\u5199\u90ae\u4ef6\uff0c\u5f53\u8ba2\u5355\u751f\u6210\u540e\uff0c\u53ef\u4ee5\u53d1\u9001\u63d0\u793a\u90ae\u4ef6\u7ed9\u5ba2\u6237\u3002\u4ed8\u6b3e\u6210\u529f\u540e\u53d1\u9001\u90ae\u4ef6\u529f\u80fd\u8c03\u7528\u5728 ipn_main_handler.php \u6587\u4ef6\u4e2d\u3002\u53d1\u9001\u90ae\u4ef6\u51fd\u6570\u662f\u5728 includes\/classes\/order.php \u6587\u4ef6\u7684 send_order_email($zf_insert_id, $zf_mode) \u51fd\u6570\uff0c\u4ee3\u7801\u4fee\u6539\u5982\u4e0b\uff1a<\/p>\n<p>  function send_order_email($zf_insert_id, $zf_mode) {   &nbsp; &nbsp; global $currencies, $order_totals;   &nbsp; &nbsp; if( !empty($this-&gt;totals) ){   &nbsp; &nbsp; &nbsp; &nbsp; $order_totals = $this-&gt;totals;   &nbsp; &nbsp; }   &nbsp; &nbsp; if ($this-&gt;email_low_stock != &#8221; and SEND_LOWSTOCK_EMAIL==&#8217;1&#8242;) {   &nbsp; &nbsp; &nbsp; \/\/ send an email   &nbsp; &nbsp; &nbsp; $email_low_stock = SEND_EXTRA_LOW_STOCK_EMAIL_TITLE . &#8220;\\n\\n&#8221; . $this-&gt;email_low_stock;   &nbsp; &nbsp; &nbsp; zen_mail(&#8221;, SEND_EXTRA_LOW_STOCK_EMAILS_TO, EMAIL_TEXT_SUBJECT_LOWSTOCK, $email_low_stock, STORE_OWNER, EMAIL_FROM, array(&#8216;EMAIL_MESSAGE_HTML&#8217; =&gt; nl2br($email_low_stock)),&#8217;low_stock&#8217;);   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; \/\/ lets start with the email confirmation   &nbsp; &nbsp; \/\/ make an array to store the html version   &nbsp; &nbsp; $html_msg=array();   &nbsp;   &nbsp; &nbsp; \/\/intro area   &nbsp; &nbsp; $email_order = EMAIL_TEXT_HEADER . EMAIL_TEXT_FROM . STORE_NAME . &#8220;\\n\\n&#8221; .   &nbsp; &nbsp; $this-&gt;customer[&#8216;firstname&#8217;] . &#8216; &#8216; . $this-&gt;customer[&#8216;lastname&#8217;] . &#8220;\\n\\n&#8221; .   &nbsp; &nbsp; EMAIL_THANKS_FOR_SHOPPING . &#8220;\\n&#8221; . EMAIL_DETAILS_FOLLOW . &#8220;\\n&#8221; .   &nbsp; &nbsp; EMAIL_SEPARATOR . &#8220;\\n&#8221; .   &nbsp; &nbsp; EMAIL_TEXT_ORDER_NUMBER . &#8216; &#8216; . zen_get_order_orders_number($zf_insert_id) . &#8220;\\n&#8221; .   &nbsp; &nbsp; EMAIL_TEXT_DATE_ORDERED . &#8216; &#8216; . strftime(DATE_FORMAT_LONG) . &#8220;\\n&#8221; .   &nbsp; &nbsp; EMAIL_TEXT_INVOICE_URL . &#8216; &#8216; . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, &#8216;order_id=&#8217; . $zf_insert_id, &#8216;SSL&#8217;, false) . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_HEADER&#8217;] &nbsp; &nbsp; = EMAIL_TEXT_HEADER;   &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_FROM&#8217;] &nbsp; &nbsp; &nbsp; = EMAIL_TEXT_FROM;   &nbsp; &nbsp; $html_msg[&#8216;INTRO_STORE_NAME&#8217;] &nbsp; &nbsp; &nbsp;= STORE_NAME;   &nbsp; &nbsp; $html_msg[&#8216;EMAIL_THANKS_FOR_SHOPPING&#8217;] = EMAIL_THANKS_FOR_SHOPPING;   &nbsp; &nbsp; $html_msg[&#8216;EMAIL_DETAILS_FOLLOW&#8217;] &nbsp;= EMAIL_DETAILS_FOLLOW;   &nbsp; &nbsp; $html_msg[&#8216;INTRO_ORDER_NUM_TITLE&#8217;] = EMAIL_TEXT_ORDER_NUMBER;   &nbsp; &nbsp; $html_msg[&#8216;INTRO_ORDER_NUMBER&#8217;] &nbsp; &nbsp;= zen_get_order_orders_number($zf_insert_id);   &nbsp; &nbsp; $html_msg[&#8216;INTRO_DATE_TITLE&#8217;] &nbsp; &nbsp; &nbsp;= EMAIL_TEXT_DATE_ORDERED;   &nbsp; &nbsp; $html_msg[&#8216;INTRO_DATE_ORDERED&#8217;] &nbsp; &nbsp;= strftime(DATE_FORMAT_LONG);   &nbsp; &nbsp; $html_msg[&#8216;INTRO_URL_TEXT&#8217;] &nbsp; &nbsp; &nbsp; &nbsp;= EMAIL_TEXT_INVOICE_URL_CLICK;   &nbsp; &nbsp; $html_msg[&#8216;INTRO_URL_VALUE&#8217;] &nbsp; &nbsp; &nbsp; = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, &#8216;order_id=&#8217; . $zf_insert_id, &#8216;SSL&#8217;, false);   &nbsp;   &nbsp; &nbsp; \/\/comments area   &nbsp; &nbsp; if ($this-&gt;info[&#8216;comments&#8217;]) {   &nbsp; &nbsp; &nbsp; $email_order .= zen_db_output($this-&gt;info[&#8216;comments&#8217;]) . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; &nbsp; $html_msg[&#8216;ORDER_COMMENTS&#8217;] = nl2br(zen_db_output($this-&gt;info[&#8216;comments&#8217;]));   &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; $html_msg[&#8216;ORDER_COMMENTS&#8217;] = &#8221;;   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; \/\/products area   &nbsp; &nbsp; $email_order .= EMAIL_TEXT_PRODUCTS . &#8220;\\n&#8221; .   &nbsp; &nbsp; EMAIL_SEPARATOR . &#8220;\\n&#8221; .   &nbsp; &nbsp; $this-&gt;products_ordered .   &nbsp; &nbsp; EMAIL_SEPARATOR . &#8220;\\n&#8221;;   &nbsp; &nbsp; $html_msg[&#8216;PRODUCTS_TITLE&#8217;] = EMAIL_TEXT_PRODUCTS;   &nbsp; &nbsp; $html_msg[&#8216;PRODUCTS_DETAIL&#8217;]='&lt;table class=&#8221;product-details&#8221; border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt;&#8217; . $this-&gt;products_ordered_html . &#8216;&lt;\/table&gt;&#8217;;   &nbsp;   &nbsp; &nbsp; \/\/order totals area   &nbsp; &nbsp; $html_ot .= &#8216;&lt;td class=&#8221;order-totals-text&#8221; align=&#8221;right&#8221; width=&#8221;100%&#8221;&gt;&#8217; . &#8216;&amp;nbsp;&#8217; . &#8216;&lt;\/td&gt; &#8216; . &#8220;\\n&#8221; . &#8216;&lt;td class=&#8221;order-totals-num&#8221; align=&#8221;right&#8221; nowrap=&#8221;nowrap&#8221;&gt;&#8217; . &#8216;&#8212;&#8212;&#8212;&#8216; .'&lt;\/td&gt; &lt;\/tr&gt;&#8217; . &#8220;\\n&#8221; . &#8216;&lt;tr&gt;&#8217;;   &nbsp; &nbsp; for ($i=0, $n=sizeof($order_totals); $i&lt;$n; $i++) {   &nbsp; &nbsp; &nbsp; $email_order .= strip_tags($order_totals[$i][&#8216;title&#8217;]) . &#8216; &#8216; . strip_tags($order_totals[$i][&#8216;text&#8217;]) . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; $html_ot .= &#8216;&lt;td class=&#8221;order-totals-text&#8221; align=&#8221;right&#8221; width=&#8221;100%&#8221;&gt;&#8217; . $order_totals[$i][&#8216;title&#8217;] . &#8216;&lt;\/td&gt; &#8216; . &#8220;\\n&#8221; . &#8216;&lt;td class=&#8221;order-totals-num&#8221; align=&#8221;right&#8221; nowrap=&#8221;nowrap&#8221;&gt;&#8217; .($order_totals[$i][&#8216;text&#8217;]) .'&lt;\/td&gt; &lt;\/tr&gt;&#8217; . &#8220;\\n&#8221; . &#8216;&lt;tr&gt;&#8217;;   &nbsp; &nbsp; }   &nbsp; &nbsp; $html_msg[&#8216;ORDER_TOTALS&#8217;] = &#8216;&lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;0&#8243; cellpadding=&#8221;2&#8243;&gt; &#8216; . $html_ot . &#8216; &lt;\/table&gt;&#8217;;   &nbsp;   &nbsp; &nbsp; \/\/addresses area: Delivery   &nbsp; &nbsp; $html_msg[&#8216;HEADING_ADDRESS_INFORMATION&#8217;]= HEADING_ADDRESS_INFORMATION;   &nbsp; &nbsp; $html_msg[&#8216;ADDRESS_DELIVERY_TITLE&#8217;] &nbsp; &nbsp; = EMAIL_TEXT_DELIVERY_ADDRESS;   &nbsp; &nbsp; if(empty($this-&gt;delivery)){   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;ADDRESS_DELIVERY_DETAIL&#8217;] &nbsp; &nbsp;= ($this-&gt;content_type != &#8216;virtual&#8217;) ? zen_address_label($_SESSION[&#8216;customer_id&#8217;], $_SESSION[&#8216;sendto&#8217;], true, &#8221;, &#8220;&lt;br \/&gt;&#8221;) : &#8216;n\/a&#8217;;   &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; $delivery = $this-&gt;delivery;   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;ADDRESS_DELIVERY_DETAIL&#8217;] = $delivery[&#8216;company&#8217;] . &#8220;&lt;br \/&gt;&#8221; . $delivery[&#8216;name&#8217;] . &#8220;&lt;br \/&gt;&#8221; . $delivery[&#8216;suburb&#8217;] . &#8221; &#8221; . $delivery[&#8216;street_address&#8217;] . &#8220;&lt;br \/&gt;&#8221; . &nbsp;$delivery[&#8216;city&#8217;] . &#8220;, &#8221; . $delivery[&#8216;postcode&#8217;] . &#8220;&lt;br \/&gt;&#8221; . $delivery[&#8216;state&#8217;] . &#8220;, &#8221; . $delivery[&#8216;country&#8217;];   &nbsp; &nbsp; }   &nbsp; &nbsp; $html_msg[&#8216;SHIPPING_METHOD_TITLE&#8217;] &nbsp; &nbsp; &nbsp;= HEADING_SHIPPING_METHOD;   &nbsp; &nbsp; $html_msg[&#8216;SHIPPING_METHOD_DETAIL&#8217;] &nbsp; &nbsp; = (zen_not_null($this-&gt;info[&#8216;shipping_method&#8217;])) ? $this-&gt;info[&#8216;shipping_method&#8217;] : &#8216;n\/a&#8217;;   &nbsp;   &nbsp; &nbsp; if ($this-&gt;content_type != &#8216;virtual&#8217;) {   &nbsp; &nbsp; &nbsp; $email_order .= &#8220;\\n&#8221; . EMAIL_TEXT_DELIVERY_ADDRESS . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; EMAIL_SEPARATOR . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; zen_address_label($_SESSION[&#8216;customer_id&#8217;], $_SESSION[&#8216;sendto&#8217;], 0, &#8221;, &#8220;\\n&#8221;) . &#8220;\\n&#8221;;   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; \/\/addresses area: Billing   &nbsp; &nbsp; $email_order .= &#8220;\\n&#8221; . EMAIL_TEXT_BILLING_ADDRESS . &#8220;\\n&#8221; .   &nbsp; &nbsp; EMAIL_SEPARATOR . &#8220;\\n&#8221; .   &nbsp; &nbsp; zen_address_label($_SESSION[&#8216;customer_id&#8217;], $_SESSION[&#8216;billto&#8217;], 0, &#8221;, &#8220;\\n&#8221;) . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; $html_msg[&#8216;ADDRESS_BILLING_TITLE&#8217;] &nbsp; = EMAIL_TEXT_BILLING_ADDRESS;   &nbsp; &nbsp; if(empty($this-&gt;billing)){   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;ADDRESS_BILLING_DETAIL&#8217;] &nbsp;= zen_address_label($_SESSION[&#8216;customer_id&#8217;], $_SESSION[&#8216;billto&#8217;], true, &#8221;, &#8220;&lt;br \/&gt;&#8221;);   &nbsp; &nbsp; }else{   &nbsp; &nbsp; &nbsp; &nbsp; $billing = $this-&gt;billing;   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;ADDRESS_BILLING_DETAIL&#8217;] = $billing[&#8216;company&#8217;] . &#8220;&lt;br \/&gt;&#8221; . $billing[&#8216;name&#8217;] . &#8220;&lt;br \/&gt;&#8221; . $billing[&#8216;suburb&#8217;] . &#8221; &#8221; . $billing[&#8216;street_address&#8217;] . &#8220;&lt;br \/&gt;&#8221; . &nbsp;$billing[&#8216;city&#8217;] . &#8220;, &#8221; . $billing[&#8216;postcode&#8217;] . &#8220;&lt;br \/&gt;&#8221; . $billing[&#8216;state&#8217;] . &#8220;, &#8221; . $billing[&#8216;country&#8217;];   &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; if (is_object($GLOBALS[$_SESSION[&#8216;payment&#8217;]])) {   &nbsp; &nbsp; &nbsp; $cc_num_display = (isset($this-&gt;info[&#8216;cc_number&#8217;]) &amp;&amp; $this-&gt;info[&#8216;cc_number&#8217;] != &#8221;) ? \/*substr($this-&gt;info[&#8216;cc_number&#8217;], 0, 4) . *\/ str_repeat(&#8216;X&#8217;, (strlen($this-&gt;info[&#8216;cc_number&#8217;]) &#8211; 8)) . substr($this-&gt;info[&#8216;cc_number&#8217;], -4) . &#8220;\\n\\n&#8221; : &#8221;;   &nbsp; &nbsp; &nbsp; $email_order .= EMAIL_TEXT_PAYMENT_METHOD . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; EMAIL_SEPARATOR . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; $payment_class = $_SESSION[&#8216;payment&#8217;];   &nbsp; &nbsp; &nbsp; $email_order .= $GLOBALS[$payment_class]-&gt;title . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; &nbsp; $email_order .= (isset($this-&gt;info[&#8216;cc_type&#8217;]) &amp;&amp; $this-&gt;info[&#8216;cc_type&#8217;] != &#8221;) ? $this-&gt;info[&#8216;cc_type&#8217;] . &#8216; &#8216; . $cc_num_display . &#8220;\\n\\n&#8221; : &#8221;;   &nbsp; &nbsp; &nbsp; $email_order .= ($GLOBALS[$payment_class]-&gt;email_footer) ? $GLOBALS[$payment_class]-&gt;email_footer . &#8220;\\n\\n&#8221; : &#8221;;   &nbsp; &nbsp; } else {   &nbsp; &nbsp; &nbsp; $email_order .= EMAIL_TEXT_PAYMENT_METHOD . &#8220;\\n&#8221; .   &nbsp; &nbsp; &nbsp; EMAIL_SEPARATOR . &#8220;\\n&#8221;;   &nbsp; &nbsp; &nbsp; $email_order .= PAYMENT_METHOD_GV . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; }   &nbsp; &nbsp; $html_msg[&#8216;PAYMENT_METHOD_TITLE&#8217;] &nbsp;= EMAIL_TEXT_PAYMENT_METHOD;   &nbsp; &nbsp; $html_msg[&#8216;PAYMENT_METHOD_DETAIL&#8217;] = (is_object($GLOBALS[$_SESSION[&#8216;payment&#8217;]]) ? $GLOBALS[$payment_class]-&gt;title : PAYMENT_METHOD_GV );   &nbsp; &nbsp; $html_msg[&#8216;PAYMENT_METHOD_FOOTER&#8217;] = (is_object($GLOBALS[$_SESSION[&#8216;payment&#8217;]]) &amp;&amp; $GLOBALS[$payment_class]-&gt;email_footer != &#8221;) ? nl2br($GLOBALS[$payment_class]-&gt;email_footer) : (isset($this-&gt;info[&#8216;cc_type&#8217;]) &amp;&amp; $this-&gt;info[&#8216;cc_type&#8217;] != &#8221; ? $this-&gt;info[&#8216;cc_type&#8217;] . &#8216; &#8216; . $cc_num_display . &#8220;\\n\\n&#8221; : &#8221;);   &nbsp;   &nbsp; &nbsp; \/\/ include disclaimer   &nbsp; &nbsp; if (defined(&#8216;EMAIL_DISCLAIMER&#8217;) &amp;&amp; EMAIL_DISCLAIMER != &#8221;) $email_order .= &#8220;\\n&#8212;&#8211;\\n&#8221; . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; \/\/ include copyright   &nbsp; &nbsp; if (defined(&#8216;EMAIL_FOOTER_COPYRIGHT&#8217;)) $email_order .= &#8220;\\n&#8212;&#8211;\\n&#8221; . EMAIL_FOOTER_COPYRIGHT . &#8220;\\n\\n&#8221;;   &nbsp;   &nbsp; &nbsp; while (strstr($email_order, &#8216;&amp;nbsp;&#8217;)) $email_order = str_replace(&#8216;&amp;nbsp;&#8217;, &#8216; &#8216;, $email_order);   &nbsp;   &nbsp; &nbsp; if(!empty($this-&gt;customer[&#8216;firstname&#8217;])){   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_FIRST_NAME&#8217;] = $this-&gt;customer[&#8216;firstname&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_LAST_NAME&#8217;] = $this-&gt;customer[&#8216;lastname&#8217;];   &nbsp; &nbsp; }elseif($this-&gt;customer[&#8216;name&#8217;]){   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_FIRST_NAME&#8217;] = $this-&gt;customer[&#8216;name&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_LAST_NAME&#8217;] = &#8221;;   &nbsp; &nbsp; }   &nbsp; &nbsp; \/\/ &nbsp;$html_msg[&#8216;EMAIL_TEXT_HEADER&#8217;] = EMAIL_TEXT_HEADER;   &nbsp; &nbsp; $html_msg[&#8216;EXTRA_INFO&#8217;] = &#8221;;   &nbsp; &nbsp; $this-&gt;notify(&#8216;NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND&#8217;, array(&#8216;zf_insert_id&#8217; =&gt; $zf_insert_id, &#8216;text_email&#8217; =&gt; $email_order, &#8216;html_email&#8217; =&gt; $html_msg));   &nbsp; &nbsp; zen_mail($this-&gt;customer[&#8216;firstname&#8217;] . &#8216; &#8216; . $this-&gt;customer[&#8216;lastname&#8217;], $this-&gt;customer[&#8217;email_address&#8217;], EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . zen_get_order_orders_number($zf_insert_id), $email_order, STORE_NAME, EMAIL_FROM, $html_msg, &#8216;checkout&#8217;, $this-&gt;attachArray);   &nbsp;   &nbsp; &nbsp; \/\/ send additional emails   &nbsp; &nbsp; if (SEND_EXTRA_ORDER_EMAILS_TO != &#8221;) {   &nbsp; &nbsp; &nbsp; $extra_info=email_collect_extra_info(&#8221;,&#8221;, $this-&gt;customer[&#8216;firstname&#8217;] . &#8216; &#8216; . $this-&gt;customer[&#8216;lastname&#8217;], $this-&gt;customer[&#8217;email_address&#8217;], $this-&gt;customer[&#8216;telephone&#8217;]);   &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EXTRA_INFO&#8217;] = $extra_info[&#8216;HTML&#8217;];   &nbsp;   &nbsp; &nbsp; &nbsp; \/\/ include authcode and transaction id in admin-copy of email   &nbsp; &nbsp; &nbsp; if ($GLOBALS[$_SESSION[&#8216;payment&#8217;]]-&gt;auth_code || $GLOBALS[$_SESSION[&#8216;payment&#8217;]]-&gt;transaction_id) {   &nbsp; &nbsp; &nbsp; &nbsp; $pmt_details = ($GLOBALS[$_SESSION[&#8216;payment&#8217;]]-&gt;auth_code != &#8221; ? &#8216;AuthCode: &#8216; . $GLOBALS[$_SESSION[&#8216;payment&#8217;]]-&gt;auth_code . &#8216; &nbsp;&#8216; : &#8221;) . ($GLOBALS[$_SESSION[&#8216;payment&#8217;]]-&gt;transaction_id != &#8221; ? &nbsp;&#8216;TransID: &#8216; . $GLOBALS[$_SESSION[&#8216;payment&#8217;]]-&gt;transaction_id : &#8221;) . &#8220;\\n\\n&#8221;;   &nbsp; &nbsp; &nbsp; &nbsp; $email_order = $pmt_details . $email_order;   &nbsp; &nbsp; &nbsp; &nbsp; $html_msg[&#8216;EMAIL_TEXT_HEADER&#8217;] = nl2br($pmt_details) . $html_msg[&#8216;EMAIL_TEXT_HEADER&#8217;];   &nbsp; &nbsp; &nbsp; }   &nbsp;   &nbsp; &nbsp; &nbsp; zen_mail(&#8221;, SEND_EXTRA_ORDER_EMAILS_TO, SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT . &#8216; &#8216; . EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . zen_get_order_orders_number($zf_insert_id),   &nbsp; &nbsp; &nbsp; $email_order . $extra_info[&#8216;TEXT&#8217;], STORE_NAME, EMAIL_FROM, $html_msg, &#8216;checkout_extra&#8217;, $this-&gt;attachArray);   &nbsp; &nbsp; }   &nbsp; &nbsp; $this-&gt;notify(&#8216;NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL&#8217;, array($zf_insert_id, $email_order, $extra_info, $html_msg));   &nbsp; }   &nbsp;   }  <\/p>\n<p> 11. \u672a\u4ed8\u6b3e\u8ba2\u5355\u4e0d\u9700\u8981\u6c38\u4e45\u4fdd\u5b58\uff0c\u6211\u4eec\u89c4\u5b9a\u672a\u4ed8\u6b3e\u8ba2\u5355\u8d85\u8fc7\u4e09\u5929\u81ea\u52a8\u5220\u9664\uff0c\u800c\u4e14\u672a\u4ed8\u6b3e\u8ba2\u5355\u5728\u751f\u6210\u534a\u5c0f\u65f6\u540e\uff0c\u6216\u8ddd\u79bb\u5220\u9664\u65f6\u95f4\u8fd8\u670912\u5c0f\u65f6\u7684\u65f6\u5019\uff0c\u90fd\u4f1a\u81ea\u52a8\u53d1\u9001\u4e00\u5c01\u90ae\u4ef6\u7ed9\u5ba2\u6237\uff0c\u63d0\u9192\u4ed6\u53ca\u65f6\u4ed8\u6b3e\uff0c\u4ee5\u53ca\u8ba2\u5355\u5c06\u88ab\u5220\u9664\u3002\u73b0\u5728\u9700\u8981\u5728\u8ba2\u5355\u8868 orders \u4e2d\u589e\u52a0 payment_reminder, delete_reminder\u4e24\u4e2a\u5b57\u6bb5\uff0c\u7c7b\u578b\u4e3aTINYINT\uff0c\u75280\u62161\u8868\u793a\u53d1\u9001\u548c\u672a\u53d1\u9001\uff0c\u5728 includes\/init_includes \u4e2d\u589e\u52a0\u4e00\u4e2a\u6587\u4ef6\uff0c\u6216\u8005\u5728 includes\/init_includes \u76ee\u5f55\u4e0b\u7684\u67d0\u4e2a\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee3\u7801\u90fd\u53ef\u4ee5\u3002\u6211\u662f\u5728 init_special_funcs.php \u8fd9\u4e2a\u6587\u4ef6\u672b\u5c3e\u589e\u52a0\u4ee3\u7801\uff0c\u56e0\u4e3a\u5f53\u7f51\u7ad9\u88ab\u70b9\u51fb\u4e00\u6b21\uff0c\u8fd9\u4e9b\u4ee3\u7801\u5c06\u4f1a\u88ab\u6267\u884c\u4e00\u6b21\uff0c\u5176\u5b9e\u5b8c\u5168\u6ca1\u5fc5\u8981\uff0c\u6240\u4ee5\u4f7f\u7528\u4e86&nbsp;if(rand(1,10) == 5) \u8fd9\u4e2a\u65b9\u6cd5\u6765\u9650\u5236\u4ee3\u7801\u6267\u884c\u6b21\u6570\uff0c\u5982\u679c\u4f60\u7684PV\u91cf\u8d8a\u5927\uff0c\u968f\u673a\u6570\u8bbe\u7f6e\u5c31\u8981\u76f8\u5e94\u7684\u5927\u4e9b\u5373\u53ef\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>  if(rand(1,10) == 5){   &nbsp; &nbsp; $unpaid_order = &#8220;select orders_id, orders_num, customers_name, customers_email_address, payment_reminder, delete_reminder, date_purchased from &#8221; . TABLE_ORDERS . &#8221; where orders_status = 11&#8243;;   &nbsp; &nbsp; $unpaid_order = $db-&gt;Execute($unpaid_order);   &nbsp; &nbsp; while (!$unpaid_order-&gt;EOF) {   &nbsp; &nbsp; &nbsp; &nbsp; $now=date(&#8220;Y-m-d H:i:s&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; $delete_order = date(&#8220;Y-m-d H:i:s&#8221;,strtotime(&#8220;+3days&#8221;,strtotime($unpaid_order-&gt;fields[&#8216;date_purchased&#8217;])));   &nbsp; &nbsp; &nbsp; &nbsp; $payment_reminder = date(&#8220;Y-m-d H:i:s&#8221;,strtotime(&#8220;+5Minute&#8221;,strtotime($unpaid_order-&gt;fields[&#8216;date_purchased&#8217;])));   &nbsp; &nbsp; &nbsp; &nbsp; $delete_reminder = date(&#8220;Y-m-d H:i:s&#8221;,strtotime(&#8220;+60Hour&#8221;,strtotime($unpaid_order-&gt;fields[&#8216;date_purchased&#8217;])));   &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; if($now &gt; $delete_order){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_ORDERS . &#8221; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_ORDERS_PRODUCTS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_ORDERS_PRODUCTS_DOWNLOAD . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_ORDERS_STATUS_HISTORY . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;delete from &#8221; . TABLE_ORDERS_TOTAL . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; if($unpaid_order-&gt;fields[&#8216;payment_reminder&#8217;] == 0 &amp;&amp; $now &gt; $payment_reminder){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $to_name = $unpaid_order-&gt;fields[&#8216;customers_name&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $to_address = $unpaid_order-&gt;fields[&#8216;customers_email_address&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $email_subject=&#8221;Your Pending Order No: &#8221; . $unpaid_order-&gt;fields[&#8216;orders_num&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $email_text='&lt;p&gt;Dear &#8216;.$unpaid_order-&gt;fields[&#8216;customers_name&#8217;].&#8217;,&lt;br \/&gt;&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;Thanks for choosing Geeetech, your order has been generated, however, we are still waiting for your payment, please finish the payment timely.&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;We will keep your order &nbsp;for 3 days, during that time, you can continue to pay at my order on www.geeetech.com.&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;If you do not pay in 3 days, your order will be deleted automatically, If there is any problem during the payment, please let us know as soon as possible.&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;a href=&#8221;&#8216;.zen_href_link(FILENAME_ACCOUNT_HISTORY).'&#8221; style=&#8221;height:30px; line-height:30px; border:1px #000 solid; display:block; width:100px; text-align:center; background:#ccc;&#8221;&gt;Check My Order&lt;\/a&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;a href=&#8221;&#8216;.zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO,&#8221;order_id=&#8221;.$unpaid_order-&gt;fields[&#8220;orders_id&#8221;]).'&#8221; style=&#8221;height:30px; line-height:30px; border:1px #000 solid; display:block; width:100px; text-align:center; background:#ccc;&#8221;&gt;Pay Now&lt;\/a&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $block=array(&#8220;EMAIL_MESSAGE_HTML&#8221; =&gt; $email_text);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_mail($to_name, $to_address, $email_subject, $email_text, STORE_NAME, EMAIL_FROM, $block);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;update &#8221; . TABLE_ORDERS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set payment_reminder = 1&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; if($unpaid_order-&gt;fields[&#8216;delete_reminder&#8217;] == 0 &amp;&amp; $now &gt; $delete_reminder){   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $to_name = $unpaid_order-&gt;fields[&#8216;customers_name&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $to_address = $unpaid_order-&gt;fields[&#8216;customers_email_address&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $email_subject=&#8221;Your Pending Order No: &#8221; . $unpaid_order-&gt;fields[&#8216;orders_num&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $email_text='&lt;p&gt;Dear &#8216;.$unpaid_order-&gt;fields[&#8216;customers_name&#8217;].&#8217;,&lt;br \/&gt;&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;You have placed an order at Geeetech on &#8216; . strftime(DATE_TIME_FORMAT,strtotime($unpaid_order-&gt;fields[&#8216;date_purchased&#8217;])) .&#8217; [-0600GMT], however, we are still waiting for your payment. &lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;p&gt;Your order will be deleted automatically in 12 hours, &nbsp;please finish the payment timely. If there is any problem during the payment, please let us know as soon as possible. &lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;a href=&#8221;&#8216;.zen_href_link(FILENAME_ACCOUNT_HISTORY).'&#8221; style=&#8221;height:30px; line-height:30px; border:1px #000 solid; display:block; width:100px; text-align:center; background:#ccc;&#8221;&gt;Check My Order&lt;\/a&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;a href=&#8221;&#8216;.zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO,&#8221;order_id=&#8221;.$unpaid_order-&gt;fields[&#8220;orders_id&#8221;]).'&#8221; style=&#8221;height:30px; line-height:30px; border:1px #000 solid; display:block; width:100px; text-align:center; background:#ccc;&#8221;&gt;Pay Now&lt;\/a&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/p&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8216;;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $block=array(&#8220;EMAIL_MESSAGE_HTML&#8221; =&gt; $email_text);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zen_mail($to_name, $to_address, $email_subject, $email_text, STORE_NAME, EMAIL_FROM, $block);   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute(&#8220;update &#8221; . TABLE_ORDERS . &#8221;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set delete_reminder = 1   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where orders_id = &#8216;&#8221; . (int)$unpaid_order-&gt;fields[&#8216;orders_id&#8217;] . &#8220;&#8216;&#8221;);   &nbsp; &nbsp; &nbsp; &nbsp; }   &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; $unpaid_order-&gt;MoveNext();   &nbsp; &nbsp; }   &nbsp; &nbsp;&nbsp;   &nbsp; &nbsp; $special_count = &#8220;select specials_id, specials_date_available from &#8221; . TABLE_SPECIALS . &#8221; where specials_date_available &gt; &#8216;&#8221; . date(&#8216;Y-m-d&#8217;) . &#8220;&#8216; and counter &gt; 0&#8221;;   &nbsp; &nbsp; $special_count = $db-&gt;Execute($special_count);   &nbsp; &nbsp; while(!$special_count-&gt;EOF){   &nbsp; &nbsp; &nbsp; &nbsp; $update_specials = &#8220;update &#8221; . TABLE_SPECIALS . &#8221; set counter = 0 where specials_id = &#8220;. $special_count-&gt;fields[&#8216;specials_id&#8217;];   &nbsp; &nbsp; &nbsp; &nbsp; $db-&gt;Execute($update_specials);   &nbsp; &nbsp; &nbsp; &nbsp; $special_count-&gt;MoveNext();   &nbsp; &nbsp; }   }  <\/p>\n<p> \u7ecf\u8fc7\u4e0a\u9762\u7684\u4fee\u6539\uff0c\u6211\u4eec\u7684\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n<p> 1. \u8d2d\u7269\u8f66(shopping cart)<\/p>\n<p> 2. [\u8d27\u8fd0\u65b9\u5f0f(delivery method)]<\/p>\n<p> 3. \u652f\u4ed8\u65b9\u5f0f(payment method)<\/p>\n<p> 4. \u8ba2\u5355\u786e\u8ba4(confirmation)&nbsp;&nbsp;<\/p>\n<p> 5. \u8ba2\u5355\u5904\u7406(checkout process)<\/p>\n<p> 6. \u4e0b\u5355\u6210\u529f(checkout success)<\/p>\n<p> 7. [\u7b2c\u4e09\u65b9\u7f51\u7ad9\u652f\u4ed8]&nbsp;<\/p>\n<p> \u56e0\u4e3a\u4ece\u8ba2\u5355\u786e\u8ba4\u5230\u8ba2\u5355\u5904\u7406\uff0c\u90fd\u662f\u5728\u6211\u4eec\u81ea\u5df1\u7684\u7f51\u7ad9\u5b8c\u6210\u7684\uff0c\u5e76\u4e14\u8fdb\u5165\u652f\u4ed8\u7f51\u7ad9\u4e4b\u524d\uff0c\u8ba2\u5355\u5df2\u7ecf\u5b58\u5728\u4e86\uff0c\u8fd9\u6837\u5c31\u4e0d\u4f1a\u51fa\u73b0\u6f0f\u5355\u7684\u60c5\u51b5\u4e86\u3002<\/p>\n<p> \u5728\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u4e0d\u53ef\u80fd\u76f4\u63a5\u4f7f\u7528\u81ea\u5df1\u7684Paypal\u53bb\u6d4b\u8bd5\u8ba2\u5355\uff0c\u8fd9\u6837\u624b\u7eed\u8d39\u90fd\u8981\u6263\u5f88\u5927\u90e8\u5206\uff0cPaypal\u4e3a\u4e86\u7ed9IT\u4eba\u5458\u6d4b\u8bd5\u63a5\u53e3\uff0c\u5f00\u53d1\u4e86\u865a\u62dfPaypal\u5e10\u53f7\uff0c\u53ef\u4ee5\u901a\u8fc7Paypal\u865a\u62df\u5e10\u53f7\u6d4b\u8bd5\u529f\u80fd\u3002\u5177\u4f53\u7533\u8bf7\u4f7f\u7528\u6559\u7a0b\u94fe\u63a5\u5982\u4e0b\uff1ahttp:\/\/blog.sina.com.cn\/s\/blog_7285f5d30101fq05.html<\/p>\n<p> \u603b\u7ed3\uff1a<\/p>\n<p> \u4ee5\u4e0a\u4fee\u6539\uff0c\u5b8c\u6210\u4e86\u7f51\u7ad9\u56db\u4e2a\u65b0\u529f\u80fd\u3002<\/p>\n<p> 1. \u5feb\u901f\u652f\u4ed8\u529f\u80fd<\/p>\n<p> 2. \u5148\u751f\u6210\u8ba2\u5355\u540e\u4ed8\u6b3e\u529f\u80fd<\/p>\n<p> 3. \u6309\u6307\u5b9a\u65f6\u95f4\u81ea\u52a8\u5220\u9664\u672a\u4ed8\u6b3e\u8ba2\u5355\u4ee5\u53ca\u81ea\u52a8\u53d1\u9001\u63d0\u793a\u90ae\u4ef6\u529f\u80fd<\/p>\n<p> 4. \u5b9e\u73b0\u548c\u6dd8\u5b9d\u4e00\u6837\uff0c\u540e\u53f0\u4fee\u6539\u672a\u4ed8\u6b3e\u8ba2\u5355\u4ef7\u683c\u529f\u80fd<\/p>\n<p> \u6700\u540e\uff1a\u53ef\u80fd\u8fd8\u6709\u4e9b\u4ee3\u7801\u7ec6\u8282\u6ca1\u6709\u4e00\u4e00\u8bf4\u5230\uff0c\u4f46\u662f\u4e0a\u4f20\u7684\u8fd9\u4e9b\u4ee3\u7801\u91cc\u9762\u90fd\u6709\u4f53\u73b0\uff0c\u9700\u8981\u81ea\u5df1\u4ed4\u7ec6\u770b\u3002\u6709\u4ec0\u4e48\u95ee\u9898\u53ef\u4ee5\u7ed9\u6211\u7559\u8a00\uff01<\/p>\n<p> &nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zencart \u4f7f\u7528 Paypal \u4ed8\u6b3e\uff0c\u4f1a\u51fa\u73b0\u6f0f\u5355\u7684\u60c5\u51b5\uff0c\u5373 paypal \u5df2\u7ecf\u6536\u5230\u5ba2\u6237\u7684\u4ed8\u6b3e\uff0c\u4f46\u662f\u7f51\u7ad9\u540e\u53f0\u6ca1\u6709\u5ba2\u6237\u7684\u8ba2\u5355\u3002\u5bfc\u81f4 paypal \u6f0f\u5355\u7684\u539f\u56e0\u5927\u81f4\u4f1a\u662f\u5f53\u5ba2\u6237\u8df3\u8f6c\u5230Paypal \u7f51\u7ad9\u4ed8\u6b3e\u5b8c\u6bd5\u4e4b\u540e\uff0c\u76f4\u63a5\u5173\u95ed\u4e86\u7a97\u53e3\uff0c\u6216\u8005\u7f51\u7edc\u4e0d\u7a33\u5b9a\uff0c\u6ca1\u6709\u6b63\u5e38\u8df3\u8f6c\u5230\u7f51\u7ad9\u3002 \u89e3\u51b3 Paypal \u6f0f\u5355\u95ee\u9898\u7684\u65b9\u6848\u6709\u597d\u51e0\u79cd\uff1a &nbsp; \u4e00. \u5f00\u542f Detailed Line Items in Cart \u9009\u9879\u3002 \u539f\u7406\uff1a\u5728 zencart \u540e\u53f0 Module &#8211;&gt; Payment &#8211;&gt; PayPal Website Payments Standard &#8211; IPN \u5f00\u542f Detailed Line Items in Cart \u9009\u9879\u3002\u8fd9\u4e2a\u9009\u9879\u4f1a\u628a\u4f60\u6240\u6709\u7684\u8ba2\u5355\u7269\u54c1\u4fe1\u606f\u4f20\u7ed9 paypal\uff0c\u5f53\u5ba2\u6237\u4ed8\u6b3e\u6210\u529f\u800c\u540e\u53f0\u672a\u80fd\u6210\u529f\u751f\u6210\u8ba2\u5355\u65f6\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7 paypal \u5e10\u53f7\u4ea4\u6613\u4fe1\u606f\u770b\u5230\u5ba2\u6237\u8d2d\u4e70\u4e86\u54ea\u4e9b\u7269\u54c1\u3002 &nbsp; \u4e8c. \u4f7f\u7528 Paypal Sessions Viewer \u63d2\u4ef6\u627e\u56de Paypal \u6f0f\u6389\u7684\u8ba2\u5355\u3002 \u539f\u7406\uff1azencart \u8d2d\u7269\u8f66\u7684\u7269\u54c1\uff0c\u901a\u8fc7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-60755","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=60755"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60755\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}