[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
www.dhtmlgoodies.com • View topic - Fly-to-Basket crash and burn
Advertisement

Fly-to-Basket crash and burn

Moderators: Calcifer, slothy

Fly-to-Basket crash and burn

Postby toulouse » Wed May 02, 2007 9:04 pm

Hi, I'm looking for some help, tutelage, advise or a good slap or something.
I'll admit upfront my noobness at php Javascript and ergo Ajax, though it will probably be obvious, so that is most definitely the problem. I am studying web development on my own, and I don't really have anyone around that can point out my errors... anyway enough of that.

Right, I have brain block with this adaptation of the fly-to-basket script I'm trying to implement.

Here's my scenario:
I have a working mysql db containing menu items (table name is menu_items). The menu list is generated by loop querying the db to list the items description and price. That works fine and each entry has it’s own Add button with a unique $productId var that is simply the id var from the db table called menu_items. It's not pretty but that part works. Here’s the HTML that is generated for each item:

<div class="product_container">
<div id="slidingProduct1" class="sliding_product">Egg Salad<br />3.39
<img src="../images/plateicon.gif"><p>
<a href="#" onclick="addToBasket(1);return false"><img src="images/basket.gif"></a>
<p/><br/></div>

The problem I'm having is getting the item clicked on to fly up and populate in the shopping_cart_items table. Instead I’ve managed to get only the first item in the list to fly over with the nefarious “Not a Numberâ€
toulouse
 
Posts: 5
Joined: Wed May 02, 2007 4:56 pm

Postby toulouse » Thu May 03, 2007 3:34 pm

toulouse
 
Posts: 5
Joined: Wed May 02, 2007 4:56 pm

Postby toulouse » Thu May 03, 2007 10:35 pm

Right, so it's funny what a bit of sleep will do. I've managed to get it working with a session array so far, now just need the session array to pull it's values from the db. Beside that I've only had to modify the addProduct.php, remove just works as is!

I'm going on about this since it looks like a few people have read my dribble...
toulouse
 
Posts: 5
Joined: Wed May 02, 2007 4:56 pm


Return to General questions regarding AJAX scripts

Who is online

Users browsing this forum: No registered users and 19 guests

cron