Changeset 2747414
- Timestamp:
- 06/24/2022 06:52:51 AM (4 years ago)
- Location:
- releva-nz/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (1 diff)
-
includes/class-relevatracking.php (modified) (1 diff)
-
public/class-relevatracking-public.php (modified) (14 diffs)
-
relevatracking.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
releva-nz/trunk/README.txt
r2721057 r2747414 64 64 * improve conversion tracking 65 65 * support for Wordpress 6 66 67 = 2.1.2 = 68 * improve product export performance -
releva-nz/trunk/includes/class-relevatracking.php
r2721057 r2747414 70 70 71 71 $this->plugin_name = 'relevatracking'; 72 $this->version = '2.1. 1';72 $this->version = '2.1.2'; 73 73 74 74 $this->load_dependencies(); -
releva-nz/trunk/public/class-relevatracking-public.php
r2721057 r2747414 209 209 $auth = isset($_GET['auth'])?$_GET['auth']:''; 210 210 $page = isset($_GET['page'])?$_GET['page']:0; 211 $limit = isset($_GET['limit'])?$_GET['limit']:500; 211 212 212 213 if( $auth != md5( $apikey.':'.$client_id ) ) … … 215 216 } 216 217 218 $args = array( 219 'status' => 'publish', 220 'limit' => -1, 221 'orderby' => 'id', 222 'order' => 'asc' 223 ); 224 225 /* 217 226 $args = array( 218 227 'post_status' => array('publish'), … … 223 232 'order' => 'asc', 224 233 ); 234 */ 235 225 236 if( $page > 0 ) 226 237 { 227 $args['posts_per_page'] = 2500; 228 $args['paged'] = $page; 229 } 230 231 $the_query = new WP_Query( $args ); 238 $args['limit'] = $limit; 239 $args['page'] = $page; 240 } 241 242 $products = wc_get_products( $args ); 243 232 244 // The Loop 233 245 $numProducts = 0; … … 243 255 fputcsv($op, $header, ',', '"'); 244 256 245 if( $the_query->have_posts() )246 {247 257 //while ( $the_query->have_posts() ) { 248 258 //$the_query->the_post(); 249 foreach ($ the_query->posts as $product_id) {250 259 foreach ($products as $p) { 260 $product_id = $p->id; 251 261 //$the_query->post->ID = $product_id 252 262 … … 294 304 } 295 305 296 297 }298 306 fclose($op); 299 307 … … 485 493 // FRONT PAGE Index page 486 494 public function retargeting_front_page() { 495 $user_id = get_current_user_id(); 496 487 497 // URL: https://pix.hyj.mobi/rt?t=d&action=s&cid=CLIENT_ID 488 498 if ( is_front_page() ) { 489 499 $this->url_js='https://pix.hyj.mobi/rt?t=d&action=s&cid='.$this->client_id; 500 if($user_id != 0) { 501 $this->url_js .= '&customer_id='.$user_id; 502 } 490 503 echo $this->render( 'front-page' ); 491 504 } … … 494 507 // CATEGORY PAGE 495 508 public function retargeting_category() { 509 $user_id = get_current_user_id(); 510 496 511 // URL: https://pix.hyj.mobi/rt?t=d&action=c&cid=CLIENT_ID&id=CATEGORY_ID 497 512 //echo "<pre>is_product_taxonomy"; var_export(is_product_taxonomy() ); echo "</pre>"; … … 503 518 $id = $cat->term_id; 504 519 $this->url_js='https://pix.hyj.mobi/rt?t=d&action=c&cid='.$this->client_id.'&id='.$id; 520 if($user_id != 0) { 521 $this->url_js .= '&customer_id='.$user_id; 522 } 505 523 echo $this->render( 'front-page' ); 506 524 } … … 510 528 // CATEGORY PAGE 511 529 public function retargeting_cart() { 530 $user_id = get_current_user_id(); 531 512 532 // URL: https://pix.hyj.mobi/rt?t=d&action=w&cid=CLIENT_ID 513 533 if (is_cart() ) { 514 534 $this->url_js='https://pix.hyj.mobi/rt?t=d&action=w&cid='.$this->client_id; 535 if($user_id != 0) { 536 $this->url_js .= '&customer_id='.$user_id; 537 } 515 538 echo $this->render( 'front-page' ); 516 539 } … … 519 542 // PRODUCT PAGE 520 543 public function retargeting_product() { 544 $user_id = get_current_user_id(); 545 521 546 //URL: https://pix.hyj.mobi/rt?t=d&action=p&cid=CLIENT_ID&id=PRODUCT_ID 522 547 if ( is_product() ) { … … 527 552 } 528 553 $this->url_js='https://pix.hyj.mobi/rt?t=d&action=p&cid='.$this->client_id.'&id='.$id; 554 if($user_id != 0) { 555 $this->url_js .= '&customer_id='.$user_id; 556 } 529 557 echo $this->render( 'front-page' ); 530 558 } … … 534 562 // Order Success page 535 563 public function retargeting_confirmation() { 564 $user_id = get_current_user_id(); 536 565 /* 537 566 URL: https://d.hyj.mobi/convNetw?cid=CLIENT_ID&orderId=ORDER_ID&amount=ORDER_TOTAL&eventName=ARTILE_ID1,ARTILE_ID2,ARTILE_ID3&network=relevanz … … 547 576 548 577 $this->url_js='https://d.hyj.mobi/convNetw?cid='.$this->client_id.'&orderId='.$this->order_id.'&amount='.$this->order_total.'&eventName='.$eventname.'&network=relevanz'; 578 if($user_id != 0) { 579 $this->url_js .= '&customer_id='.$user_id; 580 } 549 581 550 582 //echo "<pre>"; var_export($this->url_js); echo "</pre>"; … … 555 587 556 588 public function retargeting_other() { 589 $user_id = get_current_user_id(); 590 557 591 if(!is_front_page() && !(function_exists('is_product_category') && is_product_category()) && !is_product() && !is_order_received_page() && !is_cart()) { 558 592 $this->url_js='https://pix.hyj.mobi/rt?t=d&action=s&cid='.$this->client_id; 593 if($user_id != 0) { 594 $this->url_js .= '&customer_id='.$user_id; 595 } 559 596 echo $this->render( 'front-page' ); 560 597 } -
releva-nz/trunk/relevatracking.php
r2721057 r2747414 17 17 * Plugin URI: https://releva.nz 18 18 * Description: Technology for personalized advertising 19 * Version: 2.1. 119 * Version: 2.1.2 20 20 * Author: releva.nz 21 21 * License: GPL-2.0+
Note: See TracChangeset
for help on using the changeset viewer.