X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   quick and dirty detail images (https://forum.x-cart.com/showthread.php?t=14255)

golfguy 05-30-2005 04:01 AM

quick and dirty detail images
 
I wanted to use the category functionality to list Б─°give awayБ─² stuff, but not have to force my customers to the product detail page and scroll down to see a larger image.

This a quick and dirty way of dealing with providing detail images on the category pages. I only have a few products I need this for, so if youБ─≥re implementing detail images for a whole mess of products there are better solutions out there.

The images used are on the file system (not in the SQL database)

You need four images, the Б─°click to enlargeБ─² button, Б─°click to closeБ─² button, Б─°click to closeБ─² backgroundБ─² and your detailed image. Upload to your images folder.
http://www.ecartstore.com/skin1/images/gpis/CLICKTOENLARGE.gif

http://www.ecartstore.com/skin1/images/gpis/CLICKTOCLOSE.gif

http://www.ecartstore.com/skin1/images/gpis/CLICKTOCLOSEbann.gif

Add the follow code between the <HEAD> and </HEAD> section in customer/home.tpl

Code:

{literal}
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
{/literal}


From the administration backend Add the following code to the Б─°Short DescriptionБ─² field of the product.
Code:

<div id="Layerpix1" style="position:absolute; border: 1px solid #666666;width:auto; height:auto; z-index:1000; background-image: url('skin1/images/CLICKTOCLOSEbann.gif'); visibility: hidden; overflow: hidden;">
[img]skin1/images/CLICKTOCLOSE.gif[/img]

  [img]skin1/images/templates/basicyello_500.gif[/img]
</div>



[img]skin1/images/CLICKTOENLARGE.gif[/img]

any text you want to show up in the short description


Admin screen should appear as follows;
http://www.ecartstore.com/skin1/images/gpis/exDesc.gif

This is what you should get;

Not clicked
http://www.ecartstore.com/skin1/images/gpis/exclickoff.gif
Clicked
http://www.ecartstore.com/skin1/images/gpis/exclickon.gif

NOTE: use the Б─°topБ─² and Б─°leftБ─² modifiers if you want the image to appear in a specific location on the screen.

The name of the Layers MUST be different for every occurance of a detail image e.g. Layerpix1, Layerpix2, etc.[/img]

balinor 06-01-2005 03:45 PM

Got a working url?

golfguy 06-02-2005 05:55 AM

Here you go product page

balinor 06-02-2005 06:01 AM

Nice :)

golfguy 06-02-2005 06:12 AM

Thanks! That means a lot coming from you :D

Bling 06-24-2005 10:20 AM

ummm...this looks pretty awsome! Does the script call the detailed image or does it enlarge the thumbnail or ??

I would really like it to call the detail in order to keep the clarity.

KUDOS...nice work essay!

golfguy 06-24-2005 11:38 AM

Thanks

All the images involved.(click to enlarge, click to close, and the detail image) are on the FS at skin1/images/ the detail image is in no way connected to the thumbnail.

That's why I said this is a quick and dirty popup the whole thing can be done in 5 minutes, but if you want to do this for thousands of images it would be a pain.

Bling 06-24-2005 11:52 AM

Could you create an extra field...add the script to the extra field and just copy it to all the prodcuts using excel and csv?

golfguy 06-24-2005 12:04 PM

I don't know. experiment let me know what you find :D


All times are GMT -8. The time now is 08:46 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.