Skip to content

Commit

Permalink
Torna cobrança única de frete/taxa opcional (#116)
Browse files Browse the repository at this point in the history
* Torna cobrança única de fretes e taxas opcional

* Versionamento 5.4.1
  • Loading branch information
laerte-guimaraes authored Jan 24, 2019
1 parent 485a3d9 commit 4c8ac3d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Notas das versões

## [5.4.1 - 21/01/2019](https://github.com/vindi/vindi-woocommerce-subscriptions/releases/tag/5.4.1)

### Adicionado
- Adiciona opção para cobranças únicas de fretes e taxas


## [5.4.0 - 15/01/2019](https://github.com/vindi/vindi-woocommerce-subscriptions/releases/tag/5.4.0)

### Adicionado
- Adiciona compatibilidade com frete único
- Adiciona compatibilidade com entrega única


## [5.3.3 - 30/11/2018](https://github.com/vindi/vindi-woocommerce-subscriptions/releases/tag/5.3.3)
Expand Down
8 changes: 6 additions & 2 deletions includes/class-vindi-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,12 @@ protected function verify_payment_profile($payment_profile_id)
**/
private function return_cycle_from_product_type($item)
{
if (!$this->is_subscription_type($item->get_product())
|| $this->is_one_time_shipping($item->get_product())) {
if ($item['type'] == 'shipping' || $item['type'] == 'tax') {
if ($this->container->get_shipping_and_tax_config())
return 1;
}
elseif (!$this->is_subscription_type(wc_get_product($item['product_id']))
|| $this->is_one_time_shipping(wc_get_product($item['product_id']))) {
return 1;
}
return null;
Expand Down
16 changes: 16 additions & 0 deletions includes/class-vindi-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ public function init_form_fields()
'label' => __('Enviar alterações de status nas assinaturas do WooCommerce', VINDI_IDENTIFIER),
'description' => __('Envia as alterações de status nas assinaturas do WooCommerce para Vindi.', VINDI_IDENTIFIER),
'default' => 'no',
),
'shipping_and_tax_config' => array(
'title' => __('Cobrança única', VINDI_IDENTIFIER),
'type' => 'checkbox',
'label' => __('Ativar cobrança única para fretes e taxas', VINDI_IDENTIFIER),
'description' => __('Fretes e Taxas serão cobrados somente no primeiro ciclo de uma assinatura', VINDI_IDENTIFIER),
'default' => 'no',
),
'testing' => array(
'title' => __('Testes', 'vindi-woocommerce'),
Expand Down Expand Up @@ -232,6 +239,15 @@ public function get_synchronism_status()
return 'yes' === $this->settings['vindi_synchronism'];
}

/**
* Get Vindi Shipping and Tax config
* @return string
**/
public function get_shipping_and_tax_config()
{
return 'yes' === $this->settings['shipping_and_tax_config'];
}

/**
* @return int
**/
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Requires at least: 4.4
Tested up to: 4.9.8
WC requires at least: 3.0.0
WC tested up to: 3.4.5
Stable Tag: 5.4.0
Stable Tag: 5.4.1
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -63,8 +63,11 @@ Caso necessite de informações sobre a plataforma ou API por favor siga atravé

== Changelog ==

= 5.4.1 - 21/01/2019 =
- Adiciona opção para cobranças únicas de fretes e taxas

= 5.4.0 - 15/01/2019 =
- Adiciona compatibilidade com frete único
- Adiciona compatibilidade com entrega única

= 5.3.3 - 30/11/2018 =
- Corrige instalação no ambiente Wordpress.com
Expand Down
4 changes: 2 additions & 2 deletions vindi-woocommerce-subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Vindi Woocommerce
* Plugin URI:
* Description: Adiciona o gateway de pagamentos da Vindi para o WooCommerce.
* Version: 5.4.0
* Version: 5.4.1
* Author: Vindi
* Author URI: https://www.vindi.com.br
* Requires at least: 4.4
Expand Down Expand Up @@ -39,7 +39,7 @@ class Vindi_WooCommerce_Subscriptions
/**
* @var string
*/
const VERSION = '5.4.0';
const VERSION = '5.4.1';

/**
* @var string
Expand Down

0 comments on commit 4c8ac3d

Please sign in to comment.