Plugin Directory

Changeset 2619491


Ignore:
Timestamp:
10/25/2021 02:51:30 PM (4 years ago)
Author:
haitham22
Message:

some updates

Location:
raccoon-platform/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • raccoon-platform/trunk/Raccoon-platform.php

    r2615524 r2619491  
    88 * Plugin URI: https://raccoonplatform.com
    99 * Description: More informed customers reflect more sales. Here are the features you get from using Raccoon.
    10  * Version: 3.2.4
     10 * Version: 3.2.5
    1111 * License: GPLv2 or Later
    1212 * Text Domain: Raccoon-Platform
     
    9393
    9494
    95 
  • raccoon-platform/trunk/Readme.txt

    r2615524 r2619491  
    55Requires at least: 3.1
    66Tested up to: 5.7.2
    7 Stable tag: 3.2.4
     7Stable tag: 3.2.5
    88Requires PHP: 7.0
    99License: GPLv3 or later
  • raccoon-platform/trunk/include/Popular_items.php

    r2615513 r2619491  
    55class RaccoonPopularItems
    66{
    7 
    87
    98    private $result ;
     
    1615        global $client_api;
    1716        $apiKey = $client_api;
    18 
    1917        $action = 'atc';
    2018        $number_items = 4;
     
    2523        $response = wp_remote_get( 'https://api.raccoonplatform.com:5000/recommend/popular_items/' . $apiKey . '/' . $action . '/' . $number_items . '' );
    2624        $body     = wp_remote_retrieve_body( $response );
    27         $this->output = $body;
     25       print_r( $this->output = $body);
    2826    }
    2927
     
    4745        global $client_api;
    4846        $apiKey = $client_api;
    49 
    5047        $action = 'view';
    5148        $number_items = 4;
     
    5350            'Content-Type:application/json',
    5451        );
    55 
    5652        $response = wp_remote_get( 'https://api.raccoonplatform.com:5000/recommend/popular_items/' . $apiKey . '/' . $action . '/' . $number_items . '' );
    5753        $this->output = wp_remote_retrieve_body( $response );
     
    6965        }
    7066        return $product_id;
    71 
    7267    }
    7368}
  • raccoon-platform/trunk/include/Related_items.php

    r2615513 r2619491  
    1414    function callApiRelated()
    1515    {
    16 //        global $wpdb;
    17 //        $clientapikey = $wpdb->get_results("SELECT apikey FROM wp_raccoon_setting ORDER BY id DESC LIMIT 1");
    18        global  $client_api;
     16
     17        global  $client_api;
    1918        global $product;
    2019        if($product){
  • raccoon-platform/trunk/include/Session_based.php

    r2615513 r2619491  
    1313    {
    1414//         get session_id
    15         $session_id = WC()->session;
    16         $session =$session_id->get_customer_id();
     15         $session_id = WC()->session;
     16         $session =$session_id->get_customer_id();
    1717
    1818        // get apiKey
    19 //        global $wpdb;
    20 //        $clientapikey = $wpdb->get_results("SELECT apikey FROM wp_raccoon_setting ORDER BY id DESC LIMIT 1");
    21         global $client_api;
    22         $apiKay = $client_api;
     19          global $client_api;
     20          $apiKay = $client_api;
     21
     22
    2323        $ssid = $session;
    2424        $number_items = '4';
  • raccoon-platform/trunk/include/ingest_event.php

    r2609641 r2619491  
    77    {
    88    global $woocommerce;
    9     global $wpdb;
    10     $clientapikey = $wpdb->get_results("SELECT apikey FROM wp_raccoon_setting ORDER BY id DESC LIMIT 1");
     9        global  $client_api;
    1110    $items = $woocommerce->cart->get_cart();
    1211    foreach ($items as $item => $values) {
     
    8988                        array(
    9089            'sessionId' => $session_id,
    91             'clientApiKey' => $clientapikey[0]->apikey,
     90            'clientApiKey' => $client_api,
    9291            'category' => 'item',
    9392            'action' => 'atc',
     
    123122         $price = $product->get_price();
    124123         $category_product = $product->get_categories();
    125          global $wpdb;
    126          $clientapikey = $wpdb->get_results("SELECT apikey FROM wp_raccoon_setting ORDER BY id DESC LIMIT 1");
     124         global  $client_api;
    127125         $category = strip_tags($category_product);
    128126         //get date now
     
    138136                     array(
    139137                         'sessionId' => $session_id,
    140                          'clientApiKey' => $clientapikey[0]->apikey,
     138                         'clientApiKey' => $client_api,
    141139                         'category' => 'item',
    142140                         'action' => 'view',
  • raccoon-platform/trunk/include/ingest_session.php

    r2609641 r2619491  
    77        add_action('woocommerce_thankyou',array($this, 'callApiSession'));
    88    }
    9     function callApiSession()
     9     function callApiSession()
    1010    {
    11             $session_id = WC()->session;
    12             $session =$session_id->get_customer_id();
    13              $now = new DateTime();
    14             global $wpdb;
    15             $clientapikey = $wpdb->get_results("SELECT apikey FROM wp_raccoon_setting ORDER BY id DESC LIMIT 1");
     11        $session_id = WC()->session;
     12        $session =$session_id->get_customer_id();
     13        $now = new DateTime();
     14        global  $client_api;
    1615            $requestbody = array(
    1716                'sessionId' => $session,
    18                 'clientApiKey' => $clientapikey[0]->apikey,
     17                'clientApiKey' => $client_api,
    1918                'epochSeconds'=> $now->getTimestamp()
    2019            );
     
    2928                        array(
    3029                            'sessionId' => $session,
    31                             'clientApiKey' => $clientapikey[0]->apikey,
     30                            'clientApiKey' => $client_api,
    3231                            'epochSeconds'=> $now->getTimestamp()
    3332                            )
Note: See TracChangeset for help on using the changeset viewer.