Hi all
I'm trying to find a solution to remove the Option Name if the product options = 0 of a particular option. By default, OC removes the options but not the Title itself, which doesn't make any sense.
For example:
I have checkboxes enabled for my product options. I created : 'Stock Options' for my option, and then created S, M, L, etc.... for my product options.
This works great, but when I have zero qty & zero product option qty for any given product, the product options (S, M, L, etc) are removed from the single product page but the actual Option Title Name is not.
I need to remove this. Can someone explain how I do this please?
Thanks in advance.
It does remove it on mine. Perhaps it is a template issue?
Check your template.tpl file.
Make sure is inside the option if statements . Sounds like it might be outside the if statement for some reason.
Check your template.tpl file.
Make sure
Code: Select all
<?php echo $text_option; ?>
Code: Select all
<?php if ($options) { ?>
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
I did check before I posted this help request. :-)
The template has the Option Title Name inside both
and yet it still shows up. Any suggestions?
The template has the Option Title Name inside both
Code: Select all
<?php if ($options) { ?>
<?php foreach ($options as $option) { ?>
Specially, here is the code in question:
This line still shows even when there is no options to display:
Hope that helps.
Code: Select all
<!-- .start options -->
<?php if ($options) { ?>
<div class="options">
<div class="contentset"><b style="display:none;"><?php echo $text_option; ?></b></div>
<?php foreach ($options as $option) { ?>
<!-- Checkbox -->
<?php if ($option['type'] == 'checkbox') { ?>
<div id="option-<?php echo $option['product_option_id']; ?>" class="control-group">
Code: Select all
<label class="control-label"><?php if ($option['required']) { ?><span class="required">*</span><?php } ?><b><?php echo $option['name']; ?>:</b></label>
Code: Select all
<?php foreach ($option['option_value'] as $option_value) { ?>
<div class="optionBox">
<label for="option-value-<?php echo $option_value['product_option_value_id']; ?>" class="checkbox">
<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']; ?> "/>
<?php echo $option_value['name']; ?>
<?php if ($option_value['price']) { ?>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)<?php } ?>
</label>
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
Hope that helps.
Who is online
Users browsing this forum: Bing [Bot] and 321 guests