Plugin Directory

Changeset 1705892


Ignore:
Timestamp:
07/31/2017 07:11:15 PM (9 years ago)
Author:
olarkplatform
Message:

add woocommerce widget tracking for better support

Location:
olark-live-chat/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • olark-live-chat/trunk/README.txt

    r1701831 r1705892  
    3333== Changelog ==
    3434
     35= 1.0.6 =
     36Another behind the scenes change to enable our support team to better assist you!
     37
    3538= 1.0.4 + 1.0.5 =
    3639Fixed a bug where setting chat box language made it impossible to change the language in advanced API calls.
  • olark-live-chat/trunk/olark-wp.php

    r1701831 r1705892  
    1717 * Plugin URI:        https://github.com/olark/wordpress-plugin/edit/master/olark-wp/
    1818 * Description:       This plugin is designed to allow you to add an Olark chatbox to your WordPress site easily! Simply activate and add your Site ID from Olark in the settings!
    19  * Version:           1.0.5
     19 * Version:           1.0.6
    2020 * Author:            Olark
    2121 * Author URI:        https://www.olark.com
  • olark-live-chat/trunk/public/class-olark-wp-public.php

    r1701817 r1705892  
    9797         */
    9898
     99        include_once(ABSPATH . 'wp-admin/includes/plugin.php');
     100        $uses_woocommerce = class_exists('WooCommerce');
     101
    99102        if(!empty($this->olark_options['enable_olark'])){
    100103            wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/olark-wp-public.js', array( 'jquery' ), $this->version, false );
     
    107110                'lang'              => $this->olark_options['olark_lang'],
    108111                'api'               => $this->olark_options['olark_api'],
    109                 'mobile'            => $this->olark_options['olark_mobile']
     112                'mobile'            => $this->olark_options['olark_mobile'],
     113                'woocommerce'           => $uses_woocommerce
    110114            );
    111115
  • olark-live-chat/trunk/public/js/olark-wp-public.js

    r1701831 r1705892  
    1313/* Add configuration calls below this comment */
    1414/* Enable Olark on mobile settings*/
    15 olark.configure('system.use_widget', 'wordpress');
     15if (olark_vars.woocommerce) {
     16  olark.configure('system.use_widget', 'wordpress_woocommerce');
     17  window.console && console.log("[olark] wordpress_woocommerce");
     18}else {
     19  olark.configure('system.use_widget', 'wordpress_only');
     20  window.console && console.log("[olark] wordpress_only");
     21}
    1622if (olark_vars.mobile == 0){
    1723    olark.configure('system.hb_disable_mobile', true);
Note: See TracChangeset for help on using the changeset viewer.