PluginProbe ʕ •ᴥ•ʔ
CommerceBird – AI Command Center, ERP Integrations & B2B for WooCommerce (Zoho, Exact Online). / 2.3.14
CommerceBird – AI Command Center, ERP Integrations & B2B for WooCommerce (Zoho, Exact Online). v2.3.14
3.0.3 3.0.2 3.0.1 trunk 2.2.14 2.2.15 2.2.16 2.2.17 2.2.18 2.2.19 2.3.0 2.3.1 2.3.10 2.3.11 2.3.12 2.3.13 2.3.14 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.7.91 2.7.92 2.7.93 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.9.0 2.9.1 2.9.2 2.9.3 3.0.0
commercebird / includes / classes / zoho-inventory / class-multi-currency.php
commercebird / includes / classes / zoho-inventory Last commit date
class-categories.php 1 year ago class-import-image.php 11 months ago class-import-items.php 11 months ago class-import-price-list.php 1 year ago class-multi-currency.php 1 year ago class-order-sync.php 11 months ago class-product.php 1 year ago class-users-contact.php 1 year ago index.php 1 year ago
class-multi-currency.php
62 lines
1 <?php
2
3 /**
4 * All Multi Currency related functions.
5 *
6 * @package WooZo Inventory
7 * @category Zoho Integration
8 * @author Roadmap Studios
9 * @link https://commercebird.com
10 */
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 class CMBIRD_Multicurrency_Zoho {
16
17 private $config;
18 public function __construct() {
19
20 $config = array(
21
22 'MulticurrencyZI' => array(
23 'OID' => get_option( 'cmbird_zoho_inventory_oid' ),
24 'APIURL' => get_option( 'cmbird_zoho_inventory_url' ),
25
26 ),
27
28 );
29
30 $this->config = $config;
31 }
32
33 public function zoho_currency_data( $user_currency, $userid ) {
34
35 $zoho_inventory_oid = $this->config['MulticurrencyZI']['OID'];
36 $zoho_inventory_url = $this->config['MulticurrencyZI']['APIURL'];
37
38 //execute curl
39
40 $url = $zoho_inventory_url . 'inventory/v1/settings/currencies?organization_id=' . $zoho_inventory_oid;
41
42 $execute_curl_call_handle = new CMBIRD_API_Handler_Zoho();
43 $response = $execute_curl_call_handle->execute_curl_call_get( $url );
44
45 $code = $response->code;
46 $message = $response->message;
47
48 if ( 0 == $code || '0' == $code ) {
49
50 foreach ( $response->currencies as $key => $value ) {
51 if ( $value->currency_code == $user_currency ) {
52 update_user_meta( $userid, 'zi_currency_id', $value->currency_id );
53 update_user_meta( $userid, 'zi_currency_code', $value->currency_code );
54 }
55 }
56 }
57
58 $currency_id = intval( get_user_meta( $userid, 'zi_currency_id', true ) );
59 return $currency_id;
60 }
61 }
62