From 06feca92760a516da317eba9bef991838546ec97 Mon Sep 17 00:00:00 2001 From: Ricardo Martins Date: Mon, 4 Apr 2016 23:07:36 -0300 Subject: [PATCH 1/3] Fix botao finalizar que nao habilita depois do cep (Fixes #197); Fix da busca de cep dos correios que nao funcionava mais, agora usando republica virtual (Fixes #200); --- .../Onestepcheckout/controllers/AjaxController.php | 13 ++++++++----- .../{onestep.phtml => onestep.phtml_} | 0 .../base/default/onestepcheckout/js/validation.js | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) rename app/design/frontend/rwd/default/template/onestepcheckout/{onestep.phtml => onestep.phtml_} (100%) diff --git a/app/code/community/Inovarti/Onestepcheckout/controllers/AjaxController.php b/app/code/community/Inovarti/Onestepcheckout/controllers/AjaxController.php index 4f466fb..5891501 100755 --- a/app/code/community/Inovarti/Onestepcheckout/controllers/AjaxController.php +++ b/app/code/community/Inovarti/Onestepcheckout/controllers/AjaxController.php @@ -749,14 +749,17 @@ public function busca_cepAction() { try { - $clientSoap = new SoapClient("https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl" ); - $result = $clientSoap->consultaCep($soapArgs); - $dados = $result->return; + $ch = curl_init("http://cep.republicavirtual.com.br/web_cep.php?cep={$cep}&formato=json"); + curl_setopt_array($ch, array( + CURLOPT_RETURNTRANSFER => 1 + )); + $ret = curl_exec($ch); - if (is_soap_fault($result)) { + if (curl_errno($ch)) { $return = "var resultadoCEP = { 'uf' : '', 'cidade' : '', 'bairro' : '', 'tipo_logradouro' : '', 'logradouro' : '', 'resultado' : '0', 'resultado_txt' : 'cep nao encontrado' }"; }else{ - $return = "var resultadoCEP = { 'uf' : '".$dados->uf."', 'cidade' : '".$dados->cidade."', 'bairro' : '".$dados->bairro."', 'tipo_logradouro' : '', 'logradouro' : '".$dados->end."', 'resultado' : '1', 'resultado_txt' : 'sucesso%20-%20cep%20completo' }"; +// $return = "var resultadoCEP = { 'uf' : '".$dados->uf."', 'cidade' : '".$dados->cidade."', 'bairro' : '".$dados->bairro."', 'tipo_logradouro' : '', 'logradouro' : '".$dados->end."', 'resultado' : '1', 'resultado_txt' : 'sucesso%20-%20cep%20completo' }"; + $return = "var resultadoCEP = $ret"; } } catch (SoapFault $e) { diff --git a/app/design/frontend/rwd/default/template/onestepcheckout/onestep.phtml b/app/design/frontend/rwd/default/template/onestepcheckout/onestep.phtml_ similarity index 100% rename from app/design/frontend/rwd/default/template/onestepcheckout/onestep.phtml rename to app/design/frontend/rwd/default/template/onestepcheckout/onestep.phtml_ diff --git a/skin/frontend/base/default/onestepcheckout/js/validation.js b/skin/frontend/base/default/onestepcheckout/js/validation.js index e0ecbc3..bf5aba6 100644 --- a/skin/frontend/base/default/onestepcheckout/js/validation.js +++ b/skin/frontend/base/default/onestepcheckout/js/validation.js @@ -157,6 +157,7 @@ function checkCPF(vCPF) { function buscaCep(quale) { var urlBase = window.location.href.slice(0, -6); + var BASE_URL = window.location.protocol + "//" + window.location.host + "/"; if (!quale){ var cep = jQuery('input[name*="postcode"]').val(); //baseurl - /index From 67b79d8923401081492f0b216045cf837d496e3d Mon Sep 17 00:00:00 2001 From: Ricardo Martins Date: Wed, 6 Apr 2016 18:50:01 -0300 Subject: [PATCH 2/3] Improvements on modman --- modman | 98 +++++----------------------------------------------------- 1 file changed, 8 insertions(+), 90 deletions(-) diff --git a/modman b/modman index dfc3db6..18ea20b 100644 --- a/modman +++ b/modman @@ -1,94 +1,12 @@ -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Authentification.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Authentification.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Address/Billing.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Address/Billing.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Address/Shipping.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Address/Shipping.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Address.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Address.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Paymentmethod.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Paymentmethod.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Cart.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Cart.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Comments/Simple.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Comments/Simple.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Comments.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Comments.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Coupon.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Coupon.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Newsletter/Simple.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Newsletter/Simple.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Newsletter.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Newsletter.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Terms.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Review/Terms.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Shippingmethod.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Form/Shippingmethod.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Helper/Timer.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Helper/Timer.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Title.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep/Title.php -app/code/community/Inovarti/Onestepcheckout/Block/Onestep.php app/code/community/Inovarti/Onestepcheckout/Block/Onestep.php -app/code/community/Inovarti/Onestepcheckout/Block/Widget/Dob.php app/code/community/Inovarti/Onestepcheckout/Block/Widget/Dob.php -app/code/community/Inovarti/Onestepcheckout/Block/Widget/Gender.php app/code/community/Inovarti/Onestepcheckout/Block/Widget/Gender.php -app/code/community/Inovarti/Onestepcheckout/Block/Widget/Ie.php app/code/community/Inovarti/Onestepcheckout/Block/Widget/Ie.php -app/code/community/Inovarti/Onestepcheckout/Block/Widget/Tipopessoa.php app/code/community/Inovarti/Onestepcheckout/Block/Widget/Tipopessoa.php -app/code/community/Inovarti/Onestepcheckout/controllers/AjaxController.php app/code/community/Inovarti/Onestepcheckout/controllers/AjaxController.php -app/code/community/Inovarti/Onestepcheckout/controllers/IndexController.php app/code/community/Inovarti/Onestepcheckout/controllers/IndexController.php -app/code/community/Inovarti/Onestepcheckout/etc/config.xml app/code/community/Inovarti/Onestepcheckout/etc/config.xml -app/code/community/Inovarti/Onestepcheckout/etc/system.xml app/code/community/Inovarti/Onestepcheckout/etc/system.xml -app/code/community/Inovarti/Onestepcheckout/Helper/Address.php app/code/community/Inovarti/Onestepcheckout/Helper/Address.php -app/code/community/Inovarti/Onestepcheckout/Helper/Config.php app/code/community/Inovarti/Onestepcheckout/Helper/Config.php -app/code/community/Inovarti/Onestepcheckout/Helper/Customer.php app/code/community/Inovarti/Onestepcheckout/Helper/Customer.php -app/code/community/Inovarti/Onestepcheckout/Helper/Data.php app/code/community/Inovarti/Onestepcheckout/Helper/Data.php -app/code/community/Inovarti/Onestepcheckout/Helper/Newsletter.php app/code/community/Inovarti/Onestepcheckout/Helper/Newsletter.php -app/code/community/Inovarti/Onestepcheckout/Helper/Payment.php app/code/community/Inovarti/Onestepcheckout/Helper/Payment.php -app/code/community/Inovarti/Onestepcheckout/Helper/Shipping.php app/code/community/Inovarti/Onestepcheckout/Helper/Shipping.php -app/code/community/Inovarti/Onestepcheckout/Model/Observer.php app/code/community/Inovarti/Onestepcheckout/Model/Observer.php -app/code/community/Inovarti/Onestepcheckout/Model/Source/Enableddisabled.php app/code/community/Inovarti/Onestepcheckout/Model/Source/Enableddisabled.php -app/code/community/Inovarti/Onestepcheckout/Model/Source/Payment/Methods.php app/code/community/Inovarti/Onestepcheckout/Model/Source/Payment/Methods.php -app/code/community/Inovarti/Onestepcheckout/Model/Source/Shipping/Methods.php app/code/community/Inovarti/Onestepcheckout/Model/Source/Shipping/Methods.php -app/code/community/Inovarti/Onestepcheckout/Model/Updater.php app/code/community/Inovarti/Onestepcheckout/Model/Updater.php -app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-install-2.0.0.php app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-install-2.0.0.php -app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.0-2.0.1.php app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.0-2.0.1.php -app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.1-2.0.2.php app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.1-2.0.2.php -app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.2-2.0.3.php app/code/community/Inovarti/Onestepcheckout/sql/onestepcheckout_setup/mysql4-upgrade-2.0.2-2.0.3.php +app/code/community/Inovarti/Onestepcheckout/* app/code/community/Inovarti/Onestepcheckout/ app/design/frontend/base/default/layout/onestepcheckout.xml app/design/frontend/base/default/layout/onestepcheckout.xml -app/design/frontend/base/default/template/onestepcheckout/customer/address/edit.phtml app/design/frontend/base/default/template/onestepcheckout/customer/address/edit.phtml -app/design/frontend/base/default/template/onestepcheckout/customer/form/edit.phtml app/design/frontend/base/default/template/onestepcheckout/customer/form/edit.phtml -app/design/frontend/base/default/template/onestepcheckout/customer/widget/dob.phtml app/design/frontend/base/default/template/onestepcheckout/customer/widget/dob.phtml -app/design/frontend/base/default/template/onestepcheckout/customer/widget/gender.phtml app/design/frontend/base/default/template/onestepcheckout/customer/widget/gender.phtml -app/design/frontend/base/default/template/onestepcheckout/customer/widget/ie.phtml app/design/frontend/base/default/template/onestepcheckout/customer/widget/ie.phtml -app/design/frontend/base/default/template/onestepcheckout/customer/widget/tipopessoa.phtml app/design/frontend/base/default/template/onestepcheckout/customer/widget/tipopessoa.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/authentification.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/authentification.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/address/billing.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/address/billing.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/address/shipping.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/address/shipping.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/address.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/address.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/payment/rewards.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/payment/rewards.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/payment_method.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/payment_method.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart/renderer/downloadable.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart/renderer/downloadable.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart/renderer/item.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart/renderer/item.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart/totals.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart/totals.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/cart.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/comments/simple.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/comments/simple.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/comments.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/comments.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/coupon.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/coupon.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/newsletter/simple.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/newsletter/simple.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/newsletter.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/newsletter.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/terms.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/review/terms.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/form/shipping_method.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/form/shipping_method.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/helper/timer.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/helper/timer.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep/title.phtml app/design/frontend/base/default/template/onestepcheckout/onestep/title.phtml -app/design/frontend/base/default/template/onestepcheckout/onestep.phtml app/design/frontend/base/default/template/onestepcheckout/onestep.phtml -app/design/frontend/base/default/template/onestepcheckout/persistent/customer/form/register.phtml app/design/frontend/base/default/template/onestepcheckout/persistent/customer/form/register.phtml -app/design/frontend/rwd/default/template/onestepcheckout/onestep/title.phtml app/design/frontend/rwd/default/template/onestepcheckout/onestep/title.phtml -app/design/frontend/rwd/default/template/onestepcheckout/onestep.phtml app/design/frontend/rwd/default/template/onestepcheckout/onestep.phtml -app/design/frontend/rwd/default/template/onestepcheckout/persistent/customer/form/register.phtml app/design/frontend/rwd/default/template/onestepcheckout/persistent/customer/form/register.phtml +app/design/frontend/base/default/template/onestepcheckout/* app/design/frontend/base/default/template/onestepcheckout/ +app/design/frontend/rwd/default/template/onestepcheckout/* app/design/frontend/rwd/default/template/onestepcheckout/ app/etc/modules/Inovarti_Onestepcheckout.xml app/etc/modules/Inovarti_Onestepcheckout.xml app/locale/en_US/Inovarti_Onestepcheckout.csv app/locale/en_US/Inovarti_Onestepcheckout.csv app/locale/pt_BR/Inovarti_Onestepcheckout.csv app/locale/pt_BR/Inovarti_Onestepcheckout.csv -README.md README.md -skin/frontend/base/default/onestepcheckout/css/onestepcheckout.css skin/frontend/base/default/onestepcheckout/css/onestepcheckout.css -skin/frontend/base/default/onestepcheckout/images/ajax-loader-16px.gif skin/frontend/base/default/onestepcheckout/images/ajax-loader-16px.gif -skin/frontend/base/default/onestepcheckout/images/ajax-loader-24px.gif skin/frontend/base/default/onestepcheckout/images/ajax-loader-24px.gif -skin/frontend/base/default/onestepcheckout/images/ajax-loader-48px.gif skin/frontend/base/default/onestepcheckout/images/ajax-loader-48px.gif -skin/frontend/base/default/onestepcheckout/images/ajax-loader.gif skin/frontend/base/default/onestepcheckout/images/ajax-loader.gif -skin/frontend/base/default/onestepcheckout/js/address.js skin/frontend/base/default/onestepcheckout/js/address.js -skin/frontend/base/default/onestepcheckout/js/form.js skin/frontend/base/default/onestepcheckout/js/form.js -skin/frontend/base/default/onestepcheckout/js/jquery.min.js skin/frontend/base/default/onestepcheckout/js/jquery.min.js -skin/frontend/base/default/onestepcheckout/js/login.js skin/frontend/base/default/onestepcheckout/js/login.js -skin/frontend/base/default/onestepcheckout/js/onestepcheckout.js skin/frontend/base/default/onestepcheckout/js/onestepcheckout.js -skin/frontend/base/default/onestepcheckout/js/payment.js skin/frontend/base/default/onestepcheckout/js/payment.js -skin/frontend/base/default/onestepcheckout/js/review.js skin/frontend/base/default/onestepcheckout/js/review.js -skin/frontend/base/default/onestepcheckout/js/shipment.js skin/frontend/base/default/onestepcheckout/js/shipment.js -skin/frontend/base/default/onestepcheckout/js/validation.js skin/frontend/base/default/onestepcheckout/js/validation.js -skin/frontend/rwd/default/onestepcheckout/css/onestepcheckout.css skin/frontend/rwd/default/onestepcheckout/css/onestepcheckout.css -skin/frontend/rwd/default/onestepcheckout/images/ajax-loader-16px.gif skin/frontend/rwd/default/onestepcheckout/images/ajax-loader-16px.gif -skin/frontend/rwd/default/onestepcheckout/images/ajax-loader-24px.gif skin/frontend/rwd/default/onestepcheckout/images/ajax-loader-24px.gif -skin/frontend/rwd/default/onestepcheckout/images/ajax-loader-48px.gif skin/frontend/rwd/default/onestepcheckout/images/ajax-loader-48px.gif -skin/frontend/rwd/default/onestepcheckout/images/ajax-loader.gif skin/frontend/rwd/default/onestepcheckout/images/ajax-loader.gif +skin/frontend/base/default/onestepcheckout/css/* skin/frontend/base/default/onestepcheckout/css/ +skin/frontend/base/default/onestepcheckout/images/* skin/frontend/base/default/onestepcheckout/images/ +skin/frontend/base/default/onestepcheckout/js/* skin/frontend/base/default/onestepcheckout/js/ +skin/frontend/rwd/default/onestepcheckout/css/* skin/frontend/rwd/default/onestepcheckout/css/ +skin/frontend/rwd/default/onestepcheckout/images/* skin/frontend/rwd/default/onestepcheckout/images/ \ No newline at end of file From aa5d82cd1e034ea65459e6403c93cf4924aa4fc0 Mon Sep 17 00:00:00 2001 From: Ricardo Martins Date: Mon, 8 Aug 2016 22:28:32 -0300 Subject: [PATCH 3/3] =?UTF-8?q?Fix=20botao=20comprar=20que=20n=20clica=20q?= =?UTF-8?q?uando=20=C3=A9=20creditcard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quando a forma de pagamento é cartao de credito ou possuia algum validate-card como validação, gerava uma exception pela inexistencia do ccard.js nativo e necessário pro validation.js funcionar no checkout. --- app/design/frontend/base/default/layout/onestepcheckout.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/design/frontend/base/default/layout/onestepcheckout.xml b/app/design/frontend/base/default/layout/onestepcheckout.xml index 94a07f0..3c5eb94 100755 --- a/app/design/frontend/base/default/layout/onestepcheckout.xml +++ b/app/design/frontend/base/default/layout/onestepcheckout.xml @@ -19,6 +19,7 @@ skin_jsonestepcheckout/js/review.js skin_jsonestepcheckout/js/form.js skin_cssonestepcheckout/css/onestepcheckout.css + @@ -150,4 +151,4 @@ - \ No newline at end of file +