Guest unknwn Posted February 12, 2011 Share Posted February 12, 2011 SOLVED! I am trying to have a category view, where besides a "BUY" "MORE" button there is also quantity dropdown. I would allow max. of lets say 20 items to be added like that.. can anyone offer any advice on how to achieve it ? maybe there is a mod for that already ? thank you! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 12, 2011 Share Posted February 12, 2011 My advice: In the file /includes/content/viewcat.inc.php at around line 399, there begins a series of tests to only display the BUY button if your stock settings allow it. For step 1, for each test, just after: $view_cat->assign('BTN_BUY', $lang['viewCat']['buy']); you can add this line of code: $view_cat->assign('BTN_BUYALOT', "String of FORM-SELECT HTML code"); In the file /skins/YOUR_SKIN/styleTemplates/content/viewCat.tpl at around line 54, there is the 'buy_btn' block. So, for step 2, after the closing form tag, put the {BTN_BUYALOT} placeholder. The FORM-SELECT code might go something like (and watch out for quotes - use apostrophes instead): <form action='{CURRENT_URL}' style='text-align:center;' method='post' name='prod{PRODUCT_ID}'> <input type='hidden' name='add' value='{PRODUCT_ID}' /> <select name='quan'><option value=20>20</option></select> <input type="image" class='cart_icon' src='skins/{VAL_SKIN}/styleImages/icons/cart_plusplus.gif' alt='{BTN_BUY} bulk' title='{BTN_BUY} bulk' /> </form> Add as many option tags as you want. Finally, load the cart_put icon into a graphics editor and add a bunch of plus signs to it to indicate a bulk purchase. Save it as cart_plusplus.gif. You can do more here and do it right, but this is a quick hack. Quote Link to comment Share on other sites More sharing options...
Guest unknwn Posted February 12, 2011 Share Posted February 12, 2011 Ok, I see the code, but I am not sure what you meant by after each.. would it look like this then ? if ($config['outofstockPurchase']) { $view_cat->assign('BTN_BUY', $lang['viewCat']['buy']); $view_cat->assign('BTN_BUYALOT', "String of FORM-SELECT HTML code"); $view_cat->assign('PRODUCT_ID', $productResults[$i]['productId']); $view_cat->parse('view_cat.productTable.products.buy_btn'); } else if ($productResults[$i]['useStockLevel'] && $productResults[$i]['stock_level']>0) { $view_cat->assign('BTN_BUY', $lang['viewCat']['buy']); $view_cat->assign('BTN_BUYALOT', "String of FORM-SELECT HTML code"); $view_cat->assign('PRODUCT_ID', $productResults[$i]['productId']); $view_cat->parse('view_cat.productTable.products.buy_btn'); } else if (!$productResults[$i]['useStockLevel']) { $view_cat->assign('BTN_BUY', $lang['viewCat']['buy']); $view_cat->assign('BTN_BUYALOT', "String of FORM-SELECT HTML code"); $view_cat->assign('PRODUCT_ID', $productResults[$i]['productId']); $view_cat->parse('view_cat.productTable.products.buy_btn'); } is that it ? thank you for responding ! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 12, 2011 Share Posted February 12, 2011 Yup! To clarify, replace "String of FORM-SELECT HTML code" with actual HTML code as suggested in the follow-on code block. Quote Link to comment Share on other sites More sharing options...
Guest unknwn Posted February 12, 2011 Share Posted February 12, 2011 oh glory on the highest : this worked out perfectly. thank you! Someone should add this to list of awesome-free-mods :) 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.