Jump to content
Stef's Super Nerd Coding Community
Sign in to follow this  
btravis08

Adding mysql functionality to Cart tutorial

Recommended Posts

I recently purchased the video tutorial and went through the xml portion without any issues. However, i have gone through the mysql revisions to the existing code many times with absolutely no success.

 

I have gone back through the videos and copied down exactly what was written. I even went so far as to create the exact same database in phpmyadmin.

 

These are the errors i receive. Its interesting too, because its looking for PASTA01 which was your example id from the xml. But I have completely crossed over to the sql side and don't have the value PASTA01 anywhere in my database. Whats going on?

 

Fatal error: Uncaught exception 'Exception' with message 'item not found: PASTA01' in /home/content/s/t/u/studentid/html/ppal/functions/functions.php:60 Stack trace: #0 /home/content/s/t/u/studentid/html/ppal/classes/ShoppingCart.php(32): get_item_cost('PASTA01') #1 /home/content/s/t/u/studentid/html/ppal/functions/templates.php(140): ShoppingCart->GetItemCost('PASTA01') #2 /home/content/s/t/u/studentid/html/ppal/functions/templates.php(93): render_shopping_cart_row(Object(ShoppingCart), 'PASTA01', 1) #3 /home/content/s/t/u/studentid/html/ppal/functions/templates.php(171): render_shopping_cart() #4 /home/content/s/t/u/studentid/html/ppal/html/addToCart.php(20): render_paypal_checkout() #5 {main} thrown in /home/content/s/t/u/studentid/html/ppal/functions/functions.php on line 60

Share this post


Link to post
Share on other sites

When exactly do you get this error? When you try to add something to the cart?

 

 

Yep, it would happen when adding items to the cart. I did manage to fix the issue, but I'm still unsure about why it was picking up info from the xml doc. In any case, it works now. Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×
×
  • Create New...