Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit 34a287b

Browse files
authored
Merge pull request #95 from andrecristiani/improvements-43
General fixes in magento checkout
2 parents 00994a1 + a2acf5c commit 34a287b

File tree

10 files changed

+43
-9
lines changed

10 files changed

+43
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Changelog
22
---------
3+
3.16.6
4+
- Fix: Na listagem de bancos na tela de pagamento por débito online nas versões 1.7 e 1.8 do Magento
5+
- Fix: Na máscara de dinheiro nos campos parcelas e total na tela de pagamento
6+
37
3.16.4
48
- Fix: ajuste na regra css do botão "btn-pagseguro"
59
- Fix: ajuste na exibição dos meios de pagamento do checkout transparente

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Com o módulo instalado e configurado, você pode pode oferecer o PagSeguro como
3333
3434
- Certifique-se de que não há instalação de outros módulos para o PagSeguro em seu sistema;
3535
- Caso utilize a compilação do Magento, desative-a e limpe-a *(Sistema -> Ferramentas -> Compilação)*;
36-
- Baixe a última versão do módulo **[nesse link](https://github.com/pagseguro/magento/raw/master/UOL_PagSeguro-3.16.4.tgz)** ou então baixe o repositório como arquivo zip através do botão do GitHub;
36+
- Baixe a última versão do módulo **[nesse link](https://github.com/pagseguro/magento/raw/master/UOL_PagSeguro-3.16.6.tgz)** ou então baixe o repositório como arquivo zip através do botão do GitHub;
3737
- Na área administrativa do seu Magento, acesse o menu *Sistema/System -> Magento Connect -> Magento Connect Manager*. Caso tenha uma versão anterior do módulo instalada faça a remoção agora;
3838
- No Magento Connect Manger, dentro da seção Direct package file upload, clique em **Escolher arquivo/Choose file**, selecione o arquivo UOL_PagSeguro-x.x.x.tgz (baixado anteriormente), clique no botão de upload e acompanhe a instalação do módulo no console da página;
3939
- Caso utilize a compilação, volte para a área administrativa do Magento, ative-a e execute-a novamente;

UOL_PagSeguro-3.16.4.tgz

-525 KB
Binary file not shown.

UOL_PagSeguro-3.16.6.tgz

523 KB
Binary file not shown.

UOL_PagSeguro.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<description>Aceite mais de 25 meios de pagamentos com apenas 1 contrato. Seus clientes podem parcelar no cartão em até 18x e se preferir, você também pode oferecer parcelamento sem acréscimo.</description>
1010
<license>Apache Software License</license>
1111
<license_uri>http://opensource.org/licenses/apachepl.php</license_uri>
12-
<version>3.16.4</version>
12+
<version>3.16.6</version>
1313
<stability>stable</stability>
14-
<notes>- Fixes: button &quot;btn-pagseguro&quot; css rule
15-
- Fixes: payment methods list - direct payment</notes>
14+
<notes>- Fixes: In the list of banks on the online debit payment screen in versions 1.7 and 1.8 of Magento
15+
- Fixes: In the money mask in the fields installments and total on the payment screen</notes>
1616
<authors>
1717
<name>
1818
<name>pagseguro</name>

app/code/community/UOL/PagSeguro/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919
<config>
2020
<modules>
2121
<UOL_PagSeguro>
22-
<version>3.16.4</version>
22+
<version>3.16.6</version>
2323
</UOL_PagSeguro>
2424
</modules>
2525
<global>

app/design/frontend/base/default/template/uol/pagseguro/form/creditcard.phtml

100644100755
File mode changed.

app/design/frontend/base/default/template/uol/pagseguro/form/onlinedebit.phtml

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<div class="display-none validation-advice debitDocument-error-message">Insira um CPF ou CNPJ válido</div>
100100
</div>
101101
<div class="input-box">
102-
<label class="required" style="padding: 0.9em 0em 0em;"><?php echo $this->__('Selecione abaixo seu banco') ?></label>
102+
<label class="required" style="padding: 0.9em 0em 0em; width: 100%;"><?php echo $this->__('Selecione abaixo seu banco') ?></label>
103103
<div id="pagseguro-online-debit-options" style="padding: 0em 1em;"></div>
104104
</div>
105105
<div class="display-none validation-advice debitbankName-error-message">Escolha um banco</div>

skin/frontend/base/default/uol/pagseguro/css/direct-payment.css

100644100755
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,8 @@ span > input {
8686
text-align: right;
8787
padding-right: 4px;
8888
}
89+
90+
#pagseguro-online-debit-options {
91+
display: flex;
92+
flex-direction: column;
93+
}

skin/frontend/base/default/uol/pagseguro/js/credit-card.js

100644100755
Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ function cardInstallmentOnChange(data) {
6868
data = JSON.parse(data)
6969
document.getElementById('creditCardInstallment').value = data.quantity
7070
document.getElementById('creditCardInstallmentValue').value = data.installmentAmount
71-
document.getElementById('card_total').innerHTML = 'R$ ' + data.totalAmount
71+
document.getElementById('card_total').innerHTML = 'R$ ' + formatToReal(data.totalAmount)
7272
}
7373

7474
function cardInstallment(data) {
7575
var select = document.getElementById('card_installment_option')
7676
data = data[Object.getOwnPropertyNames(data)[0]]
7777
data.forEach(function (item) {
78-
select.options[select.options.length] = new Option(item.quantity + 'x de R$ ' + item.installmentAmount,
78+
select.options[select.options.length] = new Option(item.quantity + 'x de R$ ' + formatToReal(item.installmentAmount),
7979
JSON.stringify(item))
8080
})
8181
if (data) {
@@ -199,4 +199,29 @@ function removeLetters(el) {
199199
*/
200200
function removeNumbers(el) {
201201
return el.replace(/[0-9]/g, '');
202-
}
202+
}
203+
204+
/**
205+
* Returns the value of 'moneyValue' in the Brazilian real currency format
206+
* @param {double} amount
207+
* @returns {string}
208+
*/
209+
function formatToReal( amount ) {
210+
var tmp = amount + '';
211+
var index = tmp.indexOf('.');
212+
if(index == -1) {
213+
tmp = tmp + '00';
214+
}else {
215+
var afterDot = tmp.substring(index+1, tmp.length);
216+
if (afterDot.length < 2) {
217+
tmp = tmp + '0';
218+
}
219+
}
220+
tmp = tmp.replace('.', '');
221+
tmp = tmp.replace(/([0-9]{2})$/g, ",$1");
222+
if( tmp.length > 6 ) {
223+
tmp = tmp.replace(/([0-9]{3}),([0-9]{2}$)/g, ".$1,$2");
224+
}
225+
226+
return tmp;
227+
}

0 commit comments

Comments
 (0)