![]() |
Add a pop-up information box to describe a product option
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}>Code:
{if $v.classtext eq 'Option Name'}- 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'}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'}Make sense? Post here with any questions and I'll answer them. Enjoy! |
It works great for me with 4.1.5
Not sure if this is the problem you are having but I have had that happen when I had the wrong option name. {if $v.classtext eq 'Option Name'} "Option name" needs to be what you use in the "Option Text" field in the product variant and NOT group name this may be your problem. Not an expert but hope that helps ya |
| All times are GMT +8. The time now is 11:00 AM. |
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.