Page 2 of 2

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Mon Mar 19, 2012 4:53 am
by klavi
Hello,
my problem was that i wanted to use image option as "checkbox" not as "radio". the sollution was easy :) but i wish to know is there any chance to make that choices as 2-3column table not in a single one.
Thanks in advance :)

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Mon May 28, 2012 12:14 am
by koritsaki
Hello, I have the same problem in my shop.
I need the options images to show when someones chooses the colour option.
I use the shoppica theme, and the previous solution makes an error... any help?

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Wed Nov 21, 2012 1:49 pm
by DefconRhall
It would seem like the logical thing would be if there is an image for an option regardless of type it should be used/displayed.

When I saw that image option type I figured it was a way for a customer to provide an image.

I would use that type, however I need customers to select multiple options as the product is a build your own kit kinda thing.

So I need check boxes that show the images beside them. I'm going through and looking at the default template (which we are using) and found the spot in Products.tpl and tried to add some code to display an image, but the template seems to behave like the code isn't even there.

I am using 1.5.4 however and not 1.5.1.3 like the title has here, but it's the closest topic that already exists.

Thanks,

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Wed Nov 21, 2012 2:40 pm
by DefconRhall
DefconRhall wrote:but the template seems to behave like the code isn't even there.
Made it into a vqmod and the code works, but this should still be included by default in my opinion. Makes no sense to have the option there, be pulling in the data, but just not displaying it.

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Fri Jan 25, 2013 5:19 am
by TimesArrow
Qphoria wrote:He means choose the "image" option type:
Image

The image field does also show for SELECT and RADIO option types, but this appears to be by mistake. The actual image only shows on the product page if you choose the "IMAGE" option type.
thank you! works fine for me!

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Wed Jan 30, 2013 5:59 pm
by OnNets
How do you modify the image's radio option into checkbox in product option?

Thank you

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Wed Nov 19, 2014 6:22 am
by as5era
Hi, i have qwestion about thesame Image Options. I ned to do shoes sizes as images and use it in options. Evberything goes nice eksept that radio cirkle before the shown image. Is there any posibility to remove that circle and use only images.

I came to a answer for my qwestion with this kinde of modifikation in product.tpl code

<input style="display:none;" type="radio" 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']; ?>" />

With "display:none;" i just removed that litle circle for selecting the right image, but now came other problem, i cant see what i have selected. Thta cirkle was for image selection.

Is there a way to remove that cirkle and highlight the selected image. I just wuont to see only images and have posibility to see witch of them is selected.

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Wed Aug 31, 2016 11:19 pm
by sureshopencart
i am new for opencart, i dont have coding knowledge , please share the exact location and line number

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Sun Oct 22, 2017 3:05 am
by pashasho
Bg-foxx wrote:
Wed Feb 22, 2012 8:04 am
If the images still don't show after going through the steps above, AND if you are using a custom template (not the default), you need to find this file: catalog/view/CUSTOM-TEMPLATE/template/product/product.tpl

Find this code around line 108:

Code: Select all

(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
            <?php } ?>
          </label>
          <br />
          <?php } ?>
        </div>
        <br />
Immediately after the <br /> insert this code:

Code: Select all

        <?php } ?>
        <?php if ($option['type'] == 'image') { ?>
        <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 />
            <table class="option-image">
              <?php foreach ($option['option_value'] as $option_value) { ?>
              <tr>
                <td style="width: 1px;"><input type="radio" 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']; ?>" /></td>
                <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
                <td><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>
              </tr>
              <?php } ?>
            </table>
        </div>
        <br />
This is the missing code that prevents your CUSTOM template from displaying the images/swatches. Hope that helps.
can I use this code with OC 2.3.0.2?

Re: Options to Image doens't work - V: 1.5.1.3

Posted: Mon Oct 23, 2017 7:39 pm
by ADD Creative
No, as the templates for version 2 are a bit different. Have you tried using the radio or checkbox options? As you can set images with these.