You could try this
in /catalog/view/theme/default/template/product/product.tpl
find
and change to
Change the minimum in admin and the option values to the amounts you want
NOTE: this will show for every product.
hope that helps..
in /catalog/view/theme/default/template/product/product.tpl
find
Code: Select all
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
Code: Select all
<select name="quantity">
<option value="<?php echo $minimum; ?>"><?php echo $minimum; ?></option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
</select>
NOTE: this will show for every product.
hope that helps..
how about this then..
Code: Select all
<?php $min = '<?php echo $minimum; ?>'; ?>
<?php if ($min = 5) { ?>
<?php echo ?>
<select name="quantity">
<option value="<?php echo $minimum; ?>"><?php echo $minimum; ?></option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
</select>
<?php } elseif ($min = 12) { ?>
<?php echo ?>
<select name="quantity">
<option value="<?php echo $minimum; ?>"><?php echo $minimum; ?></option>
<option value="24">24</option>
<option value="36">36</option>
</select>
<?php } else { ?>
<?php echo ?>
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
<?php } ?>
thanks for the reply again.
tested the code. it has
Parse error: syntax error, unexpected ';' in line 103.
the earlier one works flawlessly.
hope you can help. thanks
tested the code. it has
Parse error: syntax error, unexpected ';' in line 103.
the earlier one works flawlessly.
hope you can help. thanks
Last edited by stewiek on Mon Nov 08, 2010 6:30 pm, edited 1 time in total.
help anyone?
i made a search and found this:
http://forum.opencart.com/viewtopic.php ... ity#p48602
but catalog/view/theme/YOURTHEME/template/product/product.tpl
doesn't have this code anymore
guess its for the older version.
i made a search and found this:
http://forum.opencart.com/viewtopic.php ... ity#p48602
but catalog/view/theme/YOURTHEME/template/product/product.tpl
doesn't have this code anymore
Code: Select all
<input type="text" name="quantity" size="3" value="1" />
sorry about that..
I will have a look at the code i posted.
you can put it back the way it was by replacing the code i posted with this
I will have a look at the code i posted.
you can put it back the way it was by replacing the code i posted with this
Code: Select all
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
Ok got it working..
in /catalog/view/theme/default/template/product/product.tpl
find
replace with
let me know how yoou get on..
in /catalog/view/theme/default/template/product/product.tpl
find
Code: Select all
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
Code: Select all
<?php
$min = $product_info['minimum'];
if ($min == 5) {
echo "<select name='quantity'>
<option value='5'>5</option>
<option value='10'>10</option>
<option value='15'>15</option>
<option value='20'>20</option>
</select>";
} elseif ($min == '12') {
echo "<select name='quantity'>
<option value='12'>12</option>
<option value='24'>24</option>
<option value='36'>36</option>
</select>";
} else {
echo "<input type='text' name='quantity' size='3' value='1' />";
}
?>
another problem.
found out that the customer can still change the value on checking out. i think its in
template/checkout/cart.php
Tried to look into the file, but the code is different from the earlier one. so don't think I can replace it.
any idea?
found out that the customer can still change the value on checking out. i think its in
template/checkout/cart.php
Tried to look into the file, but the code is different from the earlier one. so don't think I can replace it.
any idea?
this will stop them being able to change quantity in the cart..
in checkout/cart.tpl
find this.
change to this.
in checkout/cart.tpl
find this.
Code: Select all
<td align="right" valign="top"><input type="text" name="quantity[<?php echo $product['key']; ?>]" value="<?php echo $product['quantity']; ?>" size="3" /></td>
Code: Select all
<td align="right" valign="top"><input type="hidden" name="quantity[<?php echo $product['key']; ?>]" value="<?php echo $product['quantity']; ?>" size="3" /><?php echo $product['quantity']; ?></td>
i got a more clear way to do this :
u just have to edit $xmax to set how many times the price will be multiplyed
cheers !
u just have to edit $xmax to set how many times the price will be multiplyed
cheers !
Code: Select all
<select name="quantity">
<?php
$tempmin = $minimum;
$xmax = 20;
$x = 1;
echo '<option value="'.$minimum.'">'.$minimum.'</option>';
while($x <= $xmax){
$qstep = $minimum + $tempmin;
$x++;
echo '<option value="'.$qstep.'">'.$qstep.'</option>';
$tempmin = $minimum + $tempmin; }
?>
</select>
I had recently implemented this feature as an extension that you can download for free.
Download link: http://www.opencart.com/index.php?route ... on_id=1881
It does exactly what you want, with an added admin support for managing your quantity set values without any coding from your side.
More info: http://forum.opencart.com/viewtopic.php?f=119&t=30320
Download link: http://www.opencart.com/index.php?route ... on_id=1881
It does exactly what you want, with an added admin support for managing your quantity set values without any coding from your side.
More info: http://forum.opencart.com/viewtopic.php?f=119&t=30320
Developing Quality OpenCart Extensions since 2011.
View my extensions
@billyggla I like your solution for the dropdown. However, when I add it to my product.tpl page, I get this error:
Any idea how I can fix this?
Do I just need to delete the VQ Mode cache files?
Code: Select all
Undefined variable: product_info in /home/cygnetadmin/cygnetdisplays.com/vqmod/vqcache/vq2-catalog_view_theme_cygnet_template_product_product.tpl on line 265
Do I just need to delete the VQ Mode cache files?
I am using opencart 1.5.5.1
I want quantity dropdown in product page, cart page and in category page also. Can you please help me?
I want quantity dropdown in product page, cart page and in category page also. Can you please help me?
Who is online
Users browsing this forum: No registered users and 13 guests