Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Add multiple products to cart

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 04-20-2004, 06:30 AM
  lyncca's Avatar 
lyncca lyncca is offline
 

X-Adept
  
Join Date: Nov 2003
Location: Fort Worth, Texas
Posts: 455
 

Default

HAPPY BIRTHDAY TO YOU! http://www.pixelitas.com/forum/images/smiles/beerchug.gif

Heh... I had to bring in one of the smilies from my forum
Reply With Quote
  #12  
Old 04-20-2004, 01:46 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Congrats FD. Nice code...
Reply With Quote
  #13  
Old 04-20-2004, 06:58 PM
 
jeeya jeeya is offline
 

X-Adept
  
Join Date: May 2003
Location: USA
Posts: 807
 

Default

I though birthday boy suppose get us a Cake

also anyone tried this Code? Like to see in action.
__________________
X-Cart Version 4.1.8
Hosted on Linux
Reply With Quote
  #14  
Old 04-21-2004, 06:45 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default

Thanks for the coding ... any one fancy a seek ... click on the link in my signature.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #15  
Old 04-21-2004, 06:50 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Carlisle Glass looks great. Super nice site. I love this multi-add to cart feature.

Reply With Quote
  #16  
Old 04-25-2004, 03:38 PM
 
rackit rackit is offline
 

Advanced Member
  
Join Date: Jan 2004
Posts: 31
 

Default

Great mod, funkydunk. With a little bit of modification, it fit a project I was working on perfectly. Thanks.
Reply With Quote
  #17  
Old 04-26-2004, 02:47 PM
 
grimscot grimscot is offline
 

Member
  
Join Date: Nov 2003
Location: Scotland
Posts: 22
 

Default popup thumbnail

Thanks funkydunk I was about to add this feature to a site I was working on, you saved me a bit of time.

I have taken your code and added a few other bits like adding a stripe to the list to make it easier to read in large product list and I have also added a bit of javascript to popup the thumbnail of the product if you put your mouse over the info image.

I am sure my code can be improved but I thought that I would post my mods here since Funkydunk was kind enough to share the original code.

This was the modification I made to the products.tpl template :- At the top I added the following javascript:

Code:
{* $Id: products.tpl,v 1.36 2003/11/11 14:02:37 svowl Exp $ amended by funkydunk 2004 *} {literal} <script> PositionX = 100; PositionY = 100; defaultWidth = 100; defaultHeight = 100; if (parseInt(navigator.appVersion.charAt(0))>=4){ var isNN=(navigator.appName=="Netscape")?1:0; var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;} function popupThumb(imageURL,imageTitle){ var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX; posy = e.clientY; if (isIE) { posx += document.body.scrollLeft+20; posy += document.body.scrollTop; } } var optIE='scrollbars=no,width=100,height=100,left='+posx+',top='+posy; var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+posx+',top='+posy; if (isNN){imgWin=window.open('about:blank','',optNN);} if (isIE){imgWin=window.open('about:blank','',optIE);} with (imgWin.document){ writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>'); writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){'); writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}'); writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);'); writeln('width=100-(document.body.clientWidth-document.images[0].width);'); writeln('height=100-(document.body.clientHeight-document.images[0].height);'); writeln('window.resizeTo(width,height);}');writeln('if (isNN){'); writeln('window.innerWidth=document.images["plant"].width;');writeln('window.innerHeight=document.images["plant"].height;}}'); writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>'); writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">'); writeln('[img]+imageURL+[/img]</body></html>'); close(); }} </script> {/literal}


To get the stripe add the code on line three of the following:

Code:
{section name=product loop=$products} {counter assign="row"} <tr {if $bg eq ""}{assign var="bg" value="1"} bgcolor="#FFFFFF"{else}{assign var="bg" value=""} bgcolor="#EEEEEE"{/if}>


Then to open the thumbnail image on mouse over change the line

Code:
<td valign="top" width="80" class="listrow" align="center"><a href=product.php?productid={$products[product].productid}>[img]{$ImagesDir}/info.gif[/img]</td>

As you might of noticed from the code above this works with the thumbnail images outside of the database and with the images named after the productcode. Unfortunately I haven't got the time just now to make this more generic as I have other modification I need to make for the site I am working on but hopefully this might come in useful for somebody.
Reply With Quote
  #18  
Old 05-02-2004, 06:41 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

hi,
i couldn't get this to work on 3.4.14, anyone else have any luck?

Also, instead of have them choose the quanities and clicking on submit, is it possible to include a checkbox and then have them click on submit?
Reply With Quote
  #19  
Old 05-04-2004, 02:21 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default

you could have a dropdown box which only has 0 and 1 in it ... so instead of clicking a checkbox, you should change the dropdown box from 0 to 1.
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #20  
Old 05-10-2004, 07:14 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

it looks like the major function behind this mod is:

Code:
if ($amount) { foreach ($amount as $key=>$value) { $productid = $key; $amount = $value;

What would I have have to sub in in order for it to be able to add multiple wishlist items?

Thanks
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020