Plugin Directory

Changeset 2591731


Ignore:
Timestamp:
08/31/2021 08:57:22 PM (5 years ago)
Author:
frogedtech
Message:

version 1.1.0

Location:
froged
Files:
8 added
2 edited

Legend:

Unmodified
Added
Removed
  • froged/trunk/froged-conf.php

    r2591384 r2591731  
    44Plugin URI: https://app.froged.com/?utm_source=wordpress_plugin
    55Description: Froged. Live Chat, Email Campaigns, Lead Generation, and much more.
    6 Version: 1.0.9
     6Version: 1.1.0
    77Requires at least: 3.0
    88Tested up to: 5.8
     
    3939    if (!empty($id) && (!isset($options['include_snippet']) != '1' || $options['include_snippet']) ){
    4040        add_action( 'wp_head', 'froged_woo_header', 102 );
    41         add_action('wp_login', 'froged_login',10,2);
    42         add_action('wp_logout', 'froged_logout');
    43         add_action('user_register', 'froged_on_sign_up');
     41        add_action('wp_login', 'froged_login',30,2);
     42        add_action('wp_logout', 'froged_logout',30);
     43        add_action('user_register', 'froged_on_sign_up',30);
    4444        add_action( 'wp_enqueue_scripts', 'froged_scripts' );
     45        add_filter( 'http_headers_useragent', 'froged_setUserAgent',30,2);
    4546                if ( class_exists( 'WooCommerce' ) ) {
    4647           
    47                 add_action('woocommerce_add_to_cart','froged_addtocart',10, 6);
    48                 add_action('woocommerce_remove_cart_item','froged_removefromcart',10, 6);
    49                 add_action('wp_footer', 'froged_add_to_wishlist');
    50                 add_action('wp_ajax_getDataWhislist', 'froged_getDataWhislist');
    51                 add_action('wp_ajax_nopriv_getDataWhislist', 'froged_getDataWhislist');
     48                add_action('woocommerce_add_to_cart','froged_addtocart',30, 6);
     49                add_action('woocommerce_remove_cart_item','froged_removefromcart',30, 6);
     50                add_action('wp_footer', 'froged_add_to_wishlist',30);
     51                add_action('wp_ajax_getDataWhislist', 'froged_getDataWhislist',30);
     52                add_action('wp_ajax_nopriv_getDataWhislist', 'froged_getDataWhislist',30);
    5253        }
    5354    }
     
    121122        $user_agent = $_SERVER['HTTP_USER_AGENT'];
    122123        $actual_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
    123         $info = array('url' => $actual_url, 'referrer' => isset($referer) ? '' : $referer, 'userAgent' => $user_agent );
     124        $info = array('url' => $actual_url, 'referrer' => isset($referer) ? $referer : '' , 'userAgent' => $user_agent );
    124125        $response = wp_remote_post( $url, array(
    125126        'method' => 'POST',
     
    130131        'headers' => array(),
    131132        'body' => array('meta' => $meta, 'info' => $info),
    132         'cookies' => array()));     
    133     }
     133        'cookies' => array()));
     134    }
     135}
     136
     137function froged_setUserAgent ($agent,$url){
     138    return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36';
    134139}
    135140
     
    221226        if( is_user_logged_in() )
    222227        {
    223             $current_user = wp_get_current_user();
    224            
     228            $current_user = wp_get_current_user();     
    225229            $username = $current_user->user_login;
    226230            $userId = $current_user->ID;
     
    301305                    $product_category   = 'None';
    302306                }
    303                 if($product->price!=$product->regular_price){
     307                if($product->get_price()!=$product->get_regular_price()){
    304308                    ?>
    305309                        <script type="text/javascript">
    306310                            (function($){
    307311                                Froged('track', 'on_view_promotion', {
    308                                     promotions: '<?php echo "sku: ".$product->get_sku()." - price offer: ".$product->price." ".get_option('woocommerce_currency'); ?>',
     312                                    promotions: '<?php echo "sku: ".$product->get_sku()." - price offer: ".$product->get_price()." ".get_option('woocommerce_currency'); ?>',
    309313                                });
    310314                            })(jQuery);
     
    320324                            item_id:    ['<?php echo (isset($options['product_ref']) && $options['product_ref']) ? $content_id : $content_sku; ?>'],
    321325                            value: <?php echo (isset($options['taxes']) && $options['taxes']) ? number_format($price,2,'.','') : number_format($price_ex,2,'.',''); ?>,
    322                             currency:'<?php echo $options['currency'];?>'
     326                            currency:'<?php echo get_option('woocommerce_currency');?>'
    323327                        });
    324328                        </script>
     
    373377                        items: [<?php echo (isset($options['product_ref']) && $options['product_ref']) ? implode( ', ',$content_id) : implode( ', ',$content_sku); ?>],
    374378                        value: <?php echo (isset($options['taxes']) && $options['taxes']) ? number_format($cart_total,2,'.','') : number_format($cart_total_ex,2,'.',''); ?>,
    375                         currency:'<?php echo $options['currency'];?>'
     379                        currency:'<?php echo get_option('woocommerce_currency');?>'
    376380                    });
    377381                    </script>
     
    406410                    items: [<?php echo (isset($options['product_ref']) && $options['product_ref']) ? implode( ', ',$content_id) : implode( ', ',$content_sku); ?>],
    407411                    value: <?php echo (isset($options['taxes']) && $options['taxes']) ? number_format($order_total,2,'.','') : number_format($order_total_ex,2,'.',''); ?>,
    408                     currency:'<?php echo $options['currency'];?>',
     412                    currency:'<?php echo get_option('woocommerce_currency');?>',
    409413                    transaction_id:'<?php echo $order_id;?>',
    410414                    coupon:'<?php echo implode( ', ',$coupon);?>',
  • froged/trunk/readme.txt

    r2591384 r2591731  
    44Requires at least: 3.0
    55Tested up to: 5.8
    6 Stable tag: 1.0.9
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    133133
    134134* Performance improvements
     135
     136= 1.1.0 =
     137
     138* New events added - on_sign_up, on_login, on_logout, on_add_to_cart, on_remove_from_cart
Note: See TracChangeset for help on using the changeset viewer.