Plugin Directory

Changeset 2579767


Ignore:
Timestamp:
08/07/2021 10:15:01 PM (5 years ago)
Author:
integrai
Message:

Update to version 1.0.11 from GitHub

Location:
integrai
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • integrai/tags/1.0.11/includes/class-integrai.php

    r2579713 r2579767  
    2929            $this->version = INTEGRAI_VERSION;
    3030        } else {
    31             $this->version = '1.0.10';
     31            $this->version = '1.0.11';
    3232        }
    3333        $this->Integrai = 'integrai';
  • integrai/tags/1.0.11/integrai.php

    r2579713 r2579767  
    1717 * Plugin URI:        https://github.com/integrai/woocommerce
    1818 * Description:       Integração com os principais meios de pagamento e cálculo de frete para a sua plataforma de e-commerce WP WooCommerce.
    19  * Version:           1.0.10
     19 * Version:           1.0.11
    2020 * Author:            Integrai
    2121 * Author URI:        https://integrai.com.br
     
    3939 * Rename this for your plugin and update it as you release new versions.
    4040 */
    41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.10' );
     41if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.11' );
    4242if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    4343
  • integrai/tags/1.0.11/public/class-integrai-public.php

    r2579713 r2579767  
    216216  }
    217217
     218  private function get_product_categories ( $product_id ) {
     219    $product_categories = array();
     220    $categories = get_the_terms( $product_id, 'product_cat' );
     221
     222    foreach ( $categories as $category ) {
     223      array_push($product_categories, $category->to_array());
     224    }
     225
     226    return $product_categories;
     227  }
     228
    218229  private function get_items( $order_id ) {
    219230    $order = wc_get_order( $order_id );
     
    224235
    225236      array_push($products, array(
    226         'id' => $item->get_id(),
     237        'id' => $item->get_product_id(),
    227238        'sku' => $product->get_sku(),
    228239        'name' => $product->get_name(),
     
    231242        'price' => $order->get_line_total( $item, true, false ),
    232243        'weight' => $product->get_weight(),
     244        'categories' => $this->get_product_categories( $item->get_product_id() ),
    233245      ));
    234246    }
     
    393405            $customer = $this->get_customer( $customer_id );
    394406
    395             return $this->get_api_helper()->send_event(self::NEW_CUSTOMER, $customer);
    396 
    397407            return $this->get_api_helper()->send_event(self::SAVE_CUSTOMER, $customer);
    398408        }
     
    447457    if ( isset($order) && $order_enabled ) {
    448458      $full_order = $this->get_full_order( $order->get_id() );
    449       $response = $this->get_api_helper()->send_event(self::NEW_ORDER, $full_order);
    450 
    451       if (isset($response) && $order_item_enabled) {
     459
     460      if ($order_item_enabled) {
    452461        $has_items = isset($full_order['items']) && !empty($full_order['items']);
    453462        $has_customer = isset($full_order['customer']) && !empty($full_order['customer']);
     
    464473        }
    465474      }
     475
     476      $this->get_api_helper()->send_event(self::NEW_ORDER, $full_order);
    466477    }
    467478    }
  • integrai/tags/1.0.11/readme.txt

    r2579713 r2579767  
    66Requires PHP: 5.6
    77Tested up to: 5.7
    8 Stable tag: 1.0.10
     8Stable tag: 1.0.11
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • integrai/trunk/includes/class-integrai.php

    r2579713 r2579767  
    2929            $this->version = INTEGRAI_VERSION;
    3030        } else {
    31             $this->version = '1.0.10';
     31            $this->version = '1.0.11';
    3232        }
    3333        $this->Integrai = 'integrai';
  • integrai/trunk/integrai.php

    r2579713 r2579767  
    1717 * Plugin URI:        https://github.com/integrai/woocommerce
    1818 * Description:       Integração com os principais meios de pagamento e cálculo de frete para a sua plataforma de e-commerce WP WooCommerce.
    19  * Version:           1.0.10
     19 * Version:           1.0.11
    2020 * Author:            Integrai
    2121 * Author URI:        https://integrai.com.br
     
    3939 * Rename this for your plugin and update it as you release new versions.
    4040 */
    41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.10' );
     41if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.11' );
    4242if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    4343
  • integrai/trunk/public/class-integrai-public.php

    r2579713 r2579767  
    216216  }
    217217
     218  private function get_product_categories ( $product_id ) {
     219    $product_categories = array();
     220    $categories = get_the_terms( $product_id, 'product_cat' );
     221
     222    foreach ( $categories as $category ) {
     223      array_push($product_categories, $category->to_array());
     224    }
     225
     226    return $product_categories;
     227  }
     228
    218229  private function get_items( $order_id ) {
    219230    $order = wc_get_order( $order_id );
     
    224235
    225236      array_push($products, array(
    226         'id' => $item->get_id(),
     237        'id' => $item->get_product_id(),
    227238        'sku' => $product->get_sku(),
    228239        'name' => $product->get_name(),
     
    231242        'price' => $order->get_line_total( $item, true, false ),
    232243        'weight' => $product->get_weight(),
     244        'categories' => $this->get_product_categories( $item->get_product_id() ),
    233245      ));
    234246    }
     
    393405            $customer = $this->get_customer( $customer_id );
    394406
    395             return $this->get_api_helper()->send_event(self::NEW_CUSTOMER, $customer);
    396 
    397407            return $this->get_api_helper()->send_event(self::SAVE_CUSTOMER, $customer);
    398408        }
     
    447457    if ( isset($order) && $order_enabled ) {
    448458      $full_order = $this->get_full_order( $order->get_id() );
    449       $response = $this->get_api_helper()->send_event(self::NEW_ORDER, $full_order);
    450 
    451       if (isset($response) && $order_item_enabled) {
     459
     460      if ($order_item_enabled) {
    452461        $has_items = isset($full_order['items']) && !empty($full_order['items']);
    453462        $has_customer = isset($full_order['customer']) && !empty($full_order['customer']);
     
    464473        }
    465474      }
     475
     476      $this->get_api_helper()->send_event(self::NEW_ORDER, $full_order);
    466477    }
    467478    }
  • integrai/trunk/readme.txt

    r2579713 r2579767  
    66Requires PHP: 5.6
    77Tested up to: 5.7
    8 Stable tag: 1.0.10
     8Stable tag: 1.0.11
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.