Wendy James Posted June 1, 2006 Posted June 1, 2006 Hi All, I am hoping a coder might read this. I have been working on changing the shopping cart infobox so that you can change qty or remove items from the box itself no matter what page you are on. Started doing it because someone asked for some help but now it is bugging me because I have one issue I can not solve. I would love to be able to figure it out so I could upload it as a contribution because I think some people could probably use this and I haven't seen anything like it in the contribution area. I have got the code to work (although someone might be able to clean it up) you can read that here http://www.oscommerce.com/forums/index.php?showtopic=212061&hl= Ok, the issue is that when you click the Update button, it updates but it takes you to the shopping cart page which really makes it useless although "cool" looking. I know it has to do with echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_DEFAULT, 'action=update_product')); but I can not for the life of me figure out a work around so whichever page you are on at the time just refreshes when you click submit. Anyone have any ideas or suggestions I could try? Everything I attempt breaks the code so it no longer updates at all. Thanks! Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Guest Posted June 1, 2006 Posted June 1, 2006 try using: echo tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), 'action=update_product'));
Wendy James Posted June 1, 2006 Author Posted June 1, 2006 Thanks for the suggestion, it sure looked like it would work and it does take you to somewhere other than the shopping cart, the index page, but not exactly what I was hoping for. Great start though! Gave me some ideas to try. : ) Quick update... Just did some more clicking around, trying that code on different pages and if I am on a product page and I take the product out of my cart I get a "product can not be found" message. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Guest Posted June 1, 2006 Posted June 1, 2006 try with this line of code for the form. I tried it here and works. Basically I preserve the get parameters (including the products_id that is needed). echo tep_draw_form('cart_quantity', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=update_product'));
Wendy James Posted June 2, 2006 Author Posted June 2, 2006 You absolutely rock! Thank you so much. Going to upload this as a contribution and will let everyone know you helped :) Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Wendy James Posted June 2, 2006 Author Posted June 2, 2006 Incase anyone wants the contribution I have uploaded it. Zip includes both versions, with and without qty box. http://www.oscommerce.com/community/contributions,4282 Thanks again Mark! Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.