Plugin Directory

Changeset 3222816


Ignore:
Timestamp:
01/15/2025 11:23:47 AM (12 months ago)
Author:
tecnologiavirtuaria
Message:

Versão 1.9.3

Location:
virtuaria-correios
Files:
733 added
7 edited

Legend:

Unmodified
Added
Removed
  • virtuaria-correios/trunk/admin/css/setup.css

    r3220267 r3222816  
    292292    padding-left: 30px;
    293293}
     294.premium tbody .serial-code .titledesc,
    294295.form-table tbody tr:first-of-type .titledesc {
    295296    padding-left: 0;
     
    551552}
    552553
     554.premium .ticket-desc,
    553555.ticket .ticket-desc {
    554556    text-align: center;
     
    560562    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    561563}
     564.premium .ticket-desc {
     565    text-align: left;
     566}
    562567
    563568@media only screen and (min-width: 1024px) and (max-width: 1280px) {
  • virtuaria-correios/trunk/class-virtuaria-correios.php

    r3220267 r3222816  
    44 * Plugin URI: https://virtuaria.com.br
    55 * Description: Adiciona o método de entrega Correios em lojas Woocommerce.
    6  * Version: 1.9.2
     6 * Version: 1.9.3
    77 * Author: Virtuaria
    88 * Author URI: http://virtuaria.com.br
  • virtuaria-correios/trunk/includes/class-virtuaria-correios-api.php

    r3202331 r3222816  
    515515
    516516        if ( isset( $response['msgs'] ) || isset( $response['msg'] ) ) {
     517            $msg = isset( $response['msgs'] )
     518                ? $response['msgs']
     519                : array( $response['msg'] );
     520
     521            foreach ( $msg as $index => $error ) {
     522                if ( false !== strpos( $error, 'RTL-036: ' ) ) {
     523                    $msg[ $index ] = __( 'O número do destinatário não foi informado no pedido.', 'virtuaria-correios' );
     524                } else {
     525                    $msg[ $index ] = preg_replace( '/RTL-\d+: ?/', '', $error );
     526                }
     527            }
    517528            set_transient(
    518529                'virtuaria_correios_prepost_error',
    519                 isset( $response['msgs'] )
    520                     ? $response['msgs']
    521                     : array( $response['msg'] ),
     530                $msg,
    522531                30
    523532            );
  • virtuaria-correios/trunk/includes/class-virtuaria-correios-shipping-screen.php

    r3219223 r3222816  
    114114        ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['create_prepost_nonce'] ) ), 'create_prepost' ) ) {
    115115            $order = wc_get_order( sanitize_text_field( wp_unslash( $_POST['correios_order_id'] ) ) );
     116
     117            if ( ! $this->is_valid_correios_contract() ) {
     118                wp_send_json_error(
     119                    __( 'Por favor, configure as informações do seu contrato com os correios, antes de tentar gerar etiquetas', 'virtuaria-correios' )
     120                );
     121                wp_die();
     122            }
    116123
    117124            if ( $order ) {
     
    130137                        );
    131138                    }
    132                 }
    133             } else {
    134                 $error = get_transient( 'virtuaria_correios_prepost_error' );
    135                 if ( $error ) {
    136                     delete_transient( 'virtuaria_correios_prepost_error' );
    137                     wp_send_json_error(
    138                         $error
    139                     );
    140139                } else {
    141                     echo 'Fail';
     140                    $error = get_transient( 'virtuaria_correios_prepost_error' );
     141                    if ( $error ) {
     142                        delete_transient( 'virtuaria_correios_prepost_error' );
     143                        wp_send_json_error(
     144                            $error
     145                        );
     146                    } else {
     147                        echo 'Fail';
     148                    }
    142149                }
    143150            }
     
    146153        }
    147154        wp_die();
     155    }
     156
     157    /**
     158     * Check if the Correios contract is valid.
     159     *
     160     * @return bool True if the contract is valid, false otherwise.
     161     */
     162    private function is_valid_correios_contract() {
     163        $settings = Virtuaria_WPMU_Correios_Settings::get_settings();
     164
     165        if ( isset( $settings['username'], $settings['password'], $settings['post_card'] )
     166            && ! empty( $settings['username'] )
     167            && ! empty( $settings['password'] )
     168            && ! empty( $settings['post_card'] )
     169        ) {
     170            return true;
     171        }
     172        return false;
    148173    }
    149174
  • virtuaria-correios/trunk/public/js/cep-mask.js

    r3205728 r3222816  
    88
    99            if (typeof mask.stateHidden !== 'undefined') {
    10                 var state = get_state_from_cep( cep );
     10                var state = getStateFromCep( cep );
    1111                if ( state ) {
    1212                    $('#calc_shipping_state').val( state );
  • virtuaria-correios/trunk/readme.txt

    r3220267 r3222816  
    44Requires at least: 4.7
    55Tested up to: 6.7.1
    6 Stable tag: 1.9.2
     6Stable tag: 1.9.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    194194
    195195== Changelog ==
     196= 1.9.3 2025-01-15 =
     197* Melhoria - Refinamentos na geração de etiquetas;
     198* Ajuste - Otimizações no preenchimento das informações de entrega.
    196199= 1.9.2 2025-01-10 =
    197200* Novo - Compatibilidade com código de rastreio de outros plugins.
  • virtuaria-correios/trunk/templates/correios-settings.php

    r3220267 r3222816  
    855855        <tbody>
    856856            <tr valign="top">
     857                <th scope="row" class="titledesc">
     858                    <small style="display: block;font-size: 15px;color: #4c4f57;font-weight: bold;width: 1058px;" class="ticket-desc">
     859                        🆓 🔓 Este plugin é gratuito e de código aberto. Os recursos Premium são adicionais que proporcionam mais agilidade a operações já disponíveis gratuitamente, como a geração de etiquetas.
     860                    </small>
     861                </th>
     862            </tr>
     863            <tr valign="top" class="serial-code">
    857864                <th scope="row" class="titledesc">
    858865                    <label for="woocommerce_virt_correios_serial">Código de Licença</label>
Note: See TracChangeset for help on using the changeset viewer.