![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#1
IP: 114.238.4.13
|
|||
|
|||
|
his is for the 4.0 branch of X-Cart. What it does is add a linked icon (or text) next to the product option menu on the product detail page. Clicking that will open a pop-up window to display more information about that option, similar to the little question mark next to the CVV option on checkout. Tested in 4.0.18, not sure about older versions.
First, create a new folder in your files/ directory called options. Make it writable. Open up skin1/modules/Product_Options/customer_options.tpl and find this line of code: Code:
<SELECT id="po{$v.classid}" name="{$poname}"{if $disable} disabled{/if}{if $nojs ne 'Y'} onchange="javascript: check_options();"{/if}>
{foreach from=$v.options item=o}
<OPTION value="{$o.optionid}"{if $o.selected eq 'Y'} selected{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} ({if $o.modifier_type ne '%'}{include file="currency.tpl" value=$o.price_modifier display_sign=1}{else}{$o.price_modifier}%{/if}){/if}</OPTION>
{/foreach}
</SELECT>
Code:
{if $v.classtext eq 'Option Name'}
<a href="#" onClick="window.open('files/options/option-name.html','','scrollbars=no,resizable=no,width=300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>{/if}
- Option Name - this is the name of the option such as select color, select size, etc. as it appears on the product detail screen next to the option drop-down. It is case sensitive, so make sure you type it exactly as it appears. - option-name.html - replace this with the html file you want to include in the pop-up, or use an image (i.e. imagename.jpg). Be sure to upload the .html or .jpg file to the files/options directory you created - width= , height= - these the the width/height of the pop-up window. Adjust accordingly. - alt= - this is the text that will show up when the customer mouses over the question mark image (in Internet Explorer at least). - question.gif - this is the default x-cart question mark image. I always create my own to go with the style, so adjust this accordingly as well. The code above will add the image/link to the option specified only. To add it to additional options, use {elseif} statements like this: Code:
{if $v.classtext eq 'Option Name'}
<a href="#" onClick="window.open('files/options/option-name.html','','scrollbars=no,resizable=no,width=300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>
{elseif $v.classtext eq 'Option Name2'}
<a href="#" onClick="window.open('files/options/option-name2.html','','scrollbars=no,resizable=no,width=300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>
{/if}
If you want to link to a unique image/html page for each product, you can use this: Code:
{if $v.classtext eq 'Option Name'}
<a href="#" onClick="window.open('files/options/{$product.productid}.html','','scrollbars=no,resizable=no,width=300,height=400,menubar=no,toolbar=no');return false;" target="_blank"><img src="{$ImagesDir}/question.gif" border="0" style="vertical-align: middle;" alt="Click here for more info" /></a>{/if}
Make sense? Post here with any questions and I'll answer them. Enjoy! |
| Currently Active Users Viewing This Thread: 3 (0 members and 3 guests) | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Add PDF file to a Product | Gainesboro | X-Cart | 2 | 2015-12-02 06:40 PM |
| Determine X-Cart Product Sales Statistics | Xenia | X-Cart | 0 | 2015-03-31 12:32 AM |
| mysql 帮助文档使用 | Haddam | MySQL | 0 | 2014-11-26 06:43 PM |
| 国外买家喜欢看到什么样的购物网站? (转帖,全英文的) | topvip | 电子商务 | 0 | 2010-04-17 10:27 AM |
| 101 ways to get more traffic | sunshine | Google Adsense | 0 | 2007-05-09 08:29 PM |