Using opencart_v1.5.1.1
while setting the product options, the options are displayed in a single column. can we set the options to appear in multiple columns. eg: if we have total 9 options, after displaying 1-3 options in 1st column, options 4-6 are displayed in 2nd column and 7-9 are displayed in 3rd column.
Thanks
i tried to display options in multiple columns. The following code is only for checkbox and do not apply to other options like radio.
here edit "$cols = 5;" to number of columns you want to have
catalog > view > theme > default > template > product > product.tpl
Find:
Replace with:
here edit "$cols = 5;" to number of columns you want to have
catalog > view > theme > default > template > product > product.tpl
Find:
Code: Select all
<?php if ($option['type'] == 'checkbox') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?php foreach ($option['option_value'] as $option_value) { ?>
<input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"> <?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
<br />
<?php } ?>
</div>
<br />
<?php } ?>
Code: Select all
<?php if ($option['type'] == 'checkbox') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
<?php if ($option['required']) { ?>
<span class="required">*</span>
<?php } ?>
<b><?php echo $option['name']; ?>:</b><br />
<?
$cols = 5;
$c = 1;
?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<?php foreach ($option['option_value'] as $option_value) { ?>
<td>
<input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"> <?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>
(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
<?php } ?>
</label>
</td>
<?
if ($c == $cols) {
echo "</tr><tr><td height='5'></td></tr><tr>";
$c = 1;
} else { $c++; }
?> <?php } ?>
</tr>
</table>
</div>
<br />
<?php } ?>
also M. ssjal,
will using this for checkboxes, affect other options listed as radio or text? Also: list of options with 2 checkbox and 10 radio and 2 text box - what happens on this Product Page?
Thank you,
k
will using this for checkboxes, affect other options listed as radio or text? Also: list of options with 2 checkbox and 10 radio and 2 text box - what happens on this Product Page?
Thank you,
k
my site is in Open Cart 2.3.0.2, i want make these options in Grid View, how can I?
Attachments
error.jpg (234.76 KiB) Viewed 4701 times
Who is online
Users browsing this forum: No registered users and 191 guests