popopen child window with ordersBasket

idaryl

Avatar: idaryl

2006-09-26 15:10

Hello,
this question should get some bells ringing (treewood? - claps - pcoins?) - I managed to get QC seamlessly inside a site - it took the entire weekend and a couple of days of frustration, but yippee it works! no header file, just the entire content of the cart inside my own template and readjusted ALL the colors to match... Once I get ALL the components together, I'll make it availalable...

Now the client has thrown another curveball, they want a link that pops the ordersBasket ONLY! in a centered small window I figured I'd add a win.self.close() function instead of goback (got that part easy - see below - I've added parameters for those js junkies. My problem is getting the orders to display! I created a copy of the index.php, the page.tpl and the ordersBasket.tpl, renamed them and have been trying to load the copies of the orders into the page into the index - I think thats how it works. i got so far, but, then the display breaks down. Is there a way to display just the cart contents??? I can then possibly dump that into the child window.

the code below is from a page generated by the admin add category feature allowing html code to be embeded into the source.

href part; <strong><font color="ff0000"><a href="#" onclick="openCenterScroll('http://www.mystore.com/cart/index.php?p=ordersBasket', 'blank', '600', '300');">openCenter</a><br></font></strong>

<script>
openWin = function(url,name,width,height,xpos,ypos,chrome,scroll){
var x, y, w, h, moveX=0, moveY=0, features="";
chrome = chrome ? "yes" : "no";
scroll = scroll ? "yes" : "no";
features += "toolbar="+chrome+",location="+chrome+",status="+chrome+",menubar="+ch rome;
features += ",scrollbars="+scroll+",resizable="+scroll;
if(width) features += ",width="+width;
if(height) features += ",height="+height;
if(xpos && window.screen){
w = window.screen.availWidth;
width = parseInt(width);
switch(xpos){
case "left": x = 0; break;
case "center": x = (w-width)/2; break;
case "right": x = w-width; break;
default: x = xpos;
}
features += ",screenX="+x+",left="+x;
var moveX = x;
}
if(ypos && window.screen){
h = window.screen.availHeight;
height = parseInt(height);
switch(ypos){
case "top": y = 0; break;
case "middle": y = (h-height)/2; break;
case "bottom": y = h-height; break;
default: y = ypos;
}
features += ",screenY="+y+",top="+y;
var moveY = y;
}
openWinReference = window.open(url,name,features);
if(moveX || moveY){
// position the window for browsers that don't recognize screenX, screenY
openWinReference.moveTo(moveX,moveY);
}
}
openScroll = function(url,name,width,height){
openWin(url,name,width,height,false,false,false,"scroll");
}
openCenter = function(url,name,width,height){
openWin(url,name,width,height,"center","middle");
}
openCenterScroll = function(url,name,width,height){
openWin(url,name,width,height,"center","middle",false,"scroll");
}
openFull = function(url,name){
openWin(url,name,false,false,false,false,"chrome","scroll");
}
</script>

Wulfgen

idaryl

Avatar: idaryl

2006-09-27 19:26

Any ideas - anyone/

Wulfgen

Back to top
about us | contact