Post by xtreme-styling » Wed Dec 28, 2011 11:36 pm

http://www.xykoo.com/Product.asp?id=424 ... =65&menu=1

if you see here there is a size guide when u click the s-m how can i do that for opencart? or a link to a page for it.

New member

Posts

Joined
Wed Dec 22, 2010 10:58 pm

Post by xtreme-styling » Thu Dec 29, 2011 7:44 pm

any one???

New member

Posts

Joined
Wed Dec 22, 2010 10:58 pm

Post by pprmkr » Thu Dec 29, 2011 11:39 pm

You can alter youre product.tpl and add the code to display the sizes-page.

Open catalog/view/theme/YOURE_THEME/template/product/product.tpl

Find:

Code: Select all

      <div class="options">
        <h2><?php echo $text_option; ?></h2>
        <br />
        <?php foreach ($options as $option) { ?>
        <?php if ($option['type'] == 'select') { ?>
        <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 />
          <select name="option[<?php echo $option['product_option_id']; ?>]">
            <option value=""><?php echo $text_select; ?></option>
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <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 } ?>
            </option>
            <?php } ?>
          </select>
After that add:

Code: Select all

            	
<?php if( $option['name'] == 'Size'){ ?>
<script language="javascript" type="text/javascript">
function sizewindow(page) {
	NewLeft = (screen.width - 630) / 2;
	NewTop = (screen.height - 470) / 2;
	window.open(page,"","status=no,scrollbars=yes,resizable=no,width=810,height=570,top="+ NewTop +",left=" + NewLeft);
}</script>
            	&nbsp;<a id="SizeGuide" href="javascript:sizewindow('pagesize.html', 'SizeGuide', 'status=no,scrollbars=yes,resizable=no,width=810,height=570')"><img src="image/size.jpg" width="60" height="18" border="0"></a>
<?php } ?>
Copy image size.jpg in the folder /image
Copy pagesize.html to the root

Note: Only if the option-name is Size the image with link is shown!

Attachments

Unpack, then copy image to image folder, html to root


User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by dave310 » Sun Apr 08, 2012 7:05 am

is it possible to make the "size guide" link be visible only during specific product option in OC 1.5???

New member

Posts

Joined
Fri Mar 23, 2012 5:47 pm

Post by Avvici » Sun Apr 08, 2012 8:05 am

Sure. Set up a conditional.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by dave310 » Sun Apr 08, 2012 6:58 pm

How???

New member

Posts

Joined
Fri Mar 23, 2012 5:47 pm

Post by Calcite » Sun Apr 08, 2012 7:16 pm

@ Pprmkr

Thanks for the info on the size chart button. It works for me in Safari but not in Firefox 11 (Mac Os x) where it does not show up at all on the page :(

I'm using a custom theme but there does not appear to any significant changes done in product.tpl

Any ideas why Firefox can't display it, or perhaps suggest a tweak to fix it?

I really like this and I think it is a real bonus for sales if the customer can immediately see a size chart without leaving the product page.

Hoping you can help.

Dank u Val :)

Active Member

Posts

Joined
Fri Dec 30, 2011 3:21 am

Post by dave310 » Sun Apr 22, 2012 3:11 am

avvici wrote:Sure. Set up a conditional.
Can you please guide?? thanks!

New member

Posts

Joined
Fri Mar 23, 2012 5:47 pm

Post by pprmkr » Sun Apr 29, 2012 5:46 pm

Calcite wrote:It works for me in Safari but not in Firefox 11 (Mac Os x) where it does not show up at all on the page :(
I do not know why Firefox 11 under Mac OS does not display the image and link.

See my screenshot Firefox11 ( Windows 7 ) where it works fine.
suizeguide.jpg

suizeguide.jpg (49.55 KiB) Viewed 1908 times


User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by Calcite » Sun Apr 29, 2012 7:13 pm

I didn't have any luck getting it to work on the custom theme, but it was fine on the default theme.

I gave up because I'm now using several different options.

Next shop I do will be a modified default template so I'll probably use your code - thanks.

Active Member

Posts

Joined
Fri Dec 30, 2011 3:21 am
Who is online

Users browsing this forum: No registered users and 279 guests