Jump to content
Lizard Wizard Coding Club

mindapolis

Member
  • Content Count

    30
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mindapolis

  • Rank
    Member
  1. could you help me figure why it’s not displaying the shipping and total amount. The values are always 0. shoppingcart.php <?php class shoppingCart { protected $items = array(); public function addItem($product_id) { if (array_key_exists($product_id , $this->items)) $this->items[$product_id] = $this->items[$product_id] +1; else $this->items[$product_id] = 1; } public function GetItemCost($product_id) { $cost_string = get_item_cost($product_id); $cost_float = "$cost_string" + 0; return $cost_float * $this->GetItemQuantity($pr
  2. can I email you tomorrow with the answers to your questions
  3. Has anyone had this problem before? ? ? ? ?
  4. I hesitated posting this because most of my errors are stupid mistakes on my end. however, I'm doing the shopping cart video series and I'm stuck at the very end of video 8. I have watched it three or four times and for some reason the quantity isn't matching up with the price. here's the code: shoppingcart.php <?php class shoppingCart { protected $items = array(); public function addItem($product_id) { if (array_key_exists($product_id , $this->items)) $this->items[$product_id] = ($this->items[$product_id] +1); else $this->items[$product_id] = 1;
  5. mindapolis

    error

    You are a doll! Thank you so much! ! ! ! I'll do that right now. Expect an email from Mindy Thomas mindiapolis @ gmail.com
  6. mindapolis

    error

    if someone could PPPPPPPPPPLLLLLEEEEEEEEAAAAAAASSSEEEEEE help me, I would really appreciate it. I got rid of the error message and if you click a treat on treats,php it will redirect to the checkout.php and it displays the table header but not the chosen treat. treats.php <?php require_once("functions.php"); //session_name("treats"); session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org
  7. mindapolis

    error

    it's giving me another error. Fatal error: Call to a member function addItem() on a non-object in D:\Hosting\5246561\html\checkOut.php on line 19 <?php require_once('functions.php') ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $shopping_cart = get_shopping_c
  8. mindapolis

    error

    had a breakthrough, explain later:)
  9. mindapolis

    error

    When I put print_r($shopping_cart); exit; checkour.php comes up with a blank webpage with no errors. It should display the items chosen from treats.php. However, when I remove print_r($shopping_cart); exit; from checkOut.php I still get this. Fatal error: Call to a member function getItems() on a non-object in D:\Hosting\5246561\html\checkOut.php on line 36
  10. mindapolis

    error

    when I load cheekout.php I get shoppingCart Object ( [items:protected] => Array ( ) ) When I load treats.php it loads everything okay and when I hit "add to cart" it directs it to order.php. It directs it to this page whether or not <?php session_name("treats"); session_start(); ?> is on the page. Ultimately, yes, items from treats.php will go on order.php, but I was using checkout.php as a testing page to get the shopping cart set up. not understanding why treats.php isn't directing items to checkout.php order.php <?php session_name("treats"); session_start
  11. mindapolis

    error

    I did. Here's the code now. It should show the items picked from treats.php. I'm doing the shopping cart video series and I can't get past video 7 checkout page code <?php require_once('functions.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">'>http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> &
  12. mindapolis

    error

    Yes I did and I removed it. Now it says shoppingCart Object ( [items:protected] => Array ( ) )
  13. mindapolis

    error

    now it says Warning: Unexpected character in input: ''' (ASCII=39) state=1 in D:\Hosting\5246561\html\classes\shoppingCart.php on line 19 shoppingCart Object ( [items:protected] => Array ( ) )
  14. mindapolis

    error

    it displays this. shoppingCart Object ( [items:protected] => Array ( ) )
  15. mindapolis

    error

    It displays this now. Warning: array_keys() [function.array-keys]: The first argument should be an array in D:\Hosting\5246561\html\classes\shoppingCart.php on line 13 Warning: Invalid argument supplied for foreach() in D:\Hosting\5246561\html\checkOut.php on line 35 Produt ID quantity Amount Here's the code <?php require_once('functions.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Co
×
×
  • Create New...