Changeset 1977618
- Timestamp:
- 11/20/2018 07:10:26 PM (7 years ago)
- Location:
- storespot
- Files:
-
- 12 edited
- 1 copied
-
tags/1.0.9 (copied) (copied from storespot/trunk)
-
tags/1.0.9/admin/class-storespot-productfeed.php (modified) (1 diff)
-
tags/1.0.9/includes/class-storespot-deactivator.php (modified) (1 diff)
-
tags/1.0.9/includes/class-storespot.php (modified) (1 diff)
-
tags/1.0.9/public/class-storespot-events.php (modified) (2 diffs)
-
tags/1.0.9/readme.txt (modified) (2 diffs)
-
tags/1.0.9/storespot.php (modified) (2 diffs)
-
trunk/admin/class-storespot-productfeed.php (modified) (1 diff)
-
trunk/includes/class-storespot-deactivator.php (modified) (1 diff)
-
trunk/includes/class-storespot.php (modified) (1 diff)
-
trunk/public/class-storespot-events.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/storespot.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
storespot/tags/1.0.9/admin/class-storespot-productfeed.php
r1969746 r1977618 107 107 if ( function_exists( 'wc_get_products' ) ) { 108 108 $args = array( 109 'status' => 'publish',110 109 'status' => array( 'publish' ), 111 110 'type' => array( 'simple', 'variable', 'bundle', 'composite' ), -
storespot/tags/1.0.9/includes/class-storespot-deactivator.php
r1939129 r1977618 3 3 public static function deactivate() { 4 4 wp_clear_scheduled_hook( 'stsp_product_feed_update' ); 5 delete_option( 'storespot_settings' ); 5 6 } 6 7 } -
storespot/tags/1.0.9/includes/class-storespot.php
r1969706 r1977618 78 78 $this->loader->add_action( 'wp_head', $plugin_public, 'render_facebook_pixel_noscript' ); 79 79 $this->loader->add_action( 'woocommerce_after_single_product', $plugin_public, 'render_product_view_event'); 80 $this->loader->add_action( 'woocommerce_after_shop_loop', $plugin_public, 'render_category_view_event'); 80 81 $this->loader->add_action( 'pre_get_posts', $plugin_public, 'render_search_event' ); 81 82 $this->loader->add_action( 'woocommerce_add_to_cart', $plugin_public, 'render_add_to_cart_event' ); -
storespot/tags/1.0.9/public/class-storespot-events.php
r1957373 r1977618 19 19 $product_id = $product->get_id(); 20 20 $product_sku = $product->get_sku(); 21 return $product_sku ? $product_sku . '_' . $product_id : 'wc_post_id_' . $product_id; 21 $sku_id = $product_sku . '_' . $product_id; 22 $other_id = 'wc_post_id_' . $product_id; 23 24 $ids = array($other_id, $product_id); 25 if ( $product_sku ) { 26 $ids[] = $sku_id; 27 $ids[] = $product_sku; 28 } 29 30 return $ids; 22 31 } 23 32 … … 38 47 return; 39 48 } 49 } 50 51 public function render_category_view_event() { 52 global $wp_query; 53 54 $products = array_values(array_map(function($item) { 55 return wc_get_product($item->ID); 56 }, $wp_query->posts)); 57 58 $content_type = 'product'; 59 $product_ids = array(); 60 foreach ($products as $product) { 61 if (!$product) { continue; } 62 $product_ids = array_merge( 63 $product_ids, 64 $this->get_facebook_content_id($product) 65 ); 66 if ($product->get_type() == 'variable') { 67 $content_type = 'product_group'; 68 } 69 } 70 71 $category_path = wp_get_post_terms( get_the_ID(), 'product_cat' ); 72 $content_category = array_values( array_map( function($item) { 73 return $item->name; 74 }, $category_path)); 75 $content_category_slice = array_slice($content_category, -1); 76 $categories = empty( $content_category ) ? '""' : implode( ', ', $content_category ); 77 $categories = array( 78 'name' => array_pop($content_category_slice), 79 'categories' => $categories 80 ); 81 82 $params = array( 83 'content_name' => $categories['name'], 84 'content_category' => $categories['categories'], 85 'content_ids' => json_encode(array_slice($product_ids, 0, 10)), 86 'content_type' => $content_type 87 ); 88 89 $this->facebook_pixel->event_code( 90 'ViewCategory', 91 $params, 92 'trackCustom' 93 ); 40 94 } 41 95 -
storespot/tags/1.0.9/readme.txt
r1969706 r1977618 5 5 Tested up to: 4.9 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 52 = 1.0.9 = 53 * Add category view to pixel data 54 * Remove options after plugin deactivation 55 52 56 = 1.0.8 = 53 57 * Improve memory usage in feed generation -
storespot/tags/1.0.9/storespot.php
r1969706 r1977618 4 4 * Plugin URI: https://storespot.io/ 5 5 * Description: Stop leaving money on the table. Automate your retargeting ads with StoreSpot. 6 * Version: 1.0. 86 * Version: 1.0.9 7 7 * Author: StoreSpot 8 8 **/ … … 11 11 if ( ! defined( 'WPINC' ) ) { die; } 12 12 13 define( 'STORESPOT_VERSION', '1.0. 8' );13 define( 'STORESPOT_VERSION', '1.0.9' ); 14 14 15 15 function activate_storespot() { -
storespot/trunk/admin/class-storespot-productfeed.php
r1969746 r1977618 107 107 if ( function_exists( 'wc_get_products' ) ) { 108 108 $args = array( 109 'status' => 'publish',110 109 'status' => array( 'publish' ), 111 110 'type' => array( 'simple', 'variable', 'bundle', 'composite' ), -
storespot/trunk/includes/class-storespot-deactivator.php
r1939129 r1977618 3 3 public static function deactivate() { 4 4 wp_clear_scheduled_hook( 'stsp_product_feed_update' ); 5 delete_option( 'storespot_settings' ); 5 6 } 6 7 } -
storespot/trunk/includes/class-storespot.php
r1969706 r1977618 78 78 $this->loader->add_action( 'wp_head', $plugin_public, 'render_facebook_pixel_noscript' ); 79 79 $this->loader->add_action( 'woocommerce_after_single_product', $plugin_public, 'render_product_view_event'); 80 $this->loader->add_action( 'woocommerce_after_shop_loop', $plugin_public, 'render_category_view_event'); 80 81 $this->loader->add_action( 'pre_get_posts', $plugin_public, 'render_search_event' ); 81 82 $this->loader->add_action( 'woocommerce_add_to_cart', $plugin_public, 'render_add_to_cart_event' ); -
storespot/trunk/public/class-storespot-events.php
r1957373 r1977618 19 19 $product_id = $product->get_id(); 20 20 $product_sku = $product->get_sku(); 21 return $product_sku ? $product_sku . '_' . $product_id : 'wc_post_id_' . $product_id; 21 $sku_id = $product_sku . '_' . $product_id; 22 $other_id = 'wc_post_id_' . $product_id; 23 24 $ids = array($other_id, $product_id); 25 if ( $product_sku ) { 26 $ids[] = $sku_id; 27 $ids[] = $product_sku; 28 } 29 30 return $ids; 22 31 } 23 32 … … 38 47 return; 39 48 } 49 } 50 51 public function render_category_view_event() { 52 global $wp_query; 53 54 $products = array_values(array_map(function($item) { 55 return wc_get_product($item->ID); 56 }, $wp_query->posts)); 57 58 $content_type = 'product'; 59 $product_ids = array(); 60 foreach ($products as $product) { 61 if (!$product) { continue; } 62 $product_ids = array_merge( 63 $product_ids, 64 $this->get_facebook_content_id($product) 65 ); 66 if ($product->get_type() == 'variable') { 67 $content_type = 'product_group'; 68 } 69 } 70 71 $category_path = wp_get_post_terms( get_the_ID(), 'product_cat' ); 72 $content_category = array_values( array_map( function($item) { 73 return $item->name; 74 }, $category_path)); 75 $content_category_slice = array_slice($content_category, -1); 76 $categories = empty( $content_category ) ? '""' : implode( ', ', $content_category ); 77 $categories = array( 78 'name' => array_pop($content_category_slice), 79 'categories' => $categories 80 ); 81 82 $params = array( 83 'content_name' => $categories['name'], 84 'content_category' => $categories['categories'], 85 'content_ids' => json_encode(array_slice($product_ids, 0, 10)), 86 'content_type' => $content_type 87 ); 88 89 $this->facebook_pixel->event_code( 90 'ViewCategory', 91 $params, 92 'trackCustom' 93 ); 40 94 } 41 95 -
storespot/trunk/readme.txt
r1969706 r1977618 5 5 Tested up to: 4.9 6 6 Requires PHP: 5.6 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 52 = 1.0.9 = 53 * Add category view to pixel data 54 * Remove options after plugin deactivation 55 52 56 = 1.0.8 = 53 57 * Improve memory usage in feed generation -
storespot/trunk/storespot.php
r1969706 r1977618 4 4 * Plugin URI: https://storespot.io/ 5 5 * Description: Stop leaving money on the table. Automate your retargeting ads with StoreSpot. 6 * Version: 1.0. 86 * Version: 1.0.9 7 7 * Author: StoreSpot 8 8 **/ … … 11 11 if ( ! defined( 'WPINC' ) ) { die; } 12 12 13 define( 'STORESPOT_VERSION', '1.0. 8' );13 define( 'STORESPOT_VERSION', '1.0.9' ); 14 14 15 15 function activate_storespot() {
Note: See TracChangeset
for help on using the changeset viewer.