Post by klavi » Wed Mar 28, 2012 1:21 pm

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
Last edited by klavi on Fri Mar 30, 2012 6:52 pm, edited 1 time in total.

Newbie

Posts

Joined
Mon Mar 19, 2012 4:06 am

Post by klavi » Fri Mar 30, 2012 6:51 pm

Here is some kind of solluition. Itstarts at row 123 using $_iterator

Code: Select all

<?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 border='0' class="option-image">
              <?php $_iterator=2; foreach ($option['option_value'] as $option_value) { ?>
	              <?php if(!$_iterator || (++$_iterator+1)%2 == 0) { ?>
	              <tr>
	              <?php } ?>
	                <td style="width: 1px;"><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']; ?>" /></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 if(($_iterator)%2 == 0) { ?>
	              
	              <?php } elseif($_iterator == count($option['option_value'])) { ?>
	            
	              
	              <?php }?>
              <?php } ?>
            </table>
        </div>
        <br />
        <?php } ?>
	             

if someone have an idea how to do it better (in more than 2 columns) please let me know :)

Newbie

Posts

Joined
Mon Mar 19, 2012 4:06 am

Post by DSGI » Fri Apr 06, 2012 8:19 am

I just broke the option images table up and made divs out of it and used CSS to style the Option Images accordingly. I also used the VQMOD to enlarge my image options to 200px by 200px. Below is the changes I made:

Code: Select all

<?php } ?>
       <?php if ($option['type'] == 'image') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <div class="option-title"><?php if ($option['required']) { ?>
          <!--<span class="required">*</span>-->
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br /></div>
            <div class="option-image">
              <?php foreach ($option['option_value'] as $option_value) { ?>
              <div class="option-image-item"><div class="option-image-name-price"><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></div><div class="option-image-image"><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></div><div class="option-image-radio"><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']; ?>" /></div>
                </div>
              <?php } ?>
            </div>
        </div>

New member

Posts

Joined
Wed Feb 08, 2012 5:28 pm

Post by shimapi » Wed May 02, 2012 6:50 am

Thank you very much for your reply! It was the solution for my need.

I don't know how to do the VQMOD but, I solve that by changing directly on the controller product file. I don't know if is ok, but it worked for me.
I Changed this
'image' => $this->model_tool_image->resize($option_value['image'], 50, 50),
to this:
'image' => $this->model_tool_image->resize($option_value['image'], 80, 80),
Thanks!! :D
DSGI wrote:I just broke the option images table up and made divs out of it and used CSS to style the Option Images accordingly. I also used the VQMOD to enlarge my image options to 200px by 200px. Below is the changes I made:

Code: Select all

<?php } ?>
       <?php if ($option['type'] == 'image') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <div class="option-title"><?php if ($option['required']) { ?>
          <!--<span class="required">*</span>-->
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br /></div>
            <div class="option-image">
              <?php foreach ($option['option_value'] as $option_value) { ?>
              <div class="option-image-item"><div class="option-image-name-price"><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></div><div class="option-image-image"><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></div><div class="option-image-radio"><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']; ?>" /></div>
                </div>
              <?php } ?>
            </div>
        </div>

Altorrelieve.cl


User avatar
Newbie

Posts

Joined
Wed Sep 08, 2010 10:45 am


Post by Elboy » Wed May 01, 2013 8:49 pm

You could just try

Code: Select all

.option-image tr {
    display: inline;
}

Newbie

Posts

Joined
Wed Nov 21, 2012 2:30 am

Post by gartheman » Sun Jun 16, 2013 1:44 am

Elboy wrote:You could just try

Code: Select all

.option-image tr {
    display: inline;
}
excellent, thanks for that. these forums need a thank button :)

New member

Posts

Joined
Tue Feb 16, 2010 5:12 pm

Post by gcextreme » Fri Jul 18, 2014 9:27 am

where do u insert that at?

New member

Posts

Joined
Mon Jul 14, 2014 6:31 am

Post by kjshier » Wed Jul 30, 2014 5:32 pm

You insert this anywhere in the stylesheet.css file.
It works a treat but they dont line up very well.
Much better than a two mile high page though. :laugh:

Newbie

Posts

Joined
Wed Jul 30, 2014 5:29 pm
Location - South Wales UK
Who is online

Users browsing this forum: No registered users and 6 guests