Changeset 2972574
- Timestamp:
- 09/28/2023 09:18:17 AM (2 years ago)
- Location:
- bring4you/trunk
- Files:
-
- 2 edited
-
admin/partials/bring4you-admin-display.php (modified) (3 diffs)
-
bring4you.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bring4you/trunk/admin/partials/bring4you-admin-display.php
r2963644 r2972574 13 13 */ 14 14 15 $url = "https://bring4you.com/external-api/v1/priceEstimation?weight=10&volume=10000&origin_city=Paris,France&destination_city=Lille,France";16 17 $response_ssl = wp_remote_get($url);18 $response = wp_remote_get($url,array('sslverify' => FALSE));19 $body = wp_remote_retrieve_body($response);20 21 $error = 0;22 23 15 24 if(is_wp_error($response_ssl))25 {26 $error = 4;27 }28 else29 {30 if(is_wp_error($response))31 {32 $error = 1;33 }34 else35 {36 $resultArray = json_decode($body,true);37 if(!$resultArray)38 {39 $error = 2;40 }41 else42 {43 $price = $resultArray['value'];44 45 if(!$price)46 {47 $error = 3;48 }49 }50 }51 }52 53 $server = '';54 55 if($error == 0)56 {57 $server = 'Liaison serveur OK';58 }59 else60 {61 $server = 'Liaison serveur : ';62 if($error == 1)63 $server .= 'Aucune Réponse';64 elseif($error == 2)65 $server .= 'Body de la réponse incorrect';66 elseif($error == 3)67 $server .= 'Aucun prix retourné';68 elseif($error == 4)69 $server .= 'SSL Deactivated';70 }71 16 72 17 ?> … … 74 19 <div class="panel"> 75 20 <h3><i class="dashicons dashicons-admin-home"></i><?php _e('Module d\'envoi de Bring4You', 'b4y'); ?></h3> 76 <img src="<?php echo plugins_url('/bring4you/views/img/carrier_image.jpg'); ?>" id="payment-logo" class="pull-right" title=" <?php echo $server; ?>" alt="<?php echo $server; ?>"/>21 <img src="<?php echo plugins_url('/bring4you/views/img/carrier_image.jpg'); ?>" id="payment-logo" class="pull-right" title="" alt="<?php echo $server; ?>"/> 77 22 <p> 78 23 <strong><?php _e('Ceci est notre nouveau module !', 'b4y'); ?></strong><br /> … … 96 41 <?php 97 42 echo sprintf(__( 'Pour ajouter Bring4You à votre installation Woocommerce vous devez ajouter la méthode d\'expédition à votre zone d\'expedition %sici%s.', 'b4y' ),'<a href="'.admin_url( 'admin.php?page=wc-settings&tab=shipping§ion' ).'">','</a>'); 43 ?> 44 <br/> 45 <?php _e('Si vous n\'avez pas de clé merci d\'en commander une', 'b4y'); ?> 46 <br/><br/> 47 <?php 48 echo sprintf(__( '%sCommandez votre clé d’API ici%s', 'b4y' ),'<a href="https://buy.stripe.com/28og1P5ZAeW3gKc5ks" class="button-primary">','</a>'); 98 49 ?> 99 50 </p> -
bring4you/trunk/bring4you.php
r2963644 r2972574 38 38 * Rename this for your plugin and update it as you release new versions. 39 39 */ 40 define( 'BRING4YOU_VERSION', '1.0. 9' );40 define( 'BRING4YOU_VERSION', '1.0.10' ); 41 41 42 42 /**
Note: See TracChangeset
for help on using the changeset viewer.