PupMaster 0 Denunciar post Postado Maio 17, 2013 Boa tarde, sou novo aqui e estou precisando muito de ajuda. Eu achei um carrinho de compras e gostaria de usar ele pro carrinho de orçamento. Já ajeitei ele, mas não consigo enviar as informações do carrinho de compras para o e-mail, ele até envia por email mas pelo outlook, como muitas pessoas não usam acho que não é uma boa maneira para enviar, alguem poderia me ajudar a enviar as informações do carrinho junto com um formulhario, por favor... estou precisando muito disso, e tbm sou mt leigo no assunto. Link do Carrinho http://www.zomercontabilidade.com.br/cook index.html <html> <head> <title>Cookie Cart</title> <style> body {font: normal 13px Verdana;} a {color: #845725; text-decoration: none;} a:hover {color: #845725; text-decoration: none;} a img { border: none; } form br {clear: left;} form fieldset {border: none;} form legend {border: none; font: bold 15px Verdana; color: #000; } form label {font-weight: bold; margin: 3px 0px; display: block; color: #000; } select { color: #666; border: 1px solid #E7E5E5; padding: 2px; margin: 0px 0.5em 3px 3px; display: block; float: left;} .bt {font: bold 11px Verdana; padding: 5px; } .imgbt {border: none; width: 16px; height: 16px; display: inline; padding: 0; margin: 0;} .imgbt:hover {border: none;} .hidden {display: none;} #carrinho {position: fixed; display:block; top:10px; right:20px; width:130px; padding:10px; color: #171717; border: 1px solid #92ae30; background-color: #d9e7a8; font: normal 11px Verdana; z-index: 3;} * html div#carrinho {position: absolute; width:160px; top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop +((documentElement.clientHeight-this.clientHeight)/24) : document.body.scrollTop +((document.body.clientHeight-this.clientHeight)/24)); left:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollLeft + (document.body.clientWidth - 200 ) : document.body.scrollLeft + (document.body.offsetWidth - 200 )); } #carrinho h1 {font-size: 13px;} #carrinho h2 {font: bold 11px Verdana;} #carrinho .produto_container {width: 130px; clear: both;} #carrinho .carro_produto {float: left;} #carrinho .carro_produto img {width:60px; height:60px;} #carrinho .info {float: left; text-transform: lowercase; color: #222222;} #carrinho .info a {border-bottom: 1px solid #222222;} </style> <script type="text/javascript" src="cookiecart.js"></script> </head> <body> <form name="item1"> <fieldset> <legend>Caneta 1077</legend> <input type="hidden" value="Caneta 1077" name="nome" class="hidden" /><br /> <label for="quantidade">Quantidade</label> <input value="" name="quantidade"/> </select><br /> <label for="cores">Cores</label> <select name="cores"> <option selected="selected" value="Verde">Verde</option> <option value="Azul">Azul</option> <option value="Preto">Preto</option> <option value="Preto">Vermelho</option> <option value="Laranja">Laranja</option> </select><br /> <input type="submit" class="bt" onClick="adicionaProd(this.form.name)" value="Adicionar" /> </fieldset> </form> <strong><a href="http://zomercontabilidade.com.br/cook/carrinho.html" target="_self">Ver Carrinho</a></strong> </body> carrinho.html <html> <head> <title>Carrinho de Orçamento</title> <style> body {font: normal 13px Verdana;} a {color: #845725; text-decoration: none;} a:hover {color: #845725; text-decoration: none;} a img { border: none; } form br {clear: left;} form fieldset {border: none;} form legend {border: none; font: bold 15px Verdana; color: #000; } form label {font-weight: bold; margin: 3px 0px; display: block; color: #000; } select { color: #666; border: 1px solid #E7E5E5; padding: 2px; margin: 0px 0.5em 3px 3px; display: block; float: left;} .bt {font: bold 11px Verdana; padding: 5px; } .imgbt {border: none; width: 16px; height: 16px; display: inline; padding: 0; margin: 0;} .imgbt:hover {border: none;} .hidden {display: none;} #carrinho {display:block; top:10px; right:20px; width:130px; padding:10px; color: #171717; border: 1px solid #92ae30; background-color: #d9e7a8; font: normal 11px Verdana; z-index: 3;} * html div#carrinho {position: absolute; width:160px; top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop +((documentElement.clientHeight-this.clientHeight)/24) : document.body.scrollTop +((document.body.clientHeight-this.clientHeight)/24)); left:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollLeft + (document.body.clientWidth - 200 ) : document.body.scrollLeft + (document.body.offsetWidth - 200 )); } #carrinho h1 {font-size: 13px;} #carrinho h2 {font: bold 11px Verdana;} #carrinho .produto_container {width: 130px; clear: both;} #carrinho .carro_produto {float: left;} #carrinho .carro_produto img {width:60px; height:60px;} #carrinho .info {float: left; text-transform: lowercase; color: #222222;} #carrinho .info a {border-bottom: 1px solid #222222;} </style> <script type="text/javascript" src="cookiecart.js"></script> </head> <body> <div id="carrinho"> <h1>Seu Carrinho</h1> <script type="text/javascript">//<![CDATA[ var carrinho_array = verCarrinho(); if (carrinho_array != 0) { var cCont = "" var email = "" for (i=1; i < carrinho_array.length; i++){ var itemlink = carrinho_array.split(",") var item = new Array(itemlink.length); var itema = new Array(); for (x=0; x < itemlink.length; x++){ var key = campos[x]; itema[key] = itemlink[x].replace(/[**]+/g, ", "); } item = itema; var produto = item; /**************************************************************************************************************** / Edite a forma que os itens serão exibidos ****************************************************************************************************************/ cCont += "<h2>" + produto["nome"] + "</h2>"; cCont += "Quantidade:" + produto["quantidade"] + "<br />"; cCont += "Cores: " + produto["cores"] + "<br />"; /*************************************************************************************************************** / Edite o que será exibido no corpo do email enviado a você /***************************************************************************************************************/ email += produto["nome"] + "%0dCores: " + produto["cores"] + "%0dCor: " + produto["recheio"] + "%0d%0d"; } cCont += "<br><a href=\"index.htm\" onclick=\"javascript:limpaCarrinho('carrinho')\">Limpa carrinho</a><br />"; cCont += "<a href=\"http://zomercontabilidade.com.br/cook\">Adicionar +</a><br>"; cCont += "<a href=\"javascript:emailCar(email)\">Envia pedido</a>"; } else { cCont = "Carrinho vazio"; } document.write(cCont); //]]> </script> cookiecart.js /** * Cookie Cart * * * @package Cookie Cart * @author Elainne Barros (lanlanb) <http://cookiecart.blogspot.com/> * @version 1.0 * @copyright Copyright ©2008 Elainne Barros . Licença Creative Atribuição-Compartilhamento pela mesma Licença 3.0 Unported Commons * @example index.php **/ /************************************************************************************************************************ Configuração ***********************************************************************************************************************/ var campos = new Array("","nome","quantidade","cores"); // o primeiro campo deve ficar em branco. var destinatario = "higor_c@live.com"; // e-mail para o qual devem ir os pedidos /* * Funções de cookies (créditos: http://scripts.franciscocharrua.com/javascript_cookies.php) */ function setCookie(name, value) { //If name is the empty string, it places a ; at the beginning //of document.cookie, causing clearCookies() to malfunction. if(name != '') document.cookie = name + '=' + value; } function getCookie(name) { //Without this, it will return the first value //in document.cookie when name is the empty string. if(name == '') return(''); name_index = document.cookie.indexOf(name + '='); if(name_index == -1) return(''); cookie_value = document.cookie.substr(name_index + name.length + 1, document.cookie.length); //All cookie name-value pairs end with a semi-colon, except the last one. end_of_cookie = cookie_value.indexOf(';'); if(end_of_cookie != -1) cookie_value = cookie_value.substr(0, end_of_cookie); //Restores all the blank spaces. space = cookie_value.indexOf('+'); while(space != -1) { cookie_value = cookie_value.substr(0, space) + ' ' + cookie_value.substr(space + 1, cookie_value.length); space = cookie_value.indexOf('+'); } return(cookie_value); } function clearCookies() { Cookies = document.cookie; Cookie = Cookies; expires = new Date(); expires.setYear(expires.getYear() - 1); while(Cookie.length > 0) { //All cookie name-value pairs end with a semi-colon, except the last one. Cookie = Cookies.substr(0, Cookies.indexOf(';')); Cookies = Cookies.substr(Cookies.indexOf(';') + 1, Cookies.length); if(Cookie != '') document.cookie = Cookie + '; expires=' + expires; else document.cookie = Cookies + '; expires=' + expires; } } /* * Funções do carrinho */ function in_array(needle, haystack, strict) { // http://kevin.vanzonneveld.net // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: in_array('van', ['Kevin', 'van', 'Zonneveld']); // * returns 1: true var found = false, key, strict = !!strict; for (key in haystack) { if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) { found = true; break; } } return found; } /* Ajusta moeda (créditos: http://www.web-source.net/web_development/currency_formatting.htm) */ function moeda(amount) { var i = parseFloat(amount); if(isNaN(i)) { i = 0.00; } var minus = ''; if(i < 0) { minus = '-'; } i = Math.abs(i); i = parseInt((i + .005) * 100); i = i / 100; s = new String(i); if(s.indexOf('.') < 0) { s += '.00'; } if(s.indexOf('.') == (s.length - 2)) { s += '0'; } s = minus + s; s = s.replace(".", ","); return s; } /* Envia email com o conteúdo do carrinho */ function emailCar(conteudo) { window.open("car.php", "myWindow", "status = 1, height = 300, width = 300, resizable = 0" ) } /* Envia form em popup onsubmit="return createTarget(this.target)" target="formtarget" */ function createTarget(t){ window.open("www.zomercontabilidade.com.br/cook/car.php", "width=600,height=550"); return true; } /* Limpa carrinho de compras */ function limpaCarrinho(name) { expires = new Date(); expires.setYear(expires.getYear() - 1); document.cookie = name + '=null' + '; expires=' + expires; } /* Retira produto do carrinho */ function retiraProd(item) { var carrinho_cookie = getCookie('carrinho'); var carrinho_novo = carrinho_cookie.replace("|" + item, "") setCookie('carrinho',carrinho_novo); } function array_unique(ar){ var sorter = {}; for(var i=0,j=ar.length;i<j;i++){ sorter[ar] = ar; } ar = []; for(var i in sorter){ ar.push(i); } return ar; } /* Adiciona produto ao carrinho */ function adicionaProd(Form){ var cForm = document.forms[Form] var formArray = new Array(); var chkArray = new Array(); var selArray = new Array(); for(i=0; i<cForm.elements.length; i++){ var campo = cForm.elements.name; switch(cForm.elements.type) { // Indefinido ou Submit case 'undefined': case 'submit': break; // Select one //case 'select-one': // formArray = cForm.elements.selectedIndex.value; // break; // Select-Multiple case 'select-multiple': for (var x = 0; x < cForm.elements.options.length; x++) if (cForm.elements.options[x].selected) selArray.push(cForm.elements.options[x].value); var selposition = i; break; // Radio case 'radio': if(cForm.elements.checked == true) formArray.push(cForm.elements.value); break; // Checkbox case 'checkbox': if(cForm.elements.checked == true) chkArray.push(cForm.elements.value); var chkposition = i; break; // Padrão default: formArray.push(cForm.elements.value); break; } } // for if (chkArray != 0) { chkArray = chkArray.join("**") formArray.splice ( chkposition, 0, chkArray ); } if (selArray != 0) { selArray = selArray.join("**") formArray.splice ( selposition, 0, selArray ); } var carrinho_cookie = getCookie('carrinho'); novoItem = "|" + formArray; setCookie('carrinho',carrinho_cookie + novoItem); } // function /* Exibe carrinho */ function verCarrinho() { var carrinho_cookie = getCookie('carrinho'); if (carrinho_cookie != "") { return carrinho_cookie.split("|"); } else { return "" } } Ajudem por favor! Compartilhar este post Link para o post Compartilhar em outros sites
Rogério Santana 172 Denunciar post Postado Maio 17, 2013 Não duplique tópicos http://forum.imasters.com.br/topic/496326-carrinho-de-oramento/ Compartilhar este post Link para o post Compartilhar em outros sites
PupMaster 0 Denunciar post Postado Maio 17, 2013 Não duplique tópicos http://forum.imasters.com.br/topic/496326-carrinho-de-oramento/ Tópico não resolvido e abandonado! Compartilhar este post Link para o post Compartilhar em outros sites
Rogério Santana 172 Denunciar post Postado Maio 17, 2013 Leia isso como algo positivo. Escreve algo no post antigo, mesmo com o código modificado, cole-o lá, programadores e estudantes do mesmo tem boa memória, ficar criando tópicos com o mesmo conteúdo fará com que seus posts sejam ignorados. Se seu post ficou para trás quando você escreve algo nele, é um up automático para o topo. Como você se diz leigo, deve ter pego algo pronto, se esforce para estudar. A pressa não vai resolver o problema. ---- Chega todos os dados no outlook? Compartilhar este post Link para o post Compartilhar em outros sites
Williams Duarte 431 Denunciar post Postado Maio 17, 2013 Prezado @PupMaster, Se postar no fórum correto quem sabe as pessoas te ajuda, em seus scripts sequer tem uma linha em PHP No seu caso é melhor postar no fórum de javascript, quem sabe lá o pessoal possa lhe ajudar. Aqui é PHP :assobiando: Abraços! Compartilhar este post Link para o post Compartilhar em outros sites