Post by KatGirl » Thu Apr 25, 2013 9:05 am

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.

User avatar
New member

Posts

Joined
Tue Sep 21, 2010 11:23 am

Post by labeshops » Thu Apr 25, 2013 7:45 pm

It does remove it on mine. Perhaps it is a template issue?

Check your template.tpl file.

Make sure

Code: Select all

<?php echo $text_option; ?>
is inside the option if statements

Code: Select all

       <?php if ($options) { ?>
. Sounds like it might be outside the if statement for some reason.

Running Opencart v3.0.3.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by KatGirl » Thu Apr 25, 2013 9:47 pm

I did check before I posted this help request. :-)
The template has the Option Title Name inside both

Code: Select all

<?php if ($options) { ?>
<?php foreach ($options as $option) { ?>
and yet it still shows up. Any suggestions?

User avatar
New member

Posts

Joined
Tue Sep 21, 2010 11:23 am

Post by KatGirl » Thu Apr 25, 2013 9:58 pm

Specially, here is the code in question:

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">
This line still shows even when there is no options to display:

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 } ?>
Image
Hope that helps.

User avatar
New member

Posts

Joined
Tue Sep 21, 2010 11:23 am

Post by gartheman » Wed Sep 10, 2014 3:11 am

hi, did you ever resolve this?

New member

Posts

Joined
Tue Feb 16, 2010 5:12 pm
Who is online

Users browsing this forum: No registered users and 67 guests