Jump to content

Search the Community

Showing results for tags 'php checkout'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Okay here's the problem, I've got my code typed up and everything seems to be working. However this comes up: Notice: Undefined variable: storeID in \\Chapter 10\ReinforcementExercises\class_OnlineStores.php on line 101 first of all the variable has alread been defined in the class definition. Secondly, I'm having more items being added to the shopping cart when the checkout link is clicked. checkout function public function checkout() { $ProductsOrdered = 0; foreach($this->shoppingCart as $productID => $quantity) { if ($quantity > 0) { ++$ProductsOrdered; $SQLstring = "INSERT INTO orders " . " (orderID, prductID, quantity) " . " VALUES('" . session_id() ."', " . "'$productID', $quantity)"; $QueryResult = $this->DBConnect->query($SQLstring); } } echo "<p><strong>Your order has been " . "recorded.</strong></p>\n"; } and the getProductList function public function getProductList() { $retval = FALSE; $subtotal = 0; if (count($this->inventory) > 0) { echo "<table width='100%'>\n"; echo "<tr><th>Product</th><th>Description</th>" . "<th>Price Each</th><th># in Cart</th>" . "<th>Total Price</th><th> </th></tr>\n"; foreach ($this->inventory as $ID => $Info) { echo "<tr><td>" . htmlentities($Info['name']) . "</td>\n"; echo "<td>" . htmlentities($Info['description']) . "</td>\n"; printf("<td class='currency'>$%.2f</td>\n", $Info['price']); echo "<td class='currency'>" . $this->shoppingCart[$ID] . "</td>\n"; printf("<td class='currency'>$%.2f </td>\n", $Info['price'] * $this->shoppingCart[$ID]); echo "<td><a href='" . $_SERVER['SCRIPT_NAME'] . "?PHPSESSID=" . session_id() . "&ItemToAdd=$ID'>Add " . " Item</a><br />\n"; echo "<a href='" . $_SERVER['SCRIPT_NAME'] . "?PHPSESSID=" . session_id() . "&ItemToRemove=$ID'>Remove " . " Item</a></td>\n"; $subtotal += ($Info['price'] * $this->shoppingCart[$ID]); } echo "<tr><td colspan='4'>Subtotal</td>\n"; printf("<td class='currency'>$%.2f</td>\n", $subtotal); echo "<td><a href='" . $_SERVER['SCRIPT_NAME'] . "?PHPSESSID=" . session_id() . "&EmptyCart=TRUE'>Empty " . " Cart</a></td></tr>\n"; echo "</table>"; echo "<p><a href=' 'Checkout.php?PHPSESSID='" . session_id() . "&CheckOut=$storeID'>Checkout</a></p>\n"; - this is where the error is being indicated. $retval = TRUE; } return($retval); } I'd appreciate any help anyone can provide...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.