Changeset 2619491
- Timestamp:
- 10/25/2021 02:51:30 PM (4 years ago)
- Location:
- raccoon-platform/trunk
- Files:
-
- 7 edited
-
Raccoon-platform.php (modified) (2 diffs)
-
Readme.txt (modified) (1 diff)
-
include/Popular_items.php (modified) (6 diffs)
-
include/Related_items.php (modified) (1 diff)
-
include/Session_based.php (modified) (1 diff)
-
include/ingest_event.php (modified) (4 diffs)
-
include/ingest_session.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
raccoon-platform/trunk/Raccoon-platform.php
r2615524 r2619491 8 8 * Plugin URI: https://raccoonplatform.com 9 9 * Description: More informed customers reflect more sales. Here are the features you get from using Raccoon. 10 * Version: 3.2. 410 * Version: 3.2.5 11 11 * License: GPLv2 or Later 12 12 * Text Domain: Raccoon-Platform … … 93 93 94 94 95 -
raccoon-platform/trunk/Readme.txt
r2615524 r2619491 5 5 Requires at least: 3.1 6 6 Tested up to: 5.7.2 7 Stable tag: 3.2. 47 Stable tag: 3.2.5 8 8 Requires PHP: 7.0 9 9 License: GPLv3 or later -
raccoon-platform/trunk/include/Popular_items.php
r2615513 r2619491 5 5 class RaccoonPopularItems 6 6 { 7 8 7 9 8 private $result ; … … 16 15 global $client_api; 17 16 $apiKey = $client_api; 18 19 17 $action = 'atc'; 20 18 $number_items = 4; … … 25 23 $response = wp_remote_get( 'https://api.raccoonplatform.com:5000/recommend/popular_items/' . $apiKey . '/' . $action . '/' . $number_items . '' ); 26 24 $body = wp_remote_retrieve_body( $response ); 27 $this->output = $body;25 print_r( $this->output = $body); 28 26 } 29 27 … … 47 45 global $client_api; 48 46 $apiKey = $client_api; 49 50 47 $action = 'view'; 51 48 $number_items = 4; … … 53 50 'Content-Type:application/json', 54 51 ); 55 56 52 $response = wp_remote_get( 'https://api.raccoonplatform.com:5000/recommend/popular_items/' . $apiKey . '/' . $action . '/' . $number_items . '' ); 57 53 $this->output = wp_remote_retrieve_body( $response ); … … 69 65 } 70 66 return $product_id; 71 72 67 } 73 68 } -
raccoon-platform/trunk/include/Related_items.php
r2615513 r2619491 14 14 function callApiRelated() 15 15 { 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; 19 18 global $product; 20 19 if($product){ -
raccoon-platform/trunk/include/Session_based.php
r2615513 r2619491 13 13 { 14 14 // 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(); 17 17 18 18 // 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 23 23 $ssid = $session; 24 24 $number_items = '4'; -
raccoon-platform/trunk/include/ingest_event.php
r2609641 r2619491 7 7 { 8 8 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; 11 10 $items = $woocommerce->cart->get_cart(); 12 11 foreach ($items as $item => $values) { … … 89 88 array( 90 89 'sessionId' => $session_id, 91 'clientApiKey' => $client apikey[0]->apikey,90 'clientApiKey' => $client_api, 92 91 'category' => 'item', 93 92 'action' => 'atc', … … 123 122 $price = $product->get_price(); 124 123 $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; 127 125 $category = strip_tags($category_product); 128 126 //get date now … … 138 136 array( 139 137 'sessionId' => $session_id, 140 'clientApiKey' => $client apikey[0]->apikey,138 'clientApiKey' => $client_api, 141 139 'category' => 'item', 142 140 'action' => 'view', -
raccoon-platform/trunk/include/ingest_session.php
r2609641 r2619491 7 7 add_action('woocommerce_thankyou',array($this, 'callApiSession')); 8 8 } 9 function callApiSession()9 function callApiSession() 10 10 { 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; 16 15 $requestbody = array( 17 16 'sessionId' => $session, 18 'clientApiKey' => $client apikey[0]->apikey,17 'clientApiKey' => $client_api, 19 18 'epochSeconds'=> $now->getTimestamp() 20 19 ); … … 29 28 array( 30 29 'sessionId' => $session, 31 'clientApiKey' => $client apikey[0]->apikey,30 'clientApiKey' => $client_api, 32 31 'epochSeconds'=> $now->getTimestamp() 33 32 )
Note: See TracChangeset
for help on using the changeset viewer.