Jump to content

Item quantity dropdown on category page view


Guest unknwn

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...