ELIOT Posted December 7, 2006 Share Posted December 7, 2006 (edited) AJAX Shopping Cart beta v1.0 This contribution allows customers to change product quantities and remove products without having to click the update button. Only the Shopping Cart area of the screen and the shopping cart infobox are refreshed. Instead of the normal 'You should update your browser' message if using a non-XMLHTTP Compliant Browser (e.g. IE, Mozilla) the normal shopping cart will show instead. Contribution: AJAX Shopping Cart Beta 1.0 does not include support for attributes that's coming soon. Installation should take about 5 mins. Any comments welcomed. Enjoy Eliot Edited December 7, 2006 by ELIOT Quote Link to comment Share on other sites More sharing options...
radders Posted December 7, 2006 Share Posted December 7, 2006 Sounds great! any idea if it will work alongside Easy Discount? Thanks David Quote Link to comment Share on other sites More sharing options...
ELIOT Posted December 7, 2006 Author Share Posted December 7, 2006 Sounds great! any idea if it will work alongside Easy Discount? Thanks David Hi David After taking a brief look at Easy Discount i should think it would. It will need some adjusting to fit it in like moving the Easy Discount code into getCart.php as well and adding it to the infobox using getCartBox.php Eliot Quote Link to comment Share on other sites More sharing options...
xdam Posted December 7, 2006 Share Posted December 7, 2006 (edited) Hi David After taking a brief look at Easy Discount i should think it would. It will need some adjusting to fit it in like moving the Easy Discount code into getCart.php as well and adding it to the infobox using getCartBox.php Eliot I've just installed it by transferring the files directly accross and nothing appears on the shopping_cart page. I get an HTML error. http://dev.classicsoundandvision.com/shopping_cart.php Any reason why? Thanks David Edited December 7, 2006 by xdam Quote Link to comment Share on other sites More sharing options...
ELIOT Posted December 7, 2006 Author Share Posted December 7, 2006 I've just installed it by transferring the files directly accross and nothing appears on the shopping_cart page. I get an HTML error. http://dev.classicsoundandvision.com/shopping_cart.php Any reason why? Thanks David I just tried it with Firefox and it works, i'll look into the IE error, but it'll be tomorrow now cheers Eliot Quote Link to comment Share on other sites More sharing options...
ELIOT Posted December 8, 2006 Author Share Posted December 8, 2006 AJAX Shopping Cart beta v1.1 released v1.1 beta --- General Bug fix release --- * Empty cart Javascript errors fixed - included <span_cart> even if cart empty * Cancelled <body onLoad=> if shopping cart empty * Fixed bug with charset in GetCart.php and GetCartBox.php (thanks to Vlad Savitsky) * Added support for Contrib Installer contrib (http://www.oscommerce.com/community/contributions,3286) (thanks to Vlad Savitsky) * install documentation updated inluding instructions for if you already have <BODY onLoad attribute Contribution: AJAX Shopping Cart Beta 1.1 still does not include support for attributes that's coming soon. Installation should take about 5 mins. Enjoy Eliot Quote Link to comment Share on other sites More sharing options...
ELIOT Posted December 8, 2006 Author Share Posted December 8, 2006 I've just installed it by transferring the files directly accross and nothing appears on the shopping_cart page. I get an HTML error. http://dev.classicsoundandvision.com/shopping_cart.php Any reason why? Thanks David Hi David I tested out the contrib with two <body onload> attributes (like your code has) and the shopping cart will not work. I've just uploaded beta v1.1 which explains what you'd need to do if you already have a body onload attribute (at the bottom of install.html) regards Eliot Quote Link to comment Share on other sites More sharing options...
Vlad Savitsky Posted December 8, 2006 Share Posted December 8, 2006 Hi! Here is an error in install.html: Find (now around line 65 on a fresh ms2) ?> </td> </tr> <!-- shopping_cart_eof //--> Should be (no "?>"): Find (now around line 65 on a fresh ms2) </td> </tr> <!-- shopping_cart_eof //--> Quote =============================== Never give up! Never give up! Never give up! Link to comment Share on other sites More sharing options...
Vlad Savitsky Posted December 8, 2006 Share Posted December 8, 2006 Hi This is great contrib! Eliot you are cool programmer! I have replaced this js-code: //fRet = confirm('Are you sure you want to remove this item from your shopping cart?'); with: fRet = confirm('<?php echo TABLE_HEADING_REMOVE;?>?'); And now I have a multilanguage alert message: "Remove?" I also change a design of remove checkbox: tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'], '','onChange="sendCartRemoveItem(\'' . $products[$i]['id'] . '\', \'getCart.php\',\'' . tep_session_name() . '=' . tep_session_id() . '\',\'span_cart\', \' <img src=images/loading.gif alt=loading> Please wait...\', \'rem_' . $products[$i]['id'] . '\', \'' . $products[$i]['id'] . '\');" id="rem_'.$products[$i]['id'].'"') replaced with: <a href=""onClick="sendCartRemoveItem(\'' . $products[$i]['id'] . '\', \'getCart.php\',\'' . tep_session_name() . '=' . tep_session_id() . '\',\'span_cart\', \' <img src=images/loading.gif alt=loading> Please wait...\', \'rem_' . $products[$i]['id'] . '\', \'' . $products[$i]['id'] . '\');" id="rem_'.$products[$i]['id'].'" >'.TABLE_HEADING_REMOVE.'</a> and bug reportl: 1. When items count became 1 and I press "-" he ask me to remove but not remove item. 2. When I have 1 item in cart and use remove checkbox (or link) he ask me and I answer "No" he cleans all from cart and load index.php (main page). 3. When I have some items in cart and press "Remove" checkbox he ask me but not remove. Why? Quote =============================== Never give up! Never give up! Never give up! Link to comment Share on other sites More sharing options...
Phocea Posted December 8, 2006 Share Posted December 8, 2006 Installes this on my test shop then removed it. Is it suppose to flicker so much and refresh such big area every time ? Quote Link to comment Share on other sites More sharing options...
Vlad Savitsky Posted December 11, 2006 Share Posted December 11, 2006 Installes this on my test shop then removed it.Is it suppose to flicker so much and refresh such big area every time ? Yes, you are right! Can be refreshed only changed data? I want also ask: How I can do auto request to server after 1 sec after user stops type quantity? Vlad Quote =============================== Never give up! Never give up! Never give up! Link to comment Share on other sites More sharing options...
ELIOT Posted December 11, 2006 Author Share Posted December 11, 2006 Hi Vlad I will be changing the code to only update the changed items as i would prefer not to update the larger shopping cart area, only the item that changes within the cart / infobox. Eliot Yes, you are right!Can be refreshed only changed data? I want also ask: How I can do auto request to server after 1 sec after user stops type quantity? Vlad Quote Link to comment Share on other sites More sharing options...
Jud Posted December 12, 2006 Share Posted December 12, 2006 (edited) I have created a nice little cross-browser ajax enabled shopping cart. You can see it in action at <a href="http://judson.biz/shopping_cart.php">Judson.biz</a>... This works with attributes, and allows removal, and updating of quantities. I removed the "update cart" button, but since this is unobtrusive javascript, if I were to add back the update cart button, the shopping cart would work as usual. Feel free to check out the code. -Jud Edited December 12, 2006 by Jud Quote Link to comment Share on other sites More sharing options...
Vlad Savitsky Posted December 12, 2006 Share Posted December 12, 2006 (edited) I have created a nice little cross-browser ajax enabled shopping cart. You can see it in action at <a href="http://judson.biz/shopping_cart.php">Judson.biz</a>... This works with attributes, and allows removal, and updating of quantities. I removed the "update cart" button, but since this is unobtrusive javascript, if I were to add back the update cart button, the shopping cart would work as usual. Feel free to check out the code. -Jud I have even (!) registered at your site... But I couldn't add nothing to cart in Opera. Splash scrfeen "Product Added!" is showing all time... So I can't add and can't see how it works. Edited December 12, 2006 by Vlad Savitsky Quote =============================== Never give up! Never give up! Never give up! Link to comment Share on other sites More sharing options...
Vlad Savitsky Posted December 12, 2006 Share Posted December 12, 2006 (edited) Hi, ELIOT! I have resolved all my problems. On clear osc all works fine so bugs that I posted was my own bugs. Sorry. Can you also do just one refreshment. When I inc or dec qty in cart cart content refreshes twice... Why? There is ajax cart at my site: http://www.smirna.org/shopping_cart.php Edited December 12, 2006 by Vlad Savitsky Quote =============================== Never give up! Never give up! Never give up! Link to comment Share on other sites More sharing options...
redrum Posted December 12, 2006 Share Posted December 12, 2006 I have created a nice little cross-browser ajax enabled shopping cart. You can see it in action at <a href="http://judson.biz/shopping_cart.php">Judson.biz</a>... This works with attributes, and allows removal, and updating of quantities. I removed the "update cart" button, but since this is unobtrusive javascript, if I were to add back the update cart button, the shopping cart would work as usual. Feel free to check out the code. -Jud Thats a really cool shopping cart you have there. Any plans to release some of the functions you have done? Nice work, Fredrik Quote Link to comment Share on other sites More sharing options...
boxtel Posted December 12, 2006 Share Posted December 12, 2006 Hi, ELIOT! I have resolved all my problems. On clear osc all works fine so bugs that I posted was my own bugs. Sorry. Can you also do just one refreshment. When I inc or dec qty in cart cart content refreshes twice... Why? There is ajax cart at my site: http://www.smirna.org/shopping_cart.php well, in FF it shows after some delay and then flickers twice and in IE7 nothing ever shows at all as it produces a runtime error, the same applies to the shopping cart box by the way. Quote Treasurer MFC Link to comment Share on other sites More sharing options...
Jud Posted December 12, 2006 Share Posted December 12, 2006 (edited) I have even (!) registered at your site...But I couldn't add nothing to cart in Opera. Splash scrfeen "Product Added!" is showing all time... So I can't add and can't see how it works. When I said cross-browser, I should have said "cross-browser that I care about" ;-) ... as it is, less than 1 percent of my customers use opera, in fact, it is only 12 per year. The big two (or 3 depending on how u look at it) are IE 6 and 7, and then the 12% share held by firefox, which all show no problems with using the ajax features on Judson.biz Edited December 12, 2006 by Jud Quote Link to comment Share on other sites More sharing options...
holyland Posted December 19, 2006 Share Posted December 19, 2006 Jud, can u tell me wt contribution(s) u used for all ur ajax functions?? the product images .. the shopping card? they are nice Quote Link to comment Share on other sites More sharing options...
Jud Posted December 19, 2006 Share Posted December 19, 2006 I didn't use a contribution, All of it is custom for my store. Its really not that hard though, you may want to look at the mootools javascript library, which is the library I used. Quote Link to comment Share on other sites More sharing options...
Pilly Posted January 20, 2007 Share Posted January 20, 2007 Hi, Can anyone point me in the right direction here. When I use the +- quantity buttons, it adds a second shopping cart on the left. I use the column controller contrib also if that help? Also when the qty =1 and i minus it it asks me if i want to remove it from cart, i say ok, but it stays.. Any ideas? Quote Link to comment Share on other sites More sharing options...
a.niedermann Posted February 17, 2007 Share Posted February 17, 2007 Hey there! First thanks for this cool contribution! Question: When removing an item with tick the remove box, the item will not be removed until clicking additional once at some empty space on the space... so is it possible to enable that the "remove" question will come directly after ticking the remove box....?? Thank you! Andreas Quote Link to comment Share on other sites More sharing options...
a.niedermann Posted February 17, 2007 Share Posted February 17, 2007 There is an additional bug here: When setting the quantity to 0 it asks "are you sure you want to remove the item" but after clicking OK the item will not be removed! Quote Link to comment Share on other sites More sharing options...
Guest Posted February 18, 2007 Share Posted February 18, 2007 There is an additional bug here: When setting the quantity to 0 it asks "are you sure you want to remove the item" but after clicking OK the item will not be removed! I have the same one. Next to that I have one more question. I am quite new to OsCommerce and PHP, but when checking for contributions, I felt like this to be a 'must have'. It gives a very professional image to the webshop. My question is: I am having three languages in my shop. How can I adjust the "Are you sure you want to remove this item from your shopping cart?" to show for the language that has been selected instead of the plain English one? Thanks! Quote Link to comment Share on other sites More sharing options...
Guest Posted February 18, 2007 Share Posted February 18, 2007 I have the same one. Next to that I have one more question. I am quite new to OsCommerce and PHP, but when checking for contributions, I felt like this to be a 'must have'. It gives a very professional image to the webshop. My question is: I am having three languages in my shop. How can I adjust the "Are you sure you want to remove this item from your shopping cart?" to show for the language that has been selected instead of the plain English one? Thanks! I have one more problem. When I add a product to the cart and when I click on "continue shopping" or just go to a product group, my shopping carts empties again. Which part of the code should I have a look at for this to solve? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.