Plugin Directory

Changeset 2596602


Ignore:
Timestamp:
09/10/2021 01:31:25 AM (4 years ago)
Author:
integrai
Message:

Update to version 1.0.16 from GitHub

Location:
integrai
Files:
8 edited
1 copied

Legend:

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

    r2588846 r2596602  
    2929            $this->version = INTEGRAI_VERSION;
    3030        } else {
    31             $this->version = '1.0.15';
     31            $this->version = '1.0.16';
    3232        }
    3333        $this->Integrai = 'integrai';
     
    108108    $this->loader->add_action( 'woocommerce_order_status_cancelled', $plugin_public, 'woocommerce_order_status_cancelled' );
    109109    $this->loader->add_action( 'woocommerce_order_refunded', $plugin_public, 'woocommerce_order_refunded' );
     110    $this->loader->add_action( 'save_post', $plugin_public, 'woocommerce_save_product', 10, 3 );
    110111
    111112    // QUOTE
  • integrai/tags/1.0.16/integrai.php

    r2588846 r2596602  
    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.15
     19 * Version:           1.0.16
    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.15' );
     41if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.16' );
    4242if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    4343
  • integrai/tags/1.0.16/public/class-integrai-public.php

    r2588825 r2596602  
    2929    const ABANDONED_CART = 'ABANDONED_CART';
    3030    const ABANDONED_CART_ITEM = 'ABANDONED_CART_ITEM';
     31    const CREATE_PRODUCT = 'CREATE_PRODUCT';
     32    const UPDATE_PRODUCT = 'UPDATE_PRODUCT';
    3133
    3234    public function __construct( $integrai, $version ) {
     
    519521    }
    520522
     523    // SAVE PRODUCT
     524    public function woocommerce_save_product( $post_id, $post, $update ) {
     525        if ($post->post_type != 'product') {
     526            return;
     527        }
     528
     529        $event = null;
     530        if( ! $update && $post->post_status === "auto-draft" ) {
     531            $event = self::CREATE_PRODUCT;
     532        } else if ( $update && !strpos( wp_get_raw_referer(), 'post-new' ) ) {
     533            $event = self::UPDATE_PRODUCT;
     534        }
     535
     536        $product = wc_get_product( $post );
     537
     538        if (isset($product) && $this->get_config_helper()->event_is_enabled($event)) {
     539            return $this->get_api_helper()->send_event($event, $product->get_data());
     540        }
     541    }
     542
     543
    521544    /** CRON - EVENTS: */
    522545    public function integrai_custom_cron_schedules( $schedules ) {
  • integrai/tags/1.0.16/readme.txt

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

    r2588846 r2596602  
    2929            $this->version = INTEGRAI_VERSION;
    3030        } else {
    31             $this->version = '1.0.15';
     31            $this->version = '1.0.16';
    3232        }
    3333        $this->Integrai = 'integrai';
     
    108108    $this->loader->add_action( 'woocommerce_order_status_cancelled', $plugin_public, 'woocommerce_order_status_cancelled' );
    109109    $this->loader->add_action( 'woocommerce_order_refunded', $plugin_public, 'woocommerce_order_refunded' );
     110    $this->loader->add_action( 'save_post', $plugin_public, 'woocommerce_save_product', 10, 3 );
    110111
    111112    // QUOTE
  • integrai/trunk/integrai.php

    r2588846 r2596602  
    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.15
     19 * Version:           1.0.16
    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.15' );
     41if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.16' );
    4242if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    4343
  • integrai/trunk/public/class-integrai-public.php

    r2588825 r2596602  
    2929    const ABANDONED_CART = 'ABANDONED_CART';
    3030    const ABANDONED_CART_ITEM = 'ABANDONED_CART_ITEM';
     31    const CREATE_PRODUCT = 'CREATE_PRODUCT';
     32    const UPDATE_PRODUCT = 'UPDATE_PRODUCT';
    3133
    3234    public function __construct( $integrai, $version ) {
     
    519521    }
    520522
     523    // SAVE PRODUCT
     524    public function woocommerce_save_product( $post_id, $post, $update ) {
     525        if ($post->post_type != 'product') {
     526            return;
     527        }
     528
     529        $event = null;
     530        if( ! $update && $post->post_status === "auto-draft" ) {
     531            $event = self::CREATE_PRODUCT;
     532        } else if ( $update && !strpos( wp_get_raw_referer(), 'post-new' ) ) {
     533            $event = self::UPDATE_PRODUCT;
     534        }
     535
     536        $product = wc_get_product( $post );
     537
     538        if (isset($product) && $this->get_config_helper()->event_is_enabled($event)) {
     539            return $this->get_api_helper()->send_event($event, $product->get_data());
     540        }
     541    }
     542
     543
    521544    /** CRON - EVENTS: */
    522545    public function integrai_custom_cron_schedules( $schedules ) {
  • integrai/trunk/readme.txt

    r2588846 r2596602  
    66Requires PHP: 5.6
    77Tested up to: 5.7
    8 Stable tag: 1.0.15
     8Stable tag: 1.0.16
    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.