Plugin Directory

Changeset 2537381


Ignore:
Timestamp:
05/25/2021 06:59:13 PM (5 years ago)
Author:
oribi
Message:

Adding support for more purchase flows

Location:
oribi-analytics-for-woocommerce/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oribi-analytics-for-woocommerce/trunk/oribi-analytics-ecommerce.php

    r2501257 r2537381  
    66 * Author: Oribi
    77 * Author URI: https://oribi.io
    8  * Version: 1.6.0
     8 * Version: 1.7.0
    99 * Text Domain: oribi
    1010 * WC requires at least: 2.2
    11  * WC tested up to: 5.1.0
     11 * WC tested up to: 5.3.0
    1212 */
    1313
     
    6666
    6767            add_filter('woocommerce_payment_successful_result',  array( self::class, 'oribi_track_woocommerce_purchase' ), 1, 2 );
     68            add_filter('woocommerce_payment_complete',  array( self::class, 'oribi_track_woocommerce_payment_complete' ), 1, 2 );
     69            add_action('wp_footer', array( self::class, 'oribiDisplayVersionOfPlugin' )); // Add function for checking the version of plugin
    6870            add_action('wp_footer', array( self::class, 'trackIntegratePurchase' ));
    6971
     
    102104        }
    103105
    104         public static function oribi_track_woocommerce_purchase( $result, $order_id ) {
     106        /**
     107         * This static function is only for checking of plugin version.
     108         * Displaying The Plugin Version on every page of Wordpress.
     109         */
     110        public static function oribiDisplayVersionOfPlugin() {
     111            try {
     112                $data = get_file_data( __FILE__, ['ver'=>'Version'] );
     113            } catch (Exception $e) {
     114
     115            }
     116
     117            if(isset($data) && isset($data['ver'])) {
     118                ?><script>console.debug('ORIBI Plugin Version: ' + '<?= $data['ver'] ?>');</script><?php
     119            }
     120        }
     121
     122        public static function oribi_track_woocommerce_payment_complete($order_id){
     123            Oribi_Event_Tracker::oribi_track_woocommerce_purchase('success', $order_id);
     124        }
     125
     126        public static function oribi_track_woocommerce_purchase($result, $order_id) {
    105127            $order    = wc_get_order( $order_id );
    106128
     
    180202
    181203            return $result;
    182 
    183204        }
    184205
  • oribi-analytics-for-woocommerce/trunk/readme.txt

    r2501257 r2537381  
    44Tags: analytics, ecommerce, insights, google-analytics, tracking
    55Requires at least: 5.0
    6 Tested up to: 5.7
    7 Stable tag: 1.0
     6Tested up to: 5.7.2
     7Stable tag: 1.7.0
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    9191
    9292== Changelog ==
     93= v1.7.0 =
     94Added Support for more WooCommerce purchase flows, in order to track revenue on multiple optional purchase flow at the shop.
    9395= v1.6.0 =
    9496Added Support for WordPress 5.7 and WooCommerce 5.1
Note: See TracChangeset for help on using the changeset viewer.