Post by cau96176 » Sun Jul 16, 2017 7:42 am

Hi,

I have been messing around with a VQMOD that lays out my product options horizontally and trying to merge a click on the image and it pops out like lightbox did.

I don't need the option radio button so I have removed it but when I click on an image it opens like a plain hyperlink in the whole window.

The page is here http://www.sofaking.org.uk/warranty-5-y ... wPageArran
The code I have so far is

Code: Select all

<modification>
	<id>Image-Option-Horizontal</id>
	<version>1.0</version>
	<vqmver>2.1.5</vqmver>
	<author>pprmkr-modified by thbr02</author>
	
	<file name="catalog/controller/product/product.php">
		<operation>
			<search position="after"><![CDATA['image'                   => $this->model_tool_image->resize($option_value['image'], 100, 100),]]></search>
			<add><![CDATA['pimage'                   => $this->model_tool_image->resize($option_value['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),]]></add>
		</operation>
	</file>

	<file name="catalog/view/theme/*/template/product/product.tpl">
		<operation>
			<search position="replace" offset="21"><![CDATA[
				<?php if ($option['type'] == 'image') { ?>					
			]]></search>
			<add><![CDATA[
				        <?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">
             <tr>
               <?php $oi= 1; foreach ($option['option_value'] as $option_value) { if ( $oi > 8 ) { $oi=1; echo "</tr><tr>";} ?>
          
                <td width="100px"><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><a href="<?php echo $option_value['pimage']; ?>" title="<?php echo $option_value['name'] . '&nbsp;' . '&#8722;' . '&nbsp;' . $heading_title; ?>" class="colorbox"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></a>
				<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 $oi++; }?>
            
         </table>
        </div>
        <br />
        <?php } ?>

			]]>
			</add>
		</operation>		
		
		<operation>
			<search position="replace" offset="14"><![CDATA[
				<?php if ($option['type'] == 'radio') { ?>
			]]></search>
			<add><![CDATA[
				<?php if ($option['type'] == 'radio') { ?>
        <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">
             <tr>
               <?php $oi= 1; foreach ($option['option_value'] as $option_value) { if ( $oi > 3 ) { $oi=1; echo "</tr><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 width="30%"><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 $oi++; }?>
            </tr>
         </table>

			]]>
			</add>
		</operation>		
		
	</file>
</modification>


Any help would be great

New member

Posts

Joined
Sat Feb 01, 2014 11:51 pm
Who is online

Users browsing this forum: No registered users and 13 guests