{"id":5721,"date":"2024-10-16T06:54:13","date_gmt":"2024-10-16T06:54:13","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=5721"},"modified":"2025-07-25T14:16:44","modified_gmt":"2025-07-25T14:16:44","slug":"shopping-cart-with-paypal-payment-gateway-in-php","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/","title":{"rendered":"Shopping Cart with PayPal Payment Gateway in PHP"},"content":{"rendered":"<p><b>Shopping cart with payment gateway<\/b> is a must-have functionality for an e-commerce website. The payment gateway allows the buyers to make payment online at the time of checkout. PayPal standard checkout is one of the easiest option to integrate payment gateway in the web application. A shopping cart helps users to select multiple products, and PayPal allows users to checkout with credit\/debit card payment.<\/p>\n<p><b>PHP shopping cart with PayPal<\/b> makes e-commerce web applications more user-friendly and feature-rich. In this tutorial, we will show you how to build shopping cart with payment gateway in PHP. This example shopping cart system uses PHP SESSION to integrate cart functionality and PayPal for online credit\/debit card payment.<\/p>\n<p>The following functionality will be implemented in the <b>PHP Shopping Cart<\/b> system.<\/p>\n<ul>\n<li>List the products on the webpage.<\/li>\n<li>Custom shopping cart library with PHP.<\/li>\n<li>Add multiple products to the cart.<\/li>\n<li>Checkout cart items with online payment.<\/li>\n<li>Payment with PayPal standard checkout and order submission.<\/li>\n<\/ul>\n<h2>PayPal REST API Credentials<\/h2>\n<p>To get started with the PayPal REST API, you need to create a developer account on the <a href=\"https:\/\/developer.paypal.com\/developer\/applications\/\"target=\"_blank\">PayPal Developer Dashboard<\/a>.<\/p>\n<p>PayPal provides two environments, Sandbox and Live. Sandbox environment allows developers to test the PayPal checkout process before making it Live for production usage. You can create sandbox Business and Personal accounts from the <a href=\"https:\/\/developer.paypal.com\/dashboard\/accounts\"target=\"_blank\">Sandbox Accounts<\/a> section.<\/p>\n<p>In the PayPal Developer Dashboard, you can switch between the Sandbox and Live environment from the toggle button placed at the top-right corner.<\/p>\n<p><b>Create Sandbox Accounts:<\/b><\/p>\n<ul>\n<li>Sandbox Merchant Account: Create a sandbox business account with <u>Account type: Business<\/u>. This merchant account is required to attach at the time of the REST API app.<\/li>\n<li>Sandbox Buyer Account: Create a sandbox buyer account with <u>Account type: Personal<\/u>. This buyer account will be used to test payment.\n<ul>\n<li>After the sandbox buyer account creation, an email ID and password will be generated. You can use these credentials to log in at the time of testing the PayPal checkout.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><b>Create REST API App:<\/b><br \/>\nIn the <u>Apps &#038; Credentials<\/u> section, create a new REST API App with <u>Type: Merchant<\/u>.<\/p>\n<ul>\n<li>Select a business account under the <u>Sandbox Account<\/u> dropdown.<\/li>\n<\/ul>\n<p>After the App creation, the <b>Client ID<\/b> and <b>Secret<\/b> will be generated.<\/p>\n<ul>\n<li>Copy these API credentials to later use in the script.<\/li>\n<\/ul>\n<p><b>Live REST API Credentials:<\/b><br \/>\nAt the top right corner, toggle the switch to Live. Then navigate to the <u>Apps &#038; Credentials<\/u> section.<\/p>\n<ul>\n<li>Create a new REST API App, you will get the credentials (Client ID and Secret) for the Live environment.<\/li>\n<\/ul>\n<h2>Getting Started<\/h2>\n<p>We suggest you follow the steps mentioned in our <a href=\"https:\/\/www.codexworld.com\/simple-php-shopping-cart-using-sessions\/\">PHP Shopping Cart<\/a> and <a href=\"https:\/\/www.codexworld.com\/paypal-standard-checkout-integration-in-php\/\">PayPal Standard Checkout<\/a> integration tutorials to initial setup.<\/p>\n<p>Before getting started, take a look at the file structure of the <b>PHP shopping cart with PayPal<\/b> script.<\/p>\n<pre class=\"file-struc\">php_shopping_cart_with_paypal<span style=\"color:#794938\">\/<\/span>\r\n\u251c\u2500\u2500 index.php\r\n\u251c\u2500\u2500 view-cart.php\r\n\u251c\u2500\u2500 checkout.php\r\n\u251c\u2500\u2500 order-status.php\r\n\u251c\u2500\u2500 config.php\r\n\u251c\u2500\u2500 dbConnect.php\r\n\u251c\u2500\u2500 cartAction.php\r\n\u251c\u2500\u2500 Cart.class.php\r\n\u251c\u2500\u2500 paypal_checkout_validate.php\r\n\u251c\u2500\u2500 PaypalCheckout.class.php\r\n\u251c\u2500\u2500 js<span style=\"color:#794938\">\/<\/span>\r\n|   \u2514\u2500\u2500 jquery.min.js\r\n\u251c\u2500\u2500 css<span style=\"color:#794938\">\/<\/span>\r\n|   \u251c\u2500\u2500 bootstrap.min.css\r\n|   \u2514\u2500\u2500 style.css\r\n\u2514\u2500\u2500 images<span style=\"color:#794938\">\/<\/span>\r\n<\/pre>\n<h2>Create Database Tables<\/h2>\n<p>Some tables (products, customers, orders, order_items, and transactions) are required in the database to store product, order, and payment details.<\/p>\n<p>The following SQL creates a <code>products<\/code> table to store the product information in the MySQL database.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">CREATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">TABLE<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`products`<\/span> (\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> AUTO_INCREMENT,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`image`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">255<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">200<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`description`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">text<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`price`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">float<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">10<\/span>,<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">2<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`created`<\/span> datetime <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`modified`<\/span> datetime <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`status`<\/span> tinyint(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COMMENT<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'1=Active | 0=Inactive'<\/span>,\r\n  PRIMARY <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>)\r\n) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ENGINE<\/span>=<span class=\"hljs-keyword\" style=\"font-weight: 700;\">InnoDB<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CHARSET<\/span>=utf8 <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<p>The following SQL creates a <code>customers<\/code> table to store the user contact information in the MySQL database.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">CREATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">TABLE<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`customers`<\/span> (\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> AUTO_INCREMENT,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`first_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">25<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`last_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">25<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`email`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`phone`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">15<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`address`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">text<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`created`<\/span> datetime <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`modified`<\/span> datetime <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`status`<\/span> tinyint(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COMMENT<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'1=Active | 0=Inactive'<\/span>,\r\n  PRIMARY <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>)\r\n) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ENGINE<\/span>=<span class=\"hljs-keyword\" style=\"font-weight: 700;\">InnoDB<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CHARSET<\/span>=utf8 <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<p>The following SQL creates an <code>orders<\/code> table in the MySQL database to store the order info that submitted by the customer. The <code>customer_id<\/code> will be a FOREIGN KEY which is associated with the customers table.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">CREATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">TABLE<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`orders`<\/span> (\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> AUTO_INCREMENT,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`customer_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`grand_total`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">float<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">10<\/span>,<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">2<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`payment_status`<\/span> tinyint(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">0<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COMMENT<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'1=Paid | 0=Pending'<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`created`<\/span> datetime <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`status`<\/span> enum(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Pending'<\/span>,<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Completed'<\/span>,<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Cancelled'<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Pending'<\/span>,\r\n  PRIMARY <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>),\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`customer_id`<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`customer_id`<\/span>),\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CONSTRAINT<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`orders_ibfk_1`<\/span> FOREIGN <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`customer_id`<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">REFERENCES<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`customers`<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ON<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DELETE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CASCADE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ON<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">UPDATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NO<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ACTION<\/span>\r\n) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ENGINE<\/span>=<span class=\"hljs-keyword\" style=\"font-weight: 700;\">InnoDB<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CHARSET<\/span>=utf8 <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<p>The following SQL creates an <code>order_items<\/code> table to store the items of each order in the MySQL database. The <code>order_id<\/code> will be a FOREIGN KEY which is associated with the orders table.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">CREATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">TABLE<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_items`<\/span> (\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> AUTO_INCREMENT,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`product_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`quantity`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">5<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  PRIMARY <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>),\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span>),\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CONSTRAINT<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_items_ibfk_1`<\/span> FOREIGN <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">REFERENCES<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`orders`<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ON<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DELETE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CASCADE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ON<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">UPDATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NO<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ACTION<\/span>\r\n) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ENGINE<\/span>=<span class=\"hljs-keyword\" style=\"font-weight: 700;\">InnoDB<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CHARSET<\/span>=utf8 <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<p>The following SQL creates a <code>transactions<\/code> table to store the payment details in the MySQL database. The <code>order_id<\/code> will be a FOREIGN KEY which is associated with the orders table.<\/p>\n<pre style=\"color: rgb(68, 68, 68);\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">CREATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">TABLE<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`transactions`<\/span> (\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span> AUTO_INCREMENT,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">int<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">11<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`item_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">255<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`payer_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`payer_name`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`payer_email`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`payer_country`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">20<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`merchant_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">255<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`merchant_email`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`paypal_order_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`transaction_id`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`paid_amount`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">float<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">10<\/span>,<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">2<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`paid_amount_currency`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">10<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`payment_source`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">50<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`payment_status`<\/span> <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">varchar<\/span>(<span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">25<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`created`<\/span> datetime <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`modified`<\/span> datetime <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NOT<\/span> <span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">NULL<\/span>,\r\n  PRIMARY <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>),\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span>),\r\n  <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CONSTRAINT<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`transactions_ibfk_1`<\/span> FOREIGN <span class=\"hljs-keyword\" style=\"font-weight: 700;\">KEY<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`order_id`<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">REFERENCES<\/span> <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`orders`<\/span> (<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">`id`<\/span>) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ON<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DELETE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CASCADE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ON<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">UPDATE<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">NO<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ACTION<\/span>\r\n) <span class=\"hljs-keyword\" style=\"font-weight: 700;\">ENGINE<\/span>=<span class=\"hljs-keyword\" style=\"font-weight: 700;\">InnoDB<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">DEFAULT<\/span> <span class=\"hljs-keyword\" style=\"font-weight: 700;\">CHARSET<\/span>=utf8 <span class=\"hljs-keyword\" style=\"font-weight: 700;\">COLLATE<\/span>=utf8_unicode_ci;<\/pre>\n<h2>PayPal API, Currency and Database Configuration (config.php)<\/h2>\n<p>In the config.php file, constant variables of the Currency, PayPal Checkout API, and database settings are defined.<\/p>\n<p><b>Product Information:<\/b><\/p>\n<ul>\n<li>CURRENCY \u2013 Currency code.<\/li>\n<li>CURRENCY_SYMBOL \u2013 Graphic symbol of currency.<\/li>\n<\/ul>\n<p><b>Database Constants:<\/b><\/p>\n<ul>\n<li>DB_HOST \u2013 Specify the database host.<\/li>\n<li>DB_USERNAME \u2013 Specify the database username.<\/li>\n<li>DB_PASSWORD \u2013 Specify the database password.<\/li>\n<li>DB_NAME \u2013 Specify the database name.<\/li>\n<\/ul>\n<p><b>PayPal REST API Constants:<\/b><\/p>\n<ul>\n<li>PAYPAL_SANDBOX \u2013 (TRUE\/FALSE) Set PayPal environment, Sandbox or Live.<\/li>\n<li>PAYPAL_SANDBOX_CLIENT_ID \u2013 Client ID of PayPal Sandbox REST API App.<\/li>\n<li>PAYPAL_SANDBOX_CLIENT_SECRET \u2013 Secret key of PayPal Sandbox REST API App.<\/li>\n<li>PAYPAL_PROD_CLIENT_ID \u2013 Client ID of PayPal Live REST API App.<\/li>\n<li>PAYPAL_PROD_CLIENT_SECRET \u2013 Secret key of PayPal Live REST API App.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Common&nbsp;settings <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'CURRENCY'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'USD'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'CURRENCY_SYMBOL'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'$'<\/span><span style=\"color: #007700\">); <br \/>&nbsp; <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Database&nbsp;configuration&nbsp; <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_HOST'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Host'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_USERNAME'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Username'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_PASSWORD'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Password'<\/span><span style=\"color: #007700\">);&nbsp; <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'DB_NAME'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'MySQL_Database_Name'<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/*&nbsp;PayPal&nbsp;REST&nbsp;API&nbsp;configuration <br \/>&nbsp;*&nbsp;You&nbsp;can&nbsp;generate&nbsp;API&nbsp;credentials&nbsp;from&nbsp;the&nbsp;PayPal&nbsp;developer&nbsp;panel. <br \/>&nbsp;*&nbsp;See&nbsp;your&nbsp;keys&nbsp;here:&nbsp;https:\/\/developer.paypal.com\/dashboard\/ <br \/>&nbsp;*\/ <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_SANDBOX'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">TRUE<\/span><span style=\"color: #007700\">);&nbsp;<\/span><span style=\"color: #FF8000\">\/\/TRUE=Sandbox&nbsp;|&nbsp;FALSE=Production <br \/>\/\/&nbsp;PayPal&nbsp;API&nbsp;keys&nbsp;for&nbsp;Sandbox <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_SANDBOX_CLIENT_ID'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_PayPal_Client_ID_For_Sandbox_Here'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_SANDBOX_CLIENT_SECRET'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_PayPal_Secret_Key_For_Sandbox_Here'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;PayPal&nbsp;API&nbsp;keys&nbsp;for&nbsp;Production <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_PROD_CLIENT_ID'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_Live_PayPal_Client_ID_Here'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_PROD_CLIENT_SECRET'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_Live_PayPal_Secret_Key_Here'<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Start&nbsp;session <br \/><\/span><span style=\"color: #007700\">if(!<\/span><span style=\"color: #0000BB\">session_id<\/span><span style=\"color: #007700\">()){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">session_start<\/span><span style=\"color: #007700\">(); <br \/>} <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<p><span class=\"note\">Note that:<\/span> PayPal API Client ID and Secret will be found in the REST API App section of your PayPal Developer Dashboard.<\/p>\n<h2>Database Connection (dbConnect.php)<\/h2>\n<p>The <code>dbConnect.php<\/code> file is used to connect and select the MySQL database using PHP.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;configuration&nbsp;file <br \/><\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'config.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Connect&nbsp;with&nbsp;the&nbsp;database&nbsp; <br \/><\/span><span style=\"color: #0000BB\">$db&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">mysqli<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">DB_HOST<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">DB_USERNAME<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">DB_PASSWORD<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">DB_NAME<\/span><span style=\"color: #007700\">);&nbsp; <br \/>&nbsp; <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Display&nbsp;error&nbsp;if&nbsp;failed&nbsp;to&nbsp;connect&nbsp; <br \/><\/span><span style=\"color: #007700\">if&nbsp;(<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_errno<\/span><span style=\"color: #007700\">)&nbsp;{&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">printf<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"Connect&nbsp;failed:&nbsp;%s\\n\"<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">connect_error<\/span><span style=\"color: #007700\">);&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;exit();&nbsp; <br \/>} <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span> <\/span><\/pre>\n<h2>PayPal Checkout &#038; Cart Handler Library<\/h2>\n<p>We will use two custom PHP libraries, named <code>PaypalCheckout.class.php<\/code> and <code>Cart.class.php<\/code> to handle PayPal check and shopping cart related operations.<\/p>\n<ul>\n<li>The PaypalCheckout library (PaypalCheckout.class.php) helps to validate transactions and retrieve order details with PayPal Orders REST API using PHP.<\/li>\n<li>The Cart library (Cart.class.php) helps to process shopping cart operations with SESSION in PHP.<\/li>\n<\/ul>\n<h2>Bootstrap and jQuery Library<\/h2>\n<p>We will use the Bootstrap 5 library to design UI elements in HTML.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">link<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"css\/bootstrap.min.css\"<\/span> <span class=\"hljs-attr\">rel<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"stylesheet\"<\/span>&gt;<\/span><\/pre>\n<p>The jQuery library is used in the cart page to update cart items via AJAX.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"js\/jquery.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<h2>Products list (index.php)<\/h2>\n<p>Initially, all the products are fetched from the database and listed in a grid view.<\/p>\n<ul>\n<li>Add to Cart button is attached to each product box.<\/li>\n<li>Add to Cart button redirects the user to the <code>cartAction.php<\/code> page with action type (<code>action=addToCart<\/code>) and respective product ID (<code>id<\/code>).<\/li>\n<li>In the basket, the number of the cart items is shown which redirects the user to the shopping cart page.<\/li>\n<\/ul>\n<pre style=\"color: rgb(95, 94, 78);\"><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;database&nbsp;connection&nbsp;file <br \/><\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'dbConnect.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Initialize&nbsp;shopping&nbsp;cart&nbsp;class <br \/><\/span><span style=\"color: #007700\">include_once&nbsp;<\/span><span style=\"color: #DD0000\">'Cart.class.php'<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$cart&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">Cart<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Fetch&nbsp;products&nbsp;from&nbsp;the&nbsp;database <br \/><\/span><span style=\"color: #0000BB\">$sqlQ&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;*&nbsp;FROM&nbsp;products\"<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$stmt&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">prepare<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$sqlQ<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">execute<\/span><span style=\"color: #007700\">(); <br \/><\/span><span style=\"color: #0000BB\">$result&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">get_result<\/span><span style=\"color: #007700\">(); <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    \r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row g-5\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Cart basket --&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-12 mb-2\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text-end\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"view-cart.php\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"btn btn-outline-secondary\"<\/span> <span class=\"hljs-attr\">title<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"View Cart\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"icart\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span>&gt;<\/span> (<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;(<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">()&nbsp;&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">)?<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">().<\/span><span style=\"color: #DD0000\">'&nbsp;Items'<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>)<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n    \r\n    <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Product list --&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-12\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row row-cols-1 row-cols-md-3 g-4\"<\/span>&gt;<\/span>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$row&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$proImg&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"image\"<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #DD0000\">'images\/products\/'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"image\"<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">'images\/demo-img.png'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card h-100\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$proImg<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card-img-top\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"...\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card-body\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h5<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card-title\"<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"name\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h5<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h6<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card-subtitle mb-2 text-muted\"<\/span>&gt;<\/span>Price: <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"price\"<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h6<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"card-text\"<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"description\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"cartAction.php?action=addToCart&amp;id=<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$row<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"id\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/span>\" class=\"btn btn-primary\"&gt;Add to Cart<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;}else{&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>Product(s) not found.....<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n            <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><\/pre>\n<h2>Shopping Cart (view-cart.php)<\/h2>\n<p>All the cart items are retrieved from the SESSION using the Cart library and listed in a tabular format.<\/p>\n<ul>\n<li>The user can update the quantity and remove items from the cart.<\/li>\n<\/ul>\n<pre style=\"color: rgb(95, 94, 78);\"><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;configuration&nbsp;file <br \/><\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'config.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Initialize&nbsp;shopping&nbsp;cart&nbsp;class <br \/><\/span><span style=\"color: #007700\">include_once&nbsp;<\/span><span style=\"color: #DD0000\">'Cart.class.php'<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$cart&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">Cart<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n\r\n<span style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row g-5\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"cart\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-12\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"table-responsive\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">table<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"table table-striped cart\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">thead<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"10%\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"35%\"<\/span>&gt;<\/span>Product<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"15%\"<\/span>&gt;<\/span>Price<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"15%\"<\/span>&gt;<\/span>Quantity<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"20%\"<\/span>&gt;<\/span>Total<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"5%\"<\/span>&gt;<\/span> <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">thead<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tbody<\/span>&gt;<\/span>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">()&nbsp;&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;cart&nbsp;items&nbsp;from&nbsp;session <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$cartItems&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">contents<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(<\/span><span style=\"color: #0000BB\">$cartItems&nbsp;<\/span><span style=\"color: #007700\">as&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">){ <br \/>&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;<\/span><span style=\"color: #0000BB\">$proImg&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"image\"<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #DD0000\">'images\/products\/'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"image\"<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">'images\/demo-img.png'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$proImg<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"...\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"name\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"price\"<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"form-control\"<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"number\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"qty\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/span>\" onchange=\"updateCartItem(this, '<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"rowid\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>')\"\/&gt;<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"subtotal\"<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">button<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"btn btn-sm btn-danger\"<\/span> <span class=\"hljs-attr\">onclick<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"return confirm('Are you sure to remove cart item?')?window.location.href='cartAction.php?action=removeCartItem&amp;id=<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"rowid\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/span>':false;\" title=\"Remove Item\"&gt;<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"itrash\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span>&gt;<\/span> <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">button<\/span>&gt;<\/span> <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                    <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;}else{&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span> <span class=\"hljs-attr\">colspan<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"6\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>Your cart is empty.....<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                    <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                    <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">()&nbsp;&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span>Cart Total<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total<\/span><span style=\"color: #007700\">().<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                    <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tbody<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">table<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col mb-2\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-sm-12  col-md-6\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"index.php\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"btn btn-block btn-secondary\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"ialeft\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span>&gt;<\/span>Continue Shopping<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-sm-12 col-md-6 text-end\"<\/span>&gt;<\/span>\r\n                    <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">()&nbsp;&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"checkout.php\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"btn btn-block btn-primary\"<\/span>&gt;<\/span>Proceed to Checkout<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"iaright\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span>&gt;<\/span>\r\n                    <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><\/span><\/pre>\n<pre><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n<span style=\"color: rgb(68, 68, 68);\"><span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span> <span class=\"hljs-title\" style=\"color: rgb(136, 0, 0); font-weight: 700;\">updateCartItem<\/span>(<span class=\"hljs-params\">obj,id<\/span>)<\/span>{\r\n    $.get(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"cartAction.php\"<\/span>, {action:<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"updateCartItem\"<\/span>, id:id, qty:obj.value}, <span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\">data<\/span>)<\/span>{\r\n        <span class=\"hljs-keyword\" style=\"font-weight: 700;\">if<\/span>(data == <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'ok'<\/span>){\r\n            location.reload();\r\n        }<span class=\"hljs-keyword\" style=\"font-weight: 700;\">else<\/span>{\r\n            alert(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'Cart update failed, please try again.'<\/span>);\r\n        }\r\n    });\r\n}<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<h2>Checkout and Payment (checkout.php)<\/h2>\n<p>In the checkout page, the buyer can preview the cart items before order submission.<\/p>\n<ul>\n<li>Once the billing details are submitted, the PayPal payment button will appear.<\/li>\n<li>The buyer can select credit\/debit card or PayPal to make payment online.<\/li>\n<li>The payment process is handled by the REST API (<code>paypal_checkout_validate.php<\/code>) using PayPal standard checkout system.<\/li>\n<li>On payment success, the buyer will be redirected to the order status page.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;configuration&nbsp;file <br \/><\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'config.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Initialize&nbsp;shopping&nbsp;cart&nbsp;class <br \/><\/span><span style=\"color: #007700\">include_once&nbsp;<\/span><span style=\"color: #DD0000\">'Cart.class.php'<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$cart&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;new&nbsp;<\/span><span style=\"color: #0000BB\">Cart<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;If&nbsp;the&nbsp;cart&nbsp;is&nbsp;empty,&nbsp;redirect&nbsp;to&nbsp;the&nbsp;products&nbsp;page <br \/><\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">()&nbsp;&lt;=&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">header<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"Location:&nbsp;index.php\"<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;exit(); <br \/>} <br \/> <br \/><\/span><span style=\"color: #0000BB\">$paypal_item_desc&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'Cart&nbsp;Order&nbsp;('<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">().<\/span><span style=\"color: #DD0000\">'&nbsp;items)'<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$paypal_total_amount&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total<\/span><span style=\"color: #007700\">() <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- PayPal JS SDK --&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"https:\/\/www.paypal.com\/sdk\/js?client-id=<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">PAYPAL_SANDBOX<\/span><span style=\"color: #007700\">?<\/span><span style=\"color: #0000BB\">PAYPAL_SANDBOX_CLIENT_ID<\/span><span style=\"color: #007700\">:<\/span><span style=\"color: #0000BB\">PAYPAL_PROD_CLIENT_ID<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>&amp;currency=<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row g-5\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-12\"<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"checkout\"<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-4 order-md-2 mb-4\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"d-flex justify-content-between align-items-center mb-3\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text-primary\"<\/span>&gt;<\/span>Your Cart<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"badge bg-primary rounded-pill\"<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">();&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">ul<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"list-group mb-3\"<\/span>&gt;<\/span>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">if(<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total_items<\/span><span style=\"color: #007700\">()&nbsp;&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;cart&nbsp;items&nbsp;from&nbsp;session <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$cartItems&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">contents<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(<\/span><span style=\"color: #0000BB\">$cartItems&nbsp;<\/span><span style=\"color: #007700\">as&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"list-group-item d-flex justify-content-between lh-condensed\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h6<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"my-0\"<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"name\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h6<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">small<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text-muted\"<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"price\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>(<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"qty\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>)<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">small<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text-muted\"<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"subtotal\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                    <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"list-group-item d-flex justify-content-between\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span>&gt;<\/span>Total (<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>)<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">span<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$cart<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">total<\/span><span style=\"color: #007700\">();&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">strong<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">li<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">ul<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"index.php\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"btn btn-sm btn-success\"<\/span>&gt;<\/span>+ add items<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-8 order-md-1\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"overlay hidden\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"overlay-content\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"images\/loading.gif\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"Processing...\"<\/span>\/&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"billingWrap\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"mb-3\"<\/span>&gt;<\/span>Billing Details<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span>&gt;<\/span>\r\n\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"status-msg\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"billingFrm\"<\/span> <span class=\"hljs-attr\">action<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"#\"<\/span> <span class=\"hljs-attr\">method<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"post\"<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row\"<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-6 mb-3\"<\/span>&gt;<\/span>\r\n                                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span> <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"first_name\"<\/span>&gt;<\/span>First Name<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"form-control\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"first_name\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'first_name'<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'first_name'<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">required<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-6 mb-3\"<\/span>&gt;<\/span>\r\n                                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span> <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"last_name\"<\/span>&gt;<\/span>Last Name<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"form-control\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"last_name\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'last_name'<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'last_name'<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">required<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"mb-3\"<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span> <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"email\"<\/span>&gt;<\/span>Email<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"email\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"form-control\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"email\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">required<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"mb-3\"<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span> <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"phone\"<\/span>&gt;<\/span>Phone<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"form-control\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"phone\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'phone'<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'phone'<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">required<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"mb-3\"<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span> <span class=\"hljs-attr\">for<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"last_name\"<\/span>&gt;<\/span>Address<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">label<\/span>&gt;<\/span>\r\n                                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"text\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"form-control\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"address\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'address'<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #0000BB\">$postData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'address'<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">''<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">required<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">hr<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"my-4\"<\/span>&gt;<\/span>\r\n                        \r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"hidden\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"action\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"placeOrder\"<\/span>\/&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"btn btn-primary btn-block\"<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"submit\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"checkoutSubmit\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"Continue\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"paymentWrap\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"hidden\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"mb-3\"<\/span>&gt;<\/span>Proceed with Payment<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">h4<\/span>&gt;<\/span>\r\n                        \r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"status-msg-pay\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n\r\n                        <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Set up a container element for the button --&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"paypal-button-container\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><\/pre>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span>\r\n<span style=\"color: rgb(68, 68, 68);\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">const<\/span> billingWrap = <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"#billingWrap\"<\/span>);\r\n<span class=\"hljs-keyword\" style=\"font-weight: 700;\">const<\/span> paymentWrap = <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"#paymentWrap\"<\/span>);\r\n\r\n<span class=\"hljs-comment\" style=\"color: rgb(136, 136, 136);\">\/\/ Show a loader on payment form processing<\/span>\r\n<span class=\"hljs-keyword\" style=\"font-weight: 700;\">const<\/span> setProcessing = (isProcessing) =&gt; {\r\n    <span class=\"hljs-keyword\" style=\"font-weight: 700;\">if<\/span> (isProcessing) {\r\n        <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\".overlay\"<\/span>).classList.remove(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"hidden\"<\/span>);\r\n    } <span class=\"hljs-keyword\" style=\"font-weight: 700;\">else<\/span> {\r\n        <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\".overlay\"<\/span>).classList.add(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"hidden\"<\/span>);\r\n    }\r\n}\r\n\r\n<span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"#billingFrm\"<\/span>).addEventListener(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"submit\"<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\" style=\"font-weight: 700;\">function<\/span>(<span class=\"hljs-params\">e<\/span>)<\/span>{\r\n    e.preventDefault();\r\n    setProcessing(<span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">true<\/span>);\r\n    \r\n    <span class=\"hljs-keyword\" style=\"font-weight: 700;\">let<\/span> form = <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'#billingFrm'<\/span>);\r\n    <span class=\"hljs-keyword\" style=\"font-weight: 700;\">let<\/span> formData = <span class=\"hljs-keyword\" style=\"font-weight: 700;\">new<\/span> FormData(form);\r\n    formData.append(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"action\"<\/span>, <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'billing_submit'<\/span>);\r\n\r\n    fetch(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"cartAction.php\"<\/span>, {\r\n        method: <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"POST\"<\/span>,\r\n        body: formData,\r\n    })\r\n    .then(response =&gt; response.json())\r\n    .then(data =&gt; {\r\n        <span class=\"hljs-keyword\" style=\"font-weight: 700;\">if<\/span>(data.status == <span class=\"hljs-number\" style=\"color: rgb(136, 0, 0);\">1<\/span>){\r\n            billingWrap.classList.add(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"hidden\"<\/span>);\r\n            paymentWrap.classList.remove(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"hidden\"<\/span>);\r\n\r\n            <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'.status-msg-pay'<\/span>).innerHTML = <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'&lt;div class=\"alert alert-success\"&gt;'<\/span>+data.msg+<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'&lt;\/div&gt;'<\/span>;\r\n        }<span class=\"hljs-keyword\" style=\"font-weight: 700;\">else<\/span>{\r\n            <span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">document<\/span>.querySelector(<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'.status-msg'<\/span>).innerHTML = <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'&lt;div class=\"alert alert-danger\"&gt;'<\/span>+data.msg+<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">'&lt;\/div&gt;'<\/span>;\r\n        }\r\n\r\n        setProcessing(<span class=\"hljs-literal\" style=\"color: rgb(120, 169, 96);\">false<\/span>);\r\n        \r\n    })\r\n    .catch(<span class=\"hljs-built_in\" style=\"color: rgb(57, 115, 0);\">console<\/span>.error);\r\n});\r\n\r\npaypal.Buttons({\r\n    <span class=\"hljs-comment\" style=\"color: rgb(136, 136, 136);\">\/\/ Sets up the transaction when a payment button is clicked<\/span>\r\n    createOrder: (data, actions) =&gt; {\r\n        <span class=\"hljs-keyword\" style=\"font-weight: 700;\">return<\/span> actions.order.create({\r\n            <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"purchase_units\"<\/span>: [{\r\n                <span class=\"hljs-comment\" style=\"color: rgb(136, 136, 136);\">\/\/\"custom_id\": \"\",<\/span>\r\n                <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"description\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$paypal_item_desc<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span>,\r\n                <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"amount\"<\/span>: {\r\n                    <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"currency_code\"<\/span>: <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span>,\r\n                    <span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"value\"<\/span>: <span class=\"xml\"><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$paypal_total_amount<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>,\r\n                    \"breakdown\": {\r\n                        \"item_total\": {  \/* Required when including the items array *\/\r\n                            \"currency_code\": \"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\",\r\n                            \"value\": <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$paypal_total_amount<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        }\r\n                    }\r\n                },\r\n                \"items\": [\r\n                    {\r\n                        \"name\": \"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$paypal_item_desc<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\", \/* Shows within upper-right dropdown during payment approval *\/\r\n                        \"description\": \"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$paypal_item_desc<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\", \/* Item details will also be in the completed paypal.com transaction view *\/\r\n                        \"unit_amount\": {\r\n                            \"currency_code\": \"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\",\r\n                            \"value\": <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$paypal_total_amount<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        },\r\n                        \"quantity\": \"1\",\r\n                        \"category\": \"DIGITAL_GOODS\"\r\n                    },\r\n                ]\r\n            }]\r\n        });\r\n    },\r\n    \/\/ Finalize the transaction after payer approval\r\n    onApprove: (data, actions) =&gt; {\r\n        return actions.order.capture().then(function(orderData) {\r\n            setProcessing(true);\r\n\r\n            var postData = {paypal_order_check: 1, order_id: orderData.id};\r\n            fetch(\"paypal_checkout_validate.php\", {\r\n                method: 'POST',\r\n                headers: {'Accept': 'application\/json'},\r\n                body: encodeFormData(postData)\r\n            })\r\n            .then((response) =&gt; response.json())\r\n            .then((result) =&gt; {\r\n                if(result.status == 1){\r\n                    window.location.href = \"order-status.php?ref_id=\"+result.ref_id;\r\n                }else{\r\n                    document.querySelector('.status-msg-pay').innerHTML = '<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\" style=\"font-weight: 700;\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(136, 0, 0);\">\"alert alert-danger\"<\/span>&gt;<\/span>'+result.msg+'<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\" style=\"font-weight: 700;\">div<\/span>&gt;<\/span>';\r\n                }\r\n                setProcessing(false);\r\n            })\r\n            .catch(error =&gt; console.log(error));\r\n        });\r\n    }\r\n}).render('#paypal-button-container');\r\n\r\nconst encodeFormData = (data) =&gt; {\r\n  var form_data = new FormData();\r\n\r\n  for ( var key in data ) {\r\n    form_data.append(key, data[key]);\r\n  }\r\n  return form_data;   \r\n}<\/span><\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<h2>Order Status (order-status.php)<\/h2>\n<p>The order details are fetched from the database based on the order ID passed in the URL.<\/p>\n<ul>\n<li>The associated transaction details are displayed.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Include&nbsp;the&nbsp;database&nbsp;connection&nbsp;file <br \/><\/span><span style=\"color: #007700\">require_once&nbsp;<\/span><span style=\"color: #DD0000\">'dbConnect.php'<\/span><span style=\"color: #007700\">; <br \/> <br \/>if(!empty(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'ref_id'<\/span><span style=\"color: #007700\">])){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$order_id&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">base64_decode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$_GET<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'ref_id'<\/span><span style=\"color: #007700\">]); <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Fetch&nbsp;order&nbsp;details&nbsp;from&nbsp;the&nbsp;database <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$sqlQ&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;R.*,&nbsp;T.transaction_id,&nbsp;T.paid_amount,&nbsp;T.paid_amount_currency,&nbsp;T.payment_source,&nbsp;T.payment_status,&nbsp;C.first_name,&nbsp;C.last_name,&nbsp;C.email,&nbsp;C.phone,&nbsp;C.address&nbsp;FROM&nbsp;orders&nbsp;as&nbsp;R&nbsp;LEFT&nbsp;JOIN&nbsp;transactions&nbsp;as&nbsp;T&nbsp;ON&nbsp;T.order_id&nbsp;=&nbsp;R.id&nbsp;LEFT&nbsp;JOIN&nbsp;customers&nbsp;as&nbsp;C&nbsp;ON&nbsp;C.id&nbsp;=&nbsp;R.customer_id&nbsp;WHERE&nbsp;R.id=?\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$stmt&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">prepare<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$sqlQ<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">bind_param<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"i\"<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$order_id<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">execute<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$result&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">get_result<\/span><span style=\"color: #007700\">(); <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$orderData&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>} <br \/> <br \/>if(empty(<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">)){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">header<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"Location:&nbsp;index.php\"<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;exit(); <br \/>} <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n\r\n<span style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row g-5\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-12\"<\/span>&gt;<\/span>\r\n        <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">if(!empty(<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">)){&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-12\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"alert alert-success\"<\/span>&gt;<\/span>Your order has been placed successfully.<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                    \r\n            <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Order status &amp; shipping info --&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row col-lg-12 ord-addr-info\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-4\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"hdr\"<\/span>&gt;<\/span>Order Details<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Reference ID:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> #<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'id'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Total:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'grand_total'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Placed On:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'created'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-4\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"hdr\"<\/span>&gt;<\/span>Payment Information<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Transaction ID:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'transaction_id'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Paid Amount:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'paid_amount'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'paid_amount_currency'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Payment Source:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'payment_source'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Payment Status:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'payment_status'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-4\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"hdr\"<\/span>&gt;<\/span>Buyer Information<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Name:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'first_name'<\/span><span style=\"color: #007700\">].<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'last_name'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Email:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'email'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Phone:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'phone'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span>Address:<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">b<\/span>&gt;<\/span> <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$orderData<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'address'<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">p<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n\r\n            <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Order items --&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row col-lg-12\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">table<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"table table-hover cart\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">thead<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"10%\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"45%\"<\/span>&gt;<\/span>Product<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"15%\"<\/span>&gt;<\/span>Price<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"10%\"<\/span>&gt;<\/span>QTY<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span> <span class=\"hljs-attr\">width<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"20%\"<\/span>&gt;<\/span>Sub Total<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">th<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">thead<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tbody<\/span>&gt;<\/span>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;order&nbsp;items&nbsp;from&nbsp;the&nbsp;database <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$sqlQ&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">\"SELECT&nbsp;i.*,&nbsp;p.name,&nbsp;p.image,&nbsp;p.price&nbsp;FROM&nbsp;order_items&nbsp;as&nbsp;i&nbsp;LEFT&nbsp;JOIN&nbsp;products&nbsp;as&nbsp;p&nbsp;ON&nbsp;p.id&nbsp;=&nbsp;i.product_id&nbsp;WHERE&nbsp;i.order_id=?\"<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$stmt&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$db<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">prepare<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$sqlQ<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">bind_param<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"i\"<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">$db_id<\/span><span style=\"color: #007700\">); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$db_id&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$order_id<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">execute<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$result&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$stmt<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">get_result<\/span><span style=\"color: #007700\">(); <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">num_rows&nbsp;<\/span><span style=\"color: #007700\">&gt;&nbsp;<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">){&nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while(<\/span><span style=\"color: #0000BB\">$item&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$result<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">fetch_assoc<\/span><span style=\"color: #007700\">()){ <br \/>&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;<\/span><span style=\"color: #0000BB\">$price&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"price\"<\/span><span style=\"color: #007700\">]; <br \/>&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;<\/span><span style=\"color: #0000BB\">$quantity&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"quantity\"<\/span><span style=\"color: #007700\">]; <br \/>&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;<\/span><span style=\"color: #0000BB\">$sub_total&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;(<\/span><span style=\"color: #0000BB\">$price<\/span><span style=\"color: #007700\">*<\/span><span style=\"color: #0000BB\">$quantity<\/span><span style=\"color: #007700\">); <br \/>&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;<\/span><span style=\"color: #0000BB\">$proImg&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;!empty(<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"image\"<\/span><span style=\"color: #007700\">])?<\/span><span style=\"color: #DD0000\">'images\/products\/'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"image\"<\/span><span style=\"color: #007700\">]:<\/span><span style=\"color: #DD0000\">'images\/demo-img.png'<\/span><span style=\"color: #007700\">; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"<span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$proImg<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\"<\/span> <span class=\"hljs-attr\">alt<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"...\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$item<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">\"name\"<\/span><span style=\"color: #007700\">];&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$price<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$quantity<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span><span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">CURRENCY_SYMBOL<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$sub_total<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #DD0000\">'&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">CURRENCY<\/span><span style=\"color: #007700\">;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">td<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tr<\/span>&gt;<\/span>\r\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: #0000BB\">&lt;?php <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">tbody<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">table<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col mb-2\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"row\"<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-sm-12  col-md-6\"<\/span>&gt;<\/span>\r\n                        <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"index.php\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"btn btn-block btn-primary\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"ialeft\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">i<\/span>&gt;<\/span>Continue Shopping<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">a<\/span>&gt;<\/span>\r\n                    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n        <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}else{&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"col-md-12\"<\/span>&gt;<\/span>\r\n                <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"alert alert-danger\"<\/span>&gt;<\/span>Your order submission failed!<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n            <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n        <span style=\"color: #0000BB\">&lt;?php&nbsp;<\/span><span style=\"color: #007700\">}&nbsp;<\/span><span style=\"color: #0000BB\">?&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">div<\/span>&gt;<\/span><\/span>\r\n<\/pre>\n<h2>Make PayPal Standard Checkout Payment Gateway Live<\/h2>\n<p>Once the integration is completed and the payment process is working properly, follow the below steps to make PayPal checkout live.<br \/>\n<b>1.<\/b> Go to the PayPal Developer Dashboard Stripe account.<\/p>\n<ul>\n<li>Switch to the Live environment using the toggle button at the top-right corner.<\/li>\n<li>Navigate to the <b>Apps &#038; Credentials<\/b> section and collect the REST API credentials (Client ID and Secret) for the Live environment.<\/li>\n<\/ul>\n<p><b>2.<\/b> In the <code>config.php<\/code> file, <\/p>\n<ul>\n<li>Set the PAYPAL_SANDBOX to FALSE.<\/li>\n<li>Specify the REST API keys (Client ID and Secret key) in PAYPAL_PROD_CLIENT_ID  and PAYPAL_PROD_CLIENT_SECRET variables.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_SANDBOX'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #0000BB\">FALSE<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_PROD_CLIENT_ID'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_Live_PayPal_Client_ID_Here'<\/span><span style=\"color: #007700\">); <br \/><\/span><span style=\"color: #0000BB\">define<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">'PAYPAL_PROD_CLIENT_SECRET'<\/span><span style=\"color: #007700\">,&nbsp;<\/span><span style=\"color: #DD0000\">'Insert_Live_PayPal_Secret_Key_Here'<\/span><span style=\"color: #007700\">);<\/span><\/pre>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/paypal-advanced-checkout-card-payments-integration-in-php\/\">PayPal Advanced Checkout Card Payments Integration in PHP<\/a><\/span><\/p>\n<h2>Conclusion<\/h2>\n<p>That&#8217;s all! Now you are ready to accept payment on shopping cart checkout. You can use this PHP shopping cart script in your e-commerce website and allow the buyer to make payments online. All the required files are included in the source code package, download it to integrate shopping cart with payment gateway instantly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shopping cart with payment gateway is a must-have functionality for an e-commerce website. The payment gateway allows the buyers to make payment online at the time of checkout. PayPal standard checkout is one of the <\/p>\n","protected":false},"author":1,"featured_media":5724,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[218,73,14,219],"class_list":["post-5721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-cart","tag-paypal","tag-php","tag-shopping","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Shopping Cart with PayPal Payment Gateway in PHP - CodexWorld<\/title>\n<meta name=\"description\" content=\"PHP Shopping cart with PayPal - Build shopping cart system with payment gateway in PHP. Example code to integrate PayPal in shopping cart checkout using PHP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Shopping Cart with PayPal Payment Gateway in PHP - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"PHP Shopping cart with PayPal - Build shopping cart system with payment gateway in PHP. Example code to integrate PayPal in shopping cart checkout using PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-16T06:54:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-25T14:16:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2024\/10\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Shopping Cart with PayPal Payment Gateway in PHP\",\"datePublished\":\"2024-10-16T06:54:13+00:00\",\"dateModified\":\"2025-07-25T14:16:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/\"},\"wordCount\":1225,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png\",\"keywords\":[\"Cart\",\"PayPal\",\"PHP\",\"Shopping\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/\",\"name\":\"Shopping Cart with PayPal Payment Gateway in PHP - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png\",\"datePublished\":\"2024-10-16T06:54:13+00:00\",\"dateModified\":\"2025-07-25T14:16:44+00:00\",\"description\":\"PHP Shopping cart with PayPal - Build shopping cart system with payment gateway in PHP. Example code to integrate PayPal in shopping cart checkout using PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png\",\"width\":1920,\"height\":1080,\"caption\":\"shopping-cart-with-paypal-payment-gateway-in-php-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/shopping-cart-with-paypal-payment-gateway-in-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shopping Cart with PayPal Payment Gateway in PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Shopping Cart with PayPal Payment Gateway in PHP - CodexWorld","description":"PHP Shopping cart with PayPal - Build shopping cart system with payment gateway in PHP. Example code to integrate PayPal in shopping cart checkout using PHP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/","og_locale":"en_US","og_type":"article","og_title":"Shopping Cart with PayPal Payment Gateway in PHP - CodexWorld","og_description":"PHP Shopping cart with PayPal - Build shopping cart system with payment gateway in PHP. Example code to integrate PayPal in shopping cart checkout using PHP.","og_url":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2024-10-16T06:54:13+00:00","article_modified_time":"2025-07-25T14:16:44+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2024\/10\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Shopping Cart with PayPal Payment Gateway in PHP","datePublished":"2024-10-16T06:54:13+00:00","dateModified":"2025-07-25T14:16:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/"},"wordCount":1225,"commentCount":0,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2024\/10\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png","keywords":["Cart","PayPal","PHP","Shopping"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/","url":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/","name":"Shopping Cart with PayPal Payment Gateway in PHP - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2024\/10\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png","datePublished":"2024-10-16T06:54:13+00:00","dateModified":"2025-07-25T14:16:44+00:00","description":"PHP Shopping cart with PayPal - Build shopping cart system with payment gateway in PHP. Example code to integrate PayPal in shopping cart checkout using PHP.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2024\/10\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2024\/10\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png","width":1920,"height":1080,"caption":"shopping-cart-with-paypal-payment-gateway-in-php-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/shopping-cart-with-paypal-payment-gateway-in-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Shopping Cart with PayPal Payment Gateway in PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2024\/10\/shopping-cart-with-paypal-payment-gateway-in-php-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-1uh","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=5721"}],"version-history":[{"count":4,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5721\/revisions"}],"predecessor-version":[{"id":5851,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/5721\/revisions\/5851"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/5724"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=5721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=5721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=5721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}