This is in my product.tpl - I gave all products that are available in these quantities the model code "per 250 stuks" (per 250 pcs, but in Dutch).
Code: Select all
<?php if ($display_price) { ?>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="product">
<?php if ($options) { ?>
<b><?php echo $text_options; ?></b><br />
<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
<table style="width: 100%;">
<?php foreach ($options as $option) { ?>
<tr>
<td><?php echo $option['name']; ?>:
<select name="option[<?php echo $option['option_id']; ?>]">
<?php foreach ($option['option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
<?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
<?php } ?>
</option>
<?php } ?>
</select></td>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
<?php if ($display_price) { ?>
<?php if ($discounts) { ?>
<b><?php echo $text_discount; ?></b><br />
<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
<table style="width: 100%;">
<tr>
<td style="text-align: right;"><b><?php echo $text_order_quantity; ?></b></td>
<td style="text-align: right;"><b><?php echo $text_price_per_item; ?></b></td>
<td style="text-align: right;"><b><?php echo $text_pricetotaal; ?></b></td>
</tr>
<?php foreach ($discounts as $discount) { ?>
<tr>
<?php $prijsje = (int) preg_replace('/[^\d\.]/','', $discount['price']);
$totaaltjes = $discount['quantity'] * $prijsje;
if ($model == "per 250 stuks") {
$oplages = $discount['quantity'] * 250; } else {
$oplages = $discount['quantity'] * 50; }
$stuksprijzen = $totaaltjes / $oplages; ?>
<td style="text-align: right;"><?php echo $oplages; ?></td>
<td style="text-align: right;"><?php echo $stuksprijzen; ?> Eurocent</td>
<td style="text-align: right;"><b>€ <?php echo substr_replace($totaaltjes,',',-2,0); ?></b></td>
</tr>
<?php } ?>
</table>
</div>
<?php } ?>
<?php } ?>
<div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px;"><?php echo $text_qty; ?>
<?php if ($discounts) { ?>
<select name="quantity">
<?php if ($model == "per 250 stuks") {
$oplage = $minimum * 250; } else {
$oplage = $minimum * 50; }
?>
<option value="<?php echo $minimum; ?>"><?php echo $oplage; ?></option>
<?php foreach ($discounts as $discount) {
if ($model == "per 250 stuks") {
$oplages = $discount['quantity'] * 250; } else {
$oplages = $discount['quantity'] * 50; }
?>
<option value="<?php echo $discount['quantity']; ?>"><?php echo $oplages; ?></option>
<?php } ?>
</select>
<?php } else { ?>
<input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
<?php } ?>
<a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a></div>
<input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</form>
<?php } ?></td>
</tr>
</table>