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

Corrige exibição de planos apenas para produtos de assinatura #139

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Notas das versões

## [5.5.3 - 22/01/2020](https://github.com/vindi/vindi-woocommerce-subscriptions/releases/tag/5.5.3)

### Corrigido
- Corrige exibição de plano apenas para produtos de assinatura

## [5.5.2 - 09/01/2020](https://github.com/vindi/vindi-woocommerce-subscriptions/releases/tag/5.5.2)

### Corrigido
Expand Down
5 changes: 4 additions & 1 deletion 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: 5.2.1
WC requires at least: 3.0.0
WC tested up to: 3.6.4
Stable Tag: 5.5.2
Stable Tag: 5.5.3
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand All @@ -27,6 +27,9 @@ Para dúvidas e suporte técnico, entre em contato com a equipe Vindi através d

== Changelog ==

= 5.5.3 - 22/01/2020 =
- Corrige exibição de plano apenas para produtos de assinatura

= 5.5.2 - 09/01/2020 =
- Corrige exibição de datas no plugin

Expand Down
37 changes: 25 additions & 12 deletions templates/admin-simple-product-subscription-fields.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,35 @@
if (preg_match('/variable-subscription/', $product_type)) {
$label = __('Plano padrão da Vindi', VINDI_IDENTIFIER);
$description = __('Selecione o plano padrão da Vindi que deseja relacionar a esse produto caso não especifique na variação', VINDI_IDENTIFIER);
} else {

woocommerce_wp_select(array(
'id' => 'vindi_subscription_plan',
'label' => $label,
'options' => $plans['names'],
'description' => $description,
'desc_tip' => true,
'value' => $selected_plan,
'custom_attributes' => array(
'data-plan-info' => json_encode($plans['infos'])
)
));
} else if (preg_match('/simple-subscription/', $product_type)) {
$label = __('Plano da Vindi', VINDI_IDENTIFIER);
$description = __('Selecione o plano da Vindi que deseja relacionar a esse produto', VINDI_IDENTIFIER);

woocommerce_wp_select(array(
'id' => 'vindi_subscription_plan',
'label' => $label,
'options' => $plans['names'],
'description' => $description,
'desc_tip' => true,
'value' => $selected_plan,
'custom_attributes' => array(
'data-plan-info' => json_encode($plans['infos'])
)
));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, o que acha de fazermos assim?

    if (preg_match('/variable-subscription/', $product_type)) {
        $label = __('Plano padrão da Vindi', VINDI_IDENTIFIER);
        $description = __('Selecione o plano padrão da Vindi que deseja relacionar a esse produto caso não especifique na variação', VINDI_IDENTIFIER);
    } else if (preg_match('/simple-subscription/', $product_type))  {
        $label = __('Plano da Vindi', VINDI_IDENTIFIER);
        $description = __('Selecione o plano da Vindi que deseja relacionar a esse produto', VINDI_IDENTIFIER);
    }

    woocommerce_wp_select(array(
        'id'                 => 'vindi_subscription_plan',
        'label'              => $label,
        'options'            => $plans['names'],
        'description'        => $description,
        'desc_tip'           => true,
        'value'              => $selected_plan,
        'custom_attributes'  => array(
            'data-plan-info' => json_encode($plans['infos'])
        )
    ));

}

woocommerce_wp_select(array(
'id' => 'vindi_subscription_plan',
'label' => $label,
'options' => $plans['names'],
'description' => $description,
'desc_tip' => true,
'value' => $selected_plan,
'custom_attributes' => array(
'data-plan-info' => json_encode($plans['infos'])
)
));
?>
</div>
<div class="show_if_subscription clear"></div>
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.5.2
* Version: 5.5.3
* 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.5.2';
const VERSION = '5.5.3';

/**
* @var string
Expand Down