Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adicionado valor total ao parcelamento com juros #75

Merged
merged 3 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** woocommerce, pagseguro, payment
**Requires at least:** 4.0
**Tested up to:** 4.7
**Stable tag:** 2.12.5
**Stable tag:** 2.12.6
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -267,6 +267,10 @@ Por favor, caso você tenha algum problema com o funcionamento do plugin, [abra

## Changelog ##

### 2.12.6 - 2018/05/09 ###

* Adicionado valor total ao parcelamento no checkout transparente para tornar mais prático para o cliente a visualização do juros.

### 2.12.5 - 2017/05/11 ###

* Corrigido valor total das parcelas do cartão de crédito no checkout transparente, o valor tinha parado de ser atualizado no WooCommerce 3.0.
Expand Down Expand Up @@ -325,6 +329,6 @@ Por favor, caso você tenha algum problema com o funcionamento do plugin, [abra

## Upgrade Notice ##

### 2.12.5 ###
### 2.12.6 ###

* Corrigido valor total das parcelas do cartão de crédito no checkout transparente, o valor tinha parado de ser atualizado no WooCommerce 3.0.
* Adicionado valor total ao parcelamento no checkout transparente para tornar mais prático para o cliente a visualização do juros.
13 changes: 8 additions & 5 deletions assets/js/frontend/transparent-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
*
* @return {string}
*/
function pagSeguroGetPriceText( price ) {
return 'R$ ' + parseFloat( price, 10 ).toFixed( 2 ).replace( '.', ',' ).toString();
function pagSeguroGetPriceText( installment ) {
var installmentParsed = 'R$ ' + parseFloat( installment.installmentAmount, 10 ).toFixed( 2 ).replace( '.', ',' ).toString();
var totalParsed = 'R$ ' + parseFloat( installment.totalAmount, 10 ).toFixed( 2 ).replace( '.', ',' ).toString();
var interestFree = ( true === installment.interestFree ) ? ' ' + wc_pagseguro_params.interest_free : '';
var interestText = interestFree ? interestFree : ' (' + totalParsed + ')';

return installment.quantity + 'x ' + installmentParsed + interestText;
}

/**
Expand All @@ -34,9 +39,7 @@
* @return {string}
*/
function pagSeguroGetInstallmentOption( installment ) {
var interestFree = ( true === installment.interestFree ) ? ' ' + wc_pagseguro_params.interest_free : '';

return '<option value="' + installment.quantity + '" data-installment-value="' + installment.installmentAmount + '">' + installment.quantity + 'x ' + pagSeguroGetPriceText( installment.installmentAmount ) + interestFree + '</option>';
return '<option value="' + installment.quantity + '" data-installment-value="' + installment.installmentAmount + '">' + pagSeguroGetPriceText( installment ) + '</option>';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion assets/js/frontend/transparent-checkout.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://claudiosanches.com/doacoes/
Tags: woocommerce, pagseguro, payment
Requires at least: 4.0
Tested up to: 4.7
Stable tag: 2.12.5
Stable tag: 2.12.6
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -255,6 +255,10 @@ Por favor, caso você tenha algum problema com o funcionamento do plugin, [abra

== Changelog ==

= 2.12.6 - 2018/05/09 =

* Adicionado valor total ao parcelamento no checkout transparente para tornar mais prático para o cliente a visualização do juros.

= 2.12.5 - 2017/05/11 =

* Corrigido valor total das parcelas do cartão de crédito no checkout transparente, o valor tinha parado de ser atualizado no WooCommerce 3.0.
Expand Down Expand Up @@ -313,6 +317,6 @@ Por favor, caso você tenha algum problema com o funcionamento do plugin, [abra

== Upgrade Notice ==

= 2.12.5 =
= 2.12.6 =

* Corrigido valor total das parcelas do cartão de crédito no checkout transparente, o valor tinha parado de ser atualizado no WooCommerce 3.0.
* Adicionado valor total ao parcelamento no checkout transparente para tornar mais prático para o cliente a visualização do juros.
4 changes: 2 additions & 2 deletions woocommerce-pagseguro.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Includes PagSeguro as a payment gateway to WooCommerce.
* Author: Claudio Sanches
* Author URI: https://claudiosanches.com
* Version: 2.12.5
* Version: 2.12.6
* License: GPLv2 or later
* Text Domain: woocommerce-pagseguro
* Domain Path: /languages
Expand Down Expand Up @@ -43,7 +43,7 @@ class WC_PagSeguro {
*
* @var string
*/
const VERSION = '2.12.5';
const VERSION = '2.12.6';

/**
* Instance of this class.
Expand Down