Post by lodyha » Mon Jan 20, 2014 6:15 pm

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?

New member

Posts

Joined
Sat Jan 18, 2014 9:34 pm

Post by clorne » Tue Jan 21, 2014 2:48 am

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.

Active Member

Posts

Joined
Fri Dec 23, 2011 6:03 pm

Post by lodyha » Wed Jan 22, 2014 2:54 am

clorne

Big thanks for you. Works fine!

New member

Posts

Joined
Sat Jan 18, 2014 9:34 pm

Post by vixynn » Thu Dec 18, 2014 11:24 am

i just tried this and its still vertical...wahhhhhhh

New member

Posts

Joined
Tue Nov 18, 2014 8:59 am

Post by kreativepics » Fri Jan 16, 2015 6:56 am

Is there a way to do this on 2.0.1.1 ??

Newbie

Posts

Joined
Thu Jan 08, 2015 2:36 pm
Who is online

Users browsing this forum: No registered users and 98 guests