Page 1 of 1

Too much options like "Images"

Posted: Mon Jan 20, 2014 6:15 pm
by lodyha
Hello,

I dlike to ask: if I have under concrete product (like Skoda Octavia 1.4 TSI) options like: "Options / Catalog / Type As Image" (i have 20 images). How to format these images side by side and not beneath it(i hate one column of all images, its ugly)? Can I edit a product page to create a custom format or what can I do?

Re: Too much options like "Images"

Posted: Tue Jan 21, 2014 2:48 am
by clorne
This is just for options type "Image"
How to format these images side by side
There might be a way to do this with css but I just make a few changes to the catalog product template

In the file product.tpl find the line <?php if ($option['type'] == 'image') { ?> and under that there is a table.

After making a back up of this file ovewrite the table with

Code: Select all

<table class="option-image" style="display: inline">
              <tr>
              <?php $i = '0'; ?>    
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <?php $i++; ?>
              <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>
            <?php $tr = '</tr><tr>';
            if ($i % 3 == 0) echo $tr; ?> 
            <?php } ?>
                </tr>
          </table>
Within this code " if ($i % 3 == 0) " the 3 signifies how many images side-by-side, change the number accordingly.

Re: Too much options like "Images"

Posted: Wed Jan 22, 2014 2:54 am
by lodyha
clorne

Big thanks for you. Works fine!

Re: Too much options like "Images"

Posted: Thu Dec 18, 2014 11:24 am
by vixynn
i just tried this and its still vertical...wahhhhhhh

Re: Too much options like "Images"

Posted: Fri Jan 16, 2015 6:56 am
by kreativepics
Is there a way to do this on 2.0.1.1 ??