Guest Posted August 1, 2007 Share Posted August 1, 2007 Hello guys I followed freshyseth's instructions, and when a buy button that belongs to a product which does not have options was clicked from the viewCat page, the browser was indeed redirected to the same category page. However, I need it to do the same for products which do have options. I hired someone to do some work on the store, and the product options are now displayed on viewCat. I'm trying to work out how to get the buy button to directly add the product, with chosen options, to the cart. Here's what I've done: Changed the viewCat.tpl buy_btn section from: <p><form action="{CURRENT_URL}" method="post" name="prod{PRODUCT_ID}"> <!-- BEGIN: buy_btn --> <input type="hidden" name="add" value="{PRODUCT_ID}" /> <div style="position: relative; text-align: right;">{LANG_QUAN} <input name="quan" type="text" value="1" size="2" class="textbox" style="text-align:center;" /> <a href="java script:submitDoc('prod{PRODUCT_ID}');" target="_self" class="txtButton">{BTN_BUY}</a></div> <!-- END: buy_btn --> </form></p> to: <p><form action="{CURRENT_URL}" method="post" name="addtobasket"> <!-- BEGIN: buy_btn --> <input type="hidden" name="add" value="{PRODUCT_ID}" /> <input type="hidden" name="location" value="act=viewCat&catId={CAT_ID}&page={PAGE_NUM}" /> <input type="text" name="quan" value="1" size="1" /> <a href="java script:submitDoc('addtobasket');" class="txtButton">{BTN_BUY}</a> <!-- END: buy_btn --> </form></p> This results in the following javascript error: findObj(formName).submit is not a function http://www.thegraphicedge.me.uk/js/jslibrary.js Line 41 If anyone can help me add what I need to the viewCat page to get the direct add to work I'd appreciate it. Thanks. Quote Link to comment Share on other sites More sharing options...
Guest bennyuk Posted August 2, 2007 Share Posted August 2, 2007 the <form> tag needs to cover the options as well, fix has been sent... Quote Link to comment Share on other sites More sharing options...
Guest nymyth Posted August 7, 2007 Share Posted August 7, 2007 markscarts - that worked out great mate....THANKS Quote Link to comment Share on other sites More sharing options...
Guest nymyth Posted October 17, 2007 Share Posted October 17, 2007 ended up using Convicts, it works better...... Quote Link to comment Share on other sites More sharing options...
Guest vivan Posted January 1, 2008 Share Posted January 1, 2008 Thanks convict works great! Quote Link to comment Share on other sites More sharing options...
Guest cornholio27 Posted January 12, 2008 Share Posted January 12, 2008 Have been trying Convict's code, which seems to work great by keeping the user on the cat page. However, If you go into the viewprod page then try and go back via the browser button you now get the message warning about the page containing 'POST' data. So, if you click OK to go back the product is added again to the cart. Any suggestions how to get round this? thanks in advance Quote Link to comment Share on other sites More sharing options...
Guest Posted January 13, 2008 Share Posted January 13, 2008 I've never noticed that before! As for a suggestion to get around it... sorry I wouldn't know where to begin :mellow: Quote Link to comment Share on other sites More sharing options...
Transistor Posted January 13, 2008 Share Posted January 13, 2008 MarksCarts mod suits me fine too. Thank you very much. One little thing missing. It jumps back to the first page in the category. Did anyone figure out how to get it to jump back to the same page. (i.e., If the customer clicks Buy on an item on page 4 of 5 it should jump back to that page and not the first page. The pages are zero indexed so page 4 will have page=3 in the URL.) The answer may be related to PAGINATION in viewCat.inc.php. Quote Link to comment Share on other sites More sharing options...
Guest alexjones Posted October 14, 2008 Share Posted October 14, 2008 If anyone can help me, I installed the mod but i get the session problem. The buy button works only sometimes. Can you tell me how can I fix this? Thank you, Alex Quote Link to comment Share on other sites More sharing options...
Guest safefast Posted August 14, 2009 Share Posted August 14, 2009 Convict, you're a genius! 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.