winnjewett
Apr-07-2005, 02:24 AM
I have a little bit of news for those interested in changing the text of their shopping cart. I have developed a small bit of javascript that allows you to manipulate the text in any way you wish. Here is an example: http://photography.brilliantphoton.com/gallery/449917/1/18131235
javascript:
function changeCart(){
if (is_ie == true){
num1 = 1;
num2 = 3;
num3 = 5;
}
else{
num1 = 3;
num2 = 7;
num3 = 11;
}
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num1].childNodes[0].innerHTML='Order A Print';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num2].childNodes[0].innerHTML='Order A Few<br>Different Prints';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num3].childNodes[0].innerHTML='View Orders';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num1].style.textAlign='left';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num2].style.textAlign='left';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num3].style.textAlign='left';
}
*note: there shouldn't be a space between 'pare' and 'ntNode'. I'm not sure why it's displaying this way.
Body code:
<body onload="changeCart(); return true;">
Enjoy!
-w
javascript:
function changeCart(){
if (is_ie == true){
num1 = 1;
num2 = 3;
num3 = 5;
}
else{
num1 = 3;
num2 = 7;
num3 = 11;
}
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num1].childNodes[0].innerHTML='Order A Print';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num2].childNodes[0].innerHTML='Order A Few<br>Different Prints';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num3].childNodes[0].innerHTML='View Orders';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num1].style.textAlign='left';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num2].style.textAlign='left';
document.getElementById('cartadd').parentNode.pare ntNode.childNodes[num3].style.textAlign='left';
}
*note: there shouldn't be a space between 'pare' and 'ntNode'. I'm not sure why it's displaying this way.
Body code:
<body onload="changeCart(); return true;">
Enjoy!
-w