hec Posted April 26, 2007 Share Posted April 26, 2007 I got the builder2.php from a friend which should work with these (cpu, motherboard and PSU) dependence. Please someone look at the script and se how it's working!! <script language="JavaScript"> var tindex=0; var final_sum=0,sum=0,shipmentprice=0; var fields=27; var price = new Array(); var product = new Array(); var pid = new Array(); var recid = new Array(); var ammount = new Array(); var categ = new Array(); var prods_counter=0; var default_line="";//"<img src='/build/arrow.gif' align='absmiddle' width='17' height='17'>"; var fmTimer; var faded=true; var fadeObj; for (i=0;i<=fields;i++){ price[i] = 0; product[i] = "0"; pid[i] = ""; recid[i] = ""; ammount[i] = 0; categ[i]=""; } //--------------------- Print Field ---------------------------- function print_field(category,indx,row,picname,assemb_id){ categ[indx]=category; document.write ("<tr class=image_border1 onmouseover=\"this.style.backgroundColor='white';\" onmouseout=\"this.style.backgroundColor='';\" height=70>" +"<th onClick=\"oFrame.style.display='none'\" width=120 align=center ><img src='./build/img/"+picname+"'><br><span class=cart_dropdown1>"+category+"</span></th><th>" +"<table style='border-collapse: collapse' bordercolor='#628AC5' border=1>" +"<tr>" +"<th onclick='show_products(event,this,"+indx+","+row+","+assemb_id+")' style='cursor: hand;' width=100%>" +default_line+"</th>" +"<th id=\"productselect"+row+"\" onclick=\"show_products(event,this,"+indx+","+row+","+assemb_id+")\" style='cursor: hand;' >" +"<input type=\"hidden\" id='prod_dep"+row+"' value='0'>" +"<img src='./build/img/scroll.gif' width='20' height='15'></th>" +"<th onClick=\"oFrame.style.display='none'\" valign=middle><input type=\"button\" value=\"info\" style=\"border: #C4B0AB 0px solid; background-color: white; color: #5C5C5C; font-weight: normal\" onclick='show_desc("+indx+")'></th>" +"</tr></table>" +"</th>" +"<th align='right' onClick=\"oFrame.style.display='none'\" ></th>" +"<th align='center' onClick=\"oFrame.style.display='none'\" width=35>" +"<input type='hidden' name='products_id["+indx+"]' value='-1'>" +"<select name='qty["+indx+"]' onchange=\"calc_subtotal(mainform);calc_total(mainform);\" class=\"blaafelter\" size=\"1\" maxlength=\"10\" style=\"width:35px\">"); document.write ("<option value=1 selected>1</option>"); for (i=2;i<=10;i++) document.write ("<option value="+i+">"+i+"</option>"); document.write ("</select></th></tr>"); } //--------------------- Fader ---------------------------- function Fade(){ if (!faded) { faded=true; faderObj.innerHTML=default_line; window.clearTimeout(fmTimer); }else{ faded=false; fmTimer=window.setTimeout("Fade()",2000); } } //--------------------- Fade Row ---------------------------- function fade_row(row){ if (!faded){ faded=true; faderObj.innerHTML=default_line; window.clearTimeout(fmTimer); } var note=""; // switch (row){ // case 2: // if (!recid[1]) note=note1; // break; // case 3: // if (!recid[2]) note=note2; // break; // } if (note!="") { faderObj = document.getElementById("prod_table").rows[row].cells[1].childNodes[0].rows[0].cells[0]; faderObj.innerHTML=default_line+note; Fade(); return false; }else return true; } //--------------------- Show Products ---------------------------- function show_products(evt,e,pindex,row,assemb_id,dep_cat){ if (!dep_cat) dep_cat=0; if (pindex!=tindex){ document.getElementById("oFrame").style.display="none"; tindex=pindex; } if (!fade_row(pindex+1)) return; var dep_cat=document.getElementById("prod_dep"+row).value; sURL="prduct_list.php?dep_cat="+dep_cat+"&assemb_id="+assemb_id+"&row="+pindex+"¤cy="+currency+"&pindex="+pindex; for (i=0;i<recid.length;i++) { sURL+="&idp"+i+"="+recid[i]; } //var sURL="prduct_list.php?assemb_id="+assemb_id+"&row="+pindex+"¤cy="+currency+"&pindex="+pindex+"&dcpu="+recid[row]+"&dmem="+product[pindex]; if (document.getElementById("oFrame").innerHTML==""){ document.getElementById("oFrame").innerHTML="<iframe name='oiFrame' id='oiFrame' height='100%' width=100% border='0' frameborder='0'></iframe>"; } var buffer="<html><head><style>TD,TH,BODY{font-family:Arial,Tahoma,Helvetica,sans-serif;font-size:9pt;}TH{background-color:#86A5D2;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#0086A5D2',EndColorStr='#C0FFFFFF');font-style:italic;border:1px solid Black;cursor:default;}.select_table{BORDER-COLLAPSE:collapse;border:1px ridge;background-color:#F5F5F5;}tr{cursor:hand;}BODY{overflow: auto;margin: 0 0 0 0;background-color: #F5F5F5;}</style>"; buffer+="<table style='BORDER-COLLAPSE: collapse' borderColor='#86A5D2' border='1' width='100%'>"; switch (pindex){ // case 1: // add_product('-1','','','','2'); // sURL+="&select="+product[pindex]+"¤cy="+currency; // oiFrame.document.write(buffer+text_please_wait); // window.open(sURL,"oiFrame"); // break; // case 2: // oiFrame.document.write(buffer+text_please_wait); // window.open(sURL,"oiFrame"); // break; // case 0: // add_product('-1','','','','1'); // add_product('-1','','','','2'); default : sURL+="&select="+product[pindex]+"¤cy="+currency; oiFrame.document.write(buffer+text_please_wait); window.open(sURL,"oiFrame"); if (pindex){ buffer+="<tr onmouseover=\"this.style.backgroundColor='#86A5D2';\" onmouseout=\"this.style.backgroundColor='';\" onclick=\"parent.add_product('','','','"+pindex+"','"+pindex+"');\"><td align='center' colspan=2><b>"+text_deselect_items+"</b></td></tr>"; oiFrame.document.write(buffer+loadRow(pindex)+"</table>"); window.open(sURL,"oiFrame"); } break; } if (document.getElementById("oFrame").style.display=="none") { var categoryid=-1; var aTag; tab=e.parentNode; //TR aTag=tab; var leftpos=0; var toppos=0; do { aTag = aTag.offsetParent; leftpos += aTag.offsetLeft; toppos += aTag.offsetTop; } while(aTag.tagName!="BODY"); var PopupHeight=200; var TotTop=tab.offsetTop+tab.offsetHeight +toppos; document.getElementById("oFrame").style.left =tab.offsetLeft+leftpos-90; // if (evt.clientY+PopupHeight+10>document.body.clientHeight){ // TotTop-=PopupHeight+tab.offsetHeight; // } document.getElementById("oFrame").style.height=PopupHeight; document.getElementById("oFrame").style.top = TotTop; document.getElementById("oFrame").style.width = tab.cells[0].offsetWidth+tab.cells[1].offsetWidth+240; document.getElementById("oFrame").style.display="inline"; } else{ document.getElementById("oFrame").style.display="none"; } } //--------------------- Load Row ---------------------------- function loadRow(indx){ var j; var buffer=""; for (j=0;(l[indx][j]);j++) buffer+=print_line(indx,j); if (!buffer) buffer = ""; return buffer; } //--------------------- Print Line ---------------------------- function print_line(row,line){ var buffer=""; if (l[row][line][1]){ var pdesc2 = l[row][line][1].replace(/:inc:/gi, '"') re2 = new RegExp ('\'', 'gi'); l[row][line][1] = l[row][line][1].replace(re2, ":tag:") buffer+= "<tr onclick=\"parent.add_product('"+l[row][line][0]+"','"+l[row][line][1]+"','"+l[row][line][2]+"','"+l[row][line][3]+"',"+l[row][line][4]+");\" onmouseover=\"this.style.backgroundColor='#86A5D2';\" onmouseout=\"this.style.backgroundColor='';\">" +"<td>"+pdesc2+"</td><td align='right' width=70> "+l[row][line][2]+""+currency+"</td></tr>"; }else{ buffer+=print_title(l[row][line][0]); } return buffer; } //--------------------- Print Title ---------------------------- function print_title(title){ return "<tr><th align='center' colspan='2'>"+title+"</th></tr>"; } //--------------------- Calculate Subtotal ---------------------------- function calc_subtotal(form){ var sum=0 for (i=0;i<=fields;i++){ if (price[i]>0){ // sum=sum+parseFloat(price[i]*(form.elements["qty["+(i-1)+"]"].selectedIndex+1)); // sum=sum+parseFloat(price[i].replace(",",".")*(form.elements["qty["+(i-1)+"]"].selectedIndex+1)); sum=sum+parseFloat(price[i]*(form.elements["qty["+(i-1)+"]"].selectedIndex+1)); } } var lines=form.select1.length var softprice=0; for (i=1;i<lines;i++){ if (form.select1.options(i).selected){ softprice+=parseFloat(form.select1.options(i).price)*parseFloat(form.qty100.selectedIndex+1); } } form.sum.value=formatnumber(sum+softprice); } //--------------------- Calculate Sum ---------------------------- function calc_total(form){ // alert(form.ass.value); // if (form.ass.value==1) { sum=formatnumber(parseFloat(5.00)); } form.totsum.value=currency_left+" "+formatnumber(parseFloat(form.sum.value))+" "+currency_right; } function calc_total_tmp(form){ var sum=0; var final_sum; for (i=0;i<=fields;i++){ if (price[i]>0){ // sum=sum+parseFloat(price[i]*(form.elements["qty["+(i-1)+"]"].selectedIndex+1)); sum=sum+parseFloat(price[i]*(form.elements["qty["+(i-1)+"]"].selectedIndex+1)); } } var lines=form.select1.length var softprice=0; for (i=1;i<lines;i++){ if (form.select1.options(i).selected){ softprice+=parseFloat(form.select1.options(i).price)*parseFloat(form.qty[100].selectedIndex+1); } } sum=formatnumber(sum+softprice); final_sum=sum; form.sum.value=final_sum; form.totsum.value=currency_left+" "+final_sum+" "+currency_right; } //--------------------- Enabel/Disable Payments ----------------------------' function show_payments(form){ if (form.payment_mode.options(form.payment_mode.selectedIndex).value!="CASH"){ form.payments.disabled =false; form.each.disabled =false; }else{ form.payments.options(0).selected = true; form.payments.disabled =true; form.each.disabled = true; } } //--------------------- ValidateForm ---------------------------- function ValidateForm(form){ var err=""; if (!pid[1]) err+="Please select CPU\n"; if (!pid[2]) err+="Please select Mother Board\n"; if (!pid[3]) err+="Please select Memory\n"; if (form.firstname.value=="") err+="No first name was entered\n"; if (form.lastname.value=="") err+="No last name was entered\n"; if (form.city.value=="") err+="No city was entered\n"; if (form.address.value=="") err+="No address was entered\n"; if (form.tel.value=="") err+="No telephone was entered\n"; if (err!=""){ alert(err); return false; } return true; } //--------------------- Form check before submission ---------------------------- function mainform_onsubmit(form,sact,fields) { if (form.sum.value=="0"){ alert ("Der skal vælges mindst et produkt!"); return false; } for (i=0;i<=fields;i++){ ammount[i+1]=form.elements["qty["+i+"]"].selectedIndex+1; } var urltemp="compbuild.php?action=add_products&products_id="; var urltempammount="&product_ammount=" form.product.value=""; form.pid.value=""; form.price.value=""; form.ammount.value=""; form.recid.value=""; for (i=0;i<=fields;i++){ form.product.value+=product[i]+"::"; form.pid.value+=pid[i]+"::"; form.price.value+=price[i]+"::"; form.ammount.value+=ammount[i]+"::"; //alert( recid[i]); form.recid.value+=recid[i]+"::"; if (recid[i]){ urltemp+=recid[i]+","; urltempammount+=ammount[i]+","; } } var lines=form.select1.length for (i=1;i<lines;i++){ if (form.select1.options(i).selected){ form.product.value+=form.select1.options(i).value+";;"; form.price.value+=form.select1.options(i).price; form.pid.value+=form.select1.options(i).pid; form.recid.value+=form.select1.options(i).recid; form.ammount.value+=(form.qty[100].selectedIndex+1)+";;"; } } if (sact==2){ urltemp+=urltempammount; form.action=urltemp; form.target="_self"; form.submit(); }else if (sact==1){ form.action="print.php"; form.target="_blank"; form.submit(); } } //----------------- Show Description --------------- function show_desc(row){ row++; if (recid[row]) window.open ("product_info.php?products_id="+recid[row],'new', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,re sizable=yes,copyhistory=yes'); } </script> Hi, It works, but first line must be <<script language="JavaScript">. Dependence don't work. Quote Link to comment Share on other sites More sharing options...
hec Posted April 26, 2007 Share Posted April 26, 2007 And at the end of script this line :'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,re sizable=yes,copyhistory=yes'); must be : 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes, resizable=yes,copyhistory=yes'); Quote Link to comment Share on other sites More sharing options...
hec Posted April 26, 2007 Share Posted April 26, 2007 And at the end of script this line :'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,re sizable=yes,copyhistory=yes'); must be : 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes, resizable=yes,copyhistory=yes'); Quote Link to comment Share on other sites More sharing options...
shaytaan Posted April 26, 2007 Share Posted April 26, 2007 And at the end of script this line :'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,resizable=yes,copyhistory=yes'); must be : 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes, resizable=yes,copyhistory=yes'); I don't understand, it's all the same :blink: Quote ?,???`???,?? God must love stupid people, he made so many ??,???`???,? Link to comment Share on other sites More sharing options...
hec Posted April 27, 2007 Share Posted April 27, 2007 I don't understand, it's all the same :blink: I copy and paste your script from forum in a php editor and the result is : 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,re sizable=yes,copyhistory=yes'); Must be : 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes, resizable=yes,copyhistory=yes'); (resizable in one word and no re sizable) Sorry for my english. Quote Link to comment Share on other sites More sharing options...
shaytaan Posted April 27, 2007 Share Posted April 27, 2007 I copy and paste your script from forum in a php editor and the result is : 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,re sizable=yes,copyhistory=yes'); Must be : 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes, resizable=yes,copyhistory=yes'); (resizable in one word and no re sizable) Sorry for my english. he he.. sorry it shows like that because of the copy and paste on the forum Quote ?,???`???,?? God must love stupid people, he made so many ??,???`???,? Link to comment Share on other sites More sharing options...
Bulesz Posted May 1, 2007 Share Posted May 1, 2007 why cant make a usable readme file?? I did everything based on the included file, and not working!! :( couldnt find the skins or the images, which are placed in the build/img folder!! in the catalog side, dont show the rows, only an ugly nocss style empty box! in the new version i had to put manualy the missing column in the database! so the support is crap! :( but the contrip could be great! Quote Link to comment Share on other sites More sharing options...
Bulesz Posted May 1, 2007 Share Posted May 1, 2007 sorry for my anger, but I wasted lots of time, to try to make it alive, but due the lame readme (eg, why needed the "_english.php" file, insted of an istruction, of paste into..???? and BEWARE of overwrite the "included" /admin/includes/cloumn_left.php file! without any warning message??? ) its almost impossible for me. I have a fully customized shop, so I spent few month to get into the OSC core, that why its so depressed to me! the other thing, why use the 50k size png file in the box! ? pff... it should be 5k maximum! 10 times smaler! think a bit! :( Quote Link to comment Share on other sites More sharing options...
OverM@rk Posted May 5, 2007 Share Posted May 5, 2007 Hi, I've installed the latest version of ppc but I cannot get the assembly fees to work. I've created a product in root (50€). In PPC Admin I've giving a assembly fee (50€)... but notthing happens: the ASSEMBLY FEE field is empty. I don't know what I'm doing wrong... Help me please! Quote Link to comment Share on other sites More sharing options...
Guest Posted May 7, 2007 Share Posted May 7, 2007 Hi, I've installed the latest version of ppc but I cannot get the assembly fees to work. I've created a product in root (50€). In PPC Admin I've giving a assembly fee (50€)... but notthing happens: the ASSEMBLY FEE field is empty. I don't know what I'm doing wrong... Help me please! I too am having the exact same issue here. I have followed all the read me files and forum posts here - spent hours trying to get this to work. Still nothing! Please can someone post some very CLEAR instructions as to how this works, and if relevant the section of code that the assembly fee relies on (so we can check we have the correct version etc)? I downloaded the latest file only a couple of days ago though, so don't believe the code should be the issue? Can anyone even show the assembly fee working? Quote Link to comment Share on other sites More sharing options...
Guest Posted May 9, 2007 Share Posted May 9, 2007 I too am having the exact same issue here. I have followed all the read me files and forum posts here - spent hours trying to get this to work. Still nothing! Please can someone post some very CLEAR instructions as to how this works, and if relevant the section of code that the assembly fee relies on (so we can check we have the correct version etc)? I downloaded the latest file only a couple of days ago though, so don't believe the code should be the issue? Can anyone even show the assembly fee working? Can I assume no-one out there has this working yet, then? Quote Link to comment Share on other sites More sharing options...
Guest Posted May 9, 2007 Share Posted May 9, 2007 OK folks, So, now, as well as the previous issue with Assembly fee, I wonder if you can help me with this too: When the order email comes through, there is no indication that this is a request for a custom build - could just as easily be a user selecting individual components. How do I get the order email to include some form of indication that this used the PC Pro Creator? Thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted May 9, 2007 Share Posted May 9, 2007 And it's me again! OK - I finally got this working, but I don't know EXACTLY what the fault was. To get the assembly fee working, I have replaced the file prduct_list.php from version 2.3.4 with the same from version 2.3.3 and now it works! (remember you need to create the product(s) for the assembly fee as described by OverM@rk above). And of course, as the Assembly fee now adds a product to the cart, I now get an item for assembly, meaning my issue for the order notification email is also resolved - as long as your products are cleverly named you can use this to indicate it is a builder product as opposed to standard products added to the cart. Good luck for all those out there trying to make this work. It's not easy following the instructions given, but trust me when I say its worth persuing and once you understand how it works, you'll be wondering why you hadn't figured it out sooner ;-) Thanks Quote Link to comment Share on other sites More sharing options...
Bulesz Posted May 10, 2007 Share Posted May 10, 2007 Hi Cwitness! You are my man! :) I have the same problem, that you had, following the instructions, this contrib is not working...:( I had some sql problem ALSO...so do you have a working version? Could you send me this package? In "pm" I will send you my emailaddress. Thanks very much! Cheerz, B. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2007 Share Posted June 5, 2007 hello i have installed the module of PC creator but i didn't manage to find the builder2.js which is the template of the module! does this file exist in the download folder and if not could you send it to me? Quote Link to comment Share on other sites More sharing options...
Dopy99 Posted June 6, 2007 Share Posted June 6, 2007 for some reason that was renamed to builder2.php, its in catalog/build/ folder. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 for some reason that was renamed to builder2.php, its in catalog/build/ folder. i wonder it exists somewhere him I find in the Greek this module? thanks! Quote Link to comment Share on other sites More sharing options...
Guest Posted June 7, 2007 Share Posted June 7, 2007 hello i'm new in php i have installed the pc configurator but i can;t find how the amd-intel selection works!!... i have made the categories but when i select one intel cpu it allows me to select an amd motherboad!! Quote Link to comment Share on other sites More sharing options...
kunal247 Posted June 14, 2007 Share Posted June 14, 2007 Is there a working fix avilable now for Prices inc & excl VAT? Kunal :rolleyes: Any one working on this at all? Kunal Quote Link to comment Share on other sites More sharing options...
Guest Posted July 1, 2007 Share Posted July 1, 2007 Hi, Trying to get this contribution to work.... My current problems are: 1) when choosing products price does not show up under total price, it just shows $0 2) when trying to submit an order it says "you must have products in order" (possiably something to do with number 1) 3) in the admin panel i get "Template Does NOT Exist!" next to template, however it still gets showed! I used the above method of using the older prduct_list.php file to get the assembly fee to show up Can anyone help me? Greatly appreciated! Link is http://www.wstech.com.au/catalog/compbuild.php Thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted July 3, 2007 Share Posted July 3, 2007 Can anyone help me??? Quote Link to comment Share on other sites More sharing options...
programax Posted July 3, 2007 Share Posted July 3, 2007 How can I repair error 1065 in drop down list Quote Link to comment Share on other sites More sharing options...
Guest Posted July 16, 2007 Share Posted July 16, 2007 guessing no ones supporting the contribution anymore? Quote Link to comment Share on other sites More sharing options...
koala04 Posted August 9, 2007 Share Posted August 9, 2007 Hi,Trying to get this contribution to work.... My current problems are: 1) when choosing products price does not show up under total price, it just shows $0 2) when trying to submit an order it says "you must have products in order" (possiably something to do with number 1) 3) in the admin panel i get "Template Does NOT Exist!" next to template, however it still gets showed! I used the above method of using the older prduct_list.php file to get the assembly fee to show up Can anyone help me? Greatly appreciated! Link is http://www.wstech.com.au/catalog/compbuild.php Thanks i have the same problems.... anyone have any idea? Quote Link to comment Share on other sites More sharing options...
zero19 Posted August 10, 2007 Share Posted August 10, 2007 I have all the same error but the most important for me to be fixed is 1) when choosing products price does not show up under total price, it just shows $0 if anyone can give me a fix to that error i'll be more than happy :( Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.