Changeset 2769008
- Timestamp:
- 08/10/2022 04:37:20 PM (4 years ago)
- File:
-
- 1 edited
-
unienvios/trunk/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
unienvios/trunk/index.php
r2768024 r2769008 4 4 Plugin URI: https://unienvios.com.br/ 5 5 Description: Plugin de Entrega 6 Version: 1.3. 16 Version: 1.3.2 7 7 Author: Unienvios 8 8 Author URI: https://unienvios.com.br/ … … 25 25 } 26 26 } 27 28 $api = new API_UNIENVIOS('https://api.unienvios.com.br');29 $dados = [];30 $dados['email'] = sanitize_email( get_option('unienvios_options')['email'] );31 $dados['senha'] = get_option('unienvios_options')['senha'];32 $dados['cep'] = "03330000";33 $dados['cart_subtotal'] = sanitize_text_field( doubleval($_POST['price_product']) );34 35 $dimensoes = [36 'estimate_height' => sanitize_text_field( doubleval($_POST['estimate_height']) ),37 'estimate_width' => sanitize_text_field( doubleval($_POST['estimate_width']) ),38 'estimate_length' => sanitize_text_field( doubleval($_POST['estimate_length']) ),39 'estimate_weight' => sanitize_text_field( doubleval($_POST['estimate_weight']) ),40 ];41 42 43 $quotation = $api->create_quotation($dados, $dimensoes);44 45 if(!isset($quotation->token)){46 function wpb_admin_notice_warn() {47 echo '<div class="notice notice-error is-dismissible">48 <p>Unienvios Informa: Existe um erro nas configurações do plugin, verifique se a senha e o email estão atualizadas.</p>49 </div>';50 }51 add_action( 'admin_notices', 'wpb_admin_notice_warn' );52 }else{53 27 54 28 /* adds stylesheet file to the end of the queue */ … … 101 75 102 76 add_filter('woocommerce_shipping_methods', 'unienvios_add_your_shipping_method'); 103 }77 104 78 105 79 }
Note: See TracChangeset
for help on using the changeset viewer.