Page 1 of 2

Options to Image doens't work - V: 1.5.1.3

Posted: Sun Nov 06, 2011 12:03 am
by luizccm
Hello,
in Admin Area, Option, I creat 1 options. In option created, i creat one option and select image. I doing upload the imagem and save. In one Product, I select Options, search of option created, select and save. In front and, the image not show. Other options (Select, Radio, Checkbox) work fine, but image not show with option of product.
Thanks,
Luiz O0

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

Posted: Sun Dec 11, 2011 6:29 pm
by JVladaJ
Same problem here.
Do you already have a solution? If so, can you give me a advice please :)

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

Posted: Mon Dec 12, 2011 10:06 am
by Daniel
you need to select image and not option.

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

Posted: Thu Dec 15, 2011 8:50 am
by maurotto
Daniel wrote:you need to select image and not option.
sorry daniel
i've get same problem, but i dont understand, when i put an option in Catalog----> Options-----> Colors--- i write red for example and i select an image red. In front when i buy that items i'd get an option Colors with checkbox called red and an image red?

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

Posted: Thu Dec 15, 2011 9:34 am
by Qphoria
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.

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

Posted: Thu Dec 15, 2011 7:12 pm
by maurotto
perfect. thx a lot

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

Posted: Tue Dec 27, 2011 2:57 pm
by npublic
Hello,

I have tried to create the options with images but it doesn't work for me, not even using the configuration shown in the attached image. Can you advice?

Thanks

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

Posted: Tue Jan 31, 2012 6:58 pm
by vicky_vale_71
Hello,
I don't know what wenwenzi's going on about - that obviously went right over my head (-?)

- anyway - thanks Daniel and Qphoria for pointing out how to use this function - works a treat! - Loving Opencart more and more everyday ;D

Is there anyway of making the the option thumbnails a bit bigger or adding a pop up image when selected/hovered over?

I'm a newbie so would be happy to buy an extension to do this, But I am learning more and more about code so if the answer is in a coding change, would be most grateful if it were explained in an idiot proof way.

Lovin the whole Opencart community ;D ;D

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

Posted: Sun Feb 19, 2012 4:42 am
by steller007
Hey All I tried selecting the image option and then uploading images for that option, I then went to the product and added that option but I still don't see it on my product page. Does anybody know why?

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

Posted: Mon Feb 20, 2012 1:51 am
by Renato Frota
Did you put enough quantity for this option specific in the product options?

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

Posted: Mon Feb 20, 2012 9:13 am
by jakemccaig
I am having the same exact problem, I set up the option, added the images and applied the option to the product and is says available options but does not give any options to choose.

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

Posted: Mon Feb 20, 2012 3:27 pm
by Jaer007ll
Image
thank you very much.

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

Posted: Mon Feb 20, 2012 4:52 pm
by steller007
Hey renato,

I did but it is still not showing up. I then tried making this option to a file type to see if it would show up on the product page and it does but as an upload option, but when I change it to image and then go to the specific product and add that as an option it does not show up on the products page. I have made this option a required field so on the products page it doesn't let me add the products to the cart because I have not selected a color (image option), but the thing is that I can't because I don't see the field on products page.

Any help?

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

Posted: Mon Feb 20, 2012 9:32 pm
by Renato Frota
Are you using custom theme? The theme should have support for image options.

If it's not being shown in the default theme, then it's because you have not added enough quantity for this image option in the product data. I'm saying about that screen where you link this image option to the product itself, and you can select if each image will cost +/- than a product without the options. There are also a quantity field. If you select to monitor the stock, it should be set to 1+ to be shown in the product page.

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

Posted: Wed Feb 22, 2012 8:04 am
by Bg-foxx
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.

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

Posted: Wed Feb 22, 2012 8:49 am
by steller007
Thank you so much... This did the job.....SO GRATEFUL

Quick question though- Is there a way so make those images bigger?

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

Posted: Thu Feb 23, 2012 8:00 am
by steller007
Anyone?

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

Posted: Fri Feb 24, 2012 11:47 am
by elsewhere
steller007 wrote:Anyone?
image sizes for options are defined in /catalog/controller/product/product.php
look for around line 253

Code: Select all

foreach ($option['option_value'] as $option_value) {
						if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
							$option_value_data[] = array(
								'product_option_value_id' => $option_value['product_option_value_id'],
								'option_value_id'         => $option_value['option_value_id'],
								'name'                    => $option_value['name'],
								'image'                   => $this->model_tool_image->resize($option_value['image'], 50, 50),
								'price'                   => (float)$option_value['price'] ? $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) : false,
								'price_prefix'            => $option_value['price_prefix']
							);
						}
					}
just change the resize values from 50,50 to what ever you want.
i would suggest using a vqmod

as a side note i've actually just release a mod for this almost. instead of an additional image that changes with the selection, this allows for images in the dropdown itself.
Any options that are "select" based can have images associated via the standard admin interface. These will then be displayed as image dropdowns on the product pages that use these options.
Also allows for css styling of your drop-downs.

This will re-skin the dropdowns that dont use images as well
http://www.opencart.com/index.php?route ... on_id=5137

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

Posted: Fri Feb 24, 2012 3:53 pm
by Pauline135
ImageThank you so much...

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

Posted: Wed Mar 14, 2012 12:35 pm
by jetswebstudio
Bg-foxx, just wanted to say thank you for providing that fix. It worked like a charm. ;D