Changeset 1534436
- Timestamp:
- 11/15/2016 04:15:35 PM (9 years ago)
- Location:
- cue-connect
- Files:
-
- 11 edited
- 2 copied
-
tags/1.0.7 (copied) (copied from cue-connect/trunk)
-
tags/1.0.7/cue-connect.php (modified) (2 diffs)
-
tags/1.0.7/inc/class.cue-api.php (modified) (2 diffs)
-
tags/1.0.7/inc/class.cue-sync.php (copied) (copied from cue-connect/trunk/inc/class.cue-sync.php) (3 diffs)
-
tags/1.0.7/inc/class.cue.php (modified) (10 diffs)
-
tags/1.0.7/readme.txt (modified) (2 diffs)
-
tags/1.0.7/templates/mylist.php (modified) (1 diff)
-
trunk/cue-connect.php (modified) (2 diffs)
-
trunk/inc/class.cue-api.php (modified) (2 diffs)
-
trunk/inc/class.cue-sync.php (modified) (3 diffs)
-
trunk/inc/class.cue.php (modified) (10 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates/mylist.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cue-connect/tags/1.0.7/cue-connect.php
r1488766 r1534436 4 4 * Plugin URI: https://wordpress.org/plugins/cue-connect 5 5 * Description: Meet Cue, your customers’ personal shopping assistant that feeds you actionable data. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: Cue Connect 8 8 * Author URI: https://business.cueconnect.com/ … … 28 28 define('CUE_PLUGIN_URL', plugin_dir_url(__FILE__)); 29 29 30 register_activation_hook(__FILE__, array(' cue', 'plugin_activate'));31 register_deactivation_hook(__FILE__, array(' cue', 'plugin_deactivate'));32 register_uninstall_hook(__FILE__, array(' cue', 'plugin_uninstall'));30 register_activation_hook(__FILE__, array('Cue', 'pluginActivate')); 31 register_deactivation_hook(__FILE__, array('Cue', 'pluginDeactivate')); 32 register_uninstall_hook(__FILE__, array('Cue', 'pluginUninstall')); 33 33 34 34 require_once CUE_PLUGIN_DIR . 'inc/class.cue-env.php'; -
cue-connect/tags/1.0.7/inc/class.cue-api.php
r1477180 r1534436 271 271 $queryString = '?' . http_build_query($params); 272 272 try { 273 $response = file_get_contents($url . $queryString); 273 $response_get = wp_remote_get($url . $queryString); 274 if (is_array($response_get)) { 275 $response = $response_get['body']; 276 } 274 277 } catch (Exception $e) { 275 278 // TODO: Log errors … … 279 282 } 280 283 } 281 282 /*283 <url>https://business.cueconnect.com/magento/saveCustomer</url>284 <url>https://business.cueconnect.com/magento/saveMark</url>285 <url>https://business.cueconnect.com/magento/priceChanged</url>286 <url>https://business.cueconnect.com/magento/selectVersion</url>287 */ -
cue-connect/tags/1.0.7/inc/class.cue-sync.php
r1531870 r1534436 156 156 * @return array products ready to be sent to cue app 157 157 */ 158 p rivatestatic function prepare_products($ids) {158 public static function prepare_products($ids) { 159 159 global $wpdb; 160 160 … … 182 182 $updated = array(); 183 183 foreach ($products as $product) { 184 185 $p = array();186 187 if (!$categories = wp_get_post_terms($product['sku'], 'product_cat', array( 'fields' => 'names'))) {188 $categories[0] = '';189 }190 184 191 185 $product['description'] = self::strip_tags_shortcodes($product['description']); … … 200 194 } 201 195 202 p rivatestatic function get_slices_from_array($data, $slice_size)196 public static function get_slices_from_array($data, $slice_size) 203 197 { 204 198 $slices = array(); -
cue-connect/tags/1.0.7/inc/class.cue.php
r1488888 r1534436 56 56 exit; 57 57 } 58 59 58 } 60 59 61 60 if (self::$_options['place_id'] && self::$_options['api_key']) { 62 // Add Cue product HTML meta tags63 add_action('wp_head', array($this, 'cueMeta'));64 61 65 62 // Add Cue frontend script … … 73 70 ); 74 71 72 add_action( 73 'woocommerce_proceed_to_checkout', 74 array($this, 'cartAddOB'), 75 0 76 ); 77 75 78 // Add converstion tracking code 76 79 add_action( … … 90 93 } 91 94 92 public static function plugin _activate()95 public static function pluginActivate() 93 96 { 94 97 // Requirements … … 105 108 * Executed when the plugin is deactivated 106 109 */ 107 public static function plugin_deactivate() { 110 public static function pluginDeactivate() 111 { 108 112 // Disable products synchronization cron 109 113 wp_clear_scheduled_hook('cue_sync_hook'); … … 120 124 * Executed when the plugin is uninstalled 121 125 */ 122 public static function plugin_uninstall() { 126 public static function pluginUninstall() 127 { 123 128 // Erase Cue settings 124 129 wp_clear_scheduled_hook('cue_sync_hook'); … … 174 179 } 175 180 176 // private function addSyncCron()177 // {178 // wp_clear_scheduled_hook('cue_sync_hook');179 // wp_schedule_event(time(), 'twicedaily', 'cue_sync_hook');180 // }181 182 181 public function mylistRewrite() 183 182 { … … 205 204 { 206 205 $reg_firstname = (!empty($_POST['reg_firstname']))?trim($_POST['reg_firstname']):''; 207 $reg_lastname = (!empty($_POST['reg_lastname'] ))?trim($_POST['reg_lastname']):'';206 $reg_lastname = (!empty($_POST['reg_lastname']))?trim($_POST['reg_lastname']):''; 208 207 ?> 209 208 210 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">211 <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label>212 <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>">213 </p>214 215 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">216 <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label>217 <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>">218 </p>209 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> 210 <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label> 211 <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>"> 212 </p> 213 214 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> 215 <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label> 216 <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>"> 217 </p> 219 218 220 219 <?php … … 240 239 ?> 241 240 242 <div class="cue-wrapper" style="margin: 1em 0">243 <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>244 <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>245 <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>246 </div>241 <div class="cue-wrapper" style="margin: 1em 0"> 242 <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 243 <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 244 <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 245 </div> 247 246 248 247 <?php 249 248 } 250 249 251 public function cueMeta() 252 { 253 global $post; 254 if (isset($post->post_type) && 'product' == $post->post_type && is_single()) { 255 $description = CueSync::strip_tags_shortcodes($post->post_content); 256 ?> 257 258 <!-- CUE META START --> 259 <meta property="og:url" content="<?php echo get_permalink($post->ID) ?>" /> 260 <meta property="og:title" content="<?php echo $post->post_title ?>" /> 261 <meta property="og:description" content="<?php echo $description ?>" /> 262 <meta property="og:image" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" /> 263 <meta property="og:type" content="website" /> 264 <meta name="cue:name" content="<?php echo $post->post_title ?>" /> 265 <meta name="cue:description" content="<?php echo $description ?>" /> 266 <meta name="cue:image_url" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" /> 267 <meta name="cue:sku" content="<?php echo $post->ID ?>" /> 268 <meta name="cue:url" content="<?php echo get_permalink($post->ID) ?>" /> 269 <meta name="cue:price" content="<?php echo get_post_meta($post->ID, '_price', true); ?>" /> 270 <!-- CUE META END --> 271 272 <?php 273 274 } 250 public function cartAddOB() 251 { 252 $items = array(); 253 254 global $woocommerce; 255 $items = $woocommerce->cart->get_cart(); 256 257 // bail if no items in cart 258 if (!count($items)) { 259 return; 260 } 261 262 $item = reset($items); 263 $imiSku = $item['data']->post->ID; 264 $cid = is_user_logged_in(); 265 266 ?> 267 268 <style>.cue-wrapper iframe{margin:0;padding:0;}.cue-wrapper>* {display:inline-block}</style> 269 270 <div class="cue-wrapper" style="margin:1em 0; clear:both;"> 271 <div class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 272 </div> 273 274 <?php 275 275 } 276 276 … … 296 296 /** 297 297 * Renders tracking pixel gif image. 298 * Url format: 298 * Url format: 299 299 * //api.cueconnect.com/imi/cart_track/json? 300 300 * api_key=XXX … … 343 343 return $url; 344 344 } 345 346 345 } -
cue-connect/tags/1.0.7/readme.txt
r1488760 r1534436 6 6 WC requires at least: 1.6 7 7 WC tested up to: 2.6.4 8 Stable tag: 1.0. 68 Stable tag: 1.0.7 9 9 License: GPLv3 or later License 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 93 93 == Changelog == 94 94 95 = 1.0.7 = 96 * Removed meta tags used for product syncronizations 97 * Updated css for My List page 98 95 99 = 1.0.6 = 96 100 * Updates to products syncronization process -
cue-connect/tags/1.0.7/templates/mylist.php
r1488760 r1534436 5 5 6 6 ?> 7 8 <style> 9 .cue-mylist-wrapper { 10 max-width: 1000px; 11 width:100%; 12 margin: 2em auto; 13 } 14 </style> 7 15 8 16 <div class="cue-mylist-wrapper"> -
cue-connect/trunk/cue-connect.php
r1488766 r1534436 4 4 * Plugin URI: https://wordpress.org/plugins/cue-connect 5 5 * Description: Meet Cue, your customers’ personal shopping assistant that feeds you actionable data. 6 * Version: 1.0. 66 * Version: 1.0.7 7 7 * Author: Cue Connect 8 8 * Author URI: https://business.cueconnect.com/ … … 28 28 define('CUE_PLUGIN_URL', plugin_dir_url(__FILE__)); 29 29 30 register_activation_hook(__FILE__, array(' cue', 'plugin_activate'));31 register_deactivation_hook(__FILE__, array(' cue', 'plugin_deactivate'));32 register_uninstall_hook(__FILE__, array(' cue', 'plugin_uninstall'));30 register_activation_hook(__FILE__, array('Cue', 'pluginActivate')); 31 register_deactivation_hook(__FILE__, array('Cue', 'pluginDeactivate')); 32 register_uninstall_hook(__FILE__, array('Cue', 'pluginUninstall')); 33 33 34 34 require_once CUE_PLUGIN_DIR . 'inc/class.cue-env.php'; -
cue-connect/trunk/inc/class.cue-api.php
r1477180 r1534436 271 271 $queryString = '?' . http_build_query($params); 272 272 try { 273 $response = file_get_contents($url . $queryString); 273 $response_get = wp_remote_get($url . $queryString); 274 if (is_array($response_get)) { 275 $response = $response_get['body']; 276 } 274 277 } catch (Exception $e) { 275 278 // TODO: Log errors … … 279 282 } 280 283 } 281 282 /*283 <url>https://business.cueconnect.com/magento/saveCustomer</url>284 <url>https://business.cueconnect.com/magento/saveMark</url>285 <url>https://business.cueconnect.com/magento/priceChanged</url>286 <url>https://business.cueconnect.com/magento/selectVersion</url>287 */ -
cue-connect/trunk/inc/class.cue-sync.php
r1531870 r1534436 156 156 * @return array products ready to be sent to cue app 157 157 */ 158 p rivatestatic function prepare_products($ids) {158 public static function prepare_products($ids) { 159 159 global $wpdb; 160 160 … … 182 182 $updated = array(); 183 183 foreach ($products as $product) { 184 185 $p = array();186 187 if (!$categories = wp_get_post_terms($product['sku'], 'product_cat', array( 'fields' => 'names'))) {188 $categories[0] = '';189 }190 184 191 185 $product['description'] = self::strip_tags_shortcodes($product['description']); … … 200 194 } 201 195 202 p rivatestatic function get_slices_from_array($data, $slice_size)196 public static function get_slices_from_array($data, $slice_size) 203 197 { 204 198 $slices = array(); -
cue-connect/trunk/inc/class.cue.php
r1488888 r1534436 56 56 exit; 57 57 } 58 59 58 } 60 59 61 60 if (self::$_options['place_id'] && self::$_options['api_key']) { 62 // Add Cue product HTML meta tags63 add_action('wp_head', array($this, 'cueMeta'));64 61 65 62 // Add Cue frontend script … … 73 70 ); 74 71 72 add_action( 73 'woocommerce_proceed_to_checkout', 74 array($this, 'cartAddOB'), 75 0 76 ); 77 75 78 // Add converstion tracking code 76 79 add_action( … … 90 93 } 91 94 92 public static function plugin _activate()95 public static function pluginActivate() 93 96 { 94 97 // Requirements … … 105 108 * Executed when the plugin is deactivated 106 109 */ 107 public static function plugin_deactivate() { 110 public static function pluginDeactivate() 111 { 108 112 // Disable products synchronization cron 109 113 wp_clear_scheduled_hook('cue_sync_hook'); … … 120 124 * Executed when the plugin is uninstalled 121 125 */ 122 public static function plugin_uninstall() { 126 public static function pluginUninstall() 127 { 123 128 // Erase Cue settings 124 129 wp_clear_scheduled_hook('cue_sync_hook'); … … 174 179 } 175 180 176 // private function addSyncCron()177 // {178 // wp_clear_scheduled_hook('cue_sync_hook');179 // wp_schedule_event(time(), 'twicedaily', 'cue_sync_hook');180 // }181 182 181 public function mylistRewrite() 183 182 { … … 205 204 { 206 205 $reg_firstname = (!empty($_POST['reg_firstname']))?trim($_POST['reg_firstname']):''; 207 $reg_lastname = (!empty($_POST['reg_lastname'] ))?trim($_POST['reg_lastname']):'';206 $reg_lastname = (!empty($_POST['reg_lastname']))?trim($_POST['reg_lastname']):''; 208 207 ?> 209 208 210 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">211 <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label>212 <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>">213 </p>214 215 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">216 <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label>217 <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>">218 </p>209 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> 210 <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label> 211 <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>"> 212 </p> 213 214 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide"> 215 <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label> 216 <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>"> 217 </p> 219 218 220 219 <?php … … 240 239 ?> 241 240 242 <div class="cue-wrapper" style="margin: 1em 0">243 <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>244 <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>245 <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>246 </div>241 <div class="cue-wrapper" style="margin: 1em 0"> 242 <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 243 <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 244 <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 245 </div> 247 246 248 247 <?php 249 248 } 250 249 251 public function cueMeta() 252 { 253 global $post; 254 if (isset($post->post_type) && 'product' == $post->post_type && is_single()) { 255 $description = CueSync::strip_tags_shortcodes($post->post_content); 256 ?> 257 258 <!-- CUE META START --> 259 <meta property="og:url" content="<?php echo get_permalink($post->ID) ?>" /> 260 <meta property="og:title" content="<?php echo $post->post_title ?>" /> 261 <meta property="og:description" content="<?php echo $description ?>" /> 262 <meta property="og:image" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" /> 263 <meta property="og:type" content="website" /> 264 <meta name="cue:name" content="<?php echo $post->post_title ?>" /> 265 <meta name="cue:description" content="<?php echo $description ?>" /> 266 <meta name="cue:image_url" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" /> 267 <meta name="cue:sku" content="<?php echo $post->ID ?>" /> 268 <meta name="cue:url" content="<?php echo get_permalink($post->ID) ?>" /> 269 <meta name="cue:price" content="<?php echo get_post_meta($post->ID, '_price', true); ?>" /> 270 <!-- CUE META END --> 271 272 <?php 273 274 } 250 public function cartAddOB() 251 { 252 $items = array(); 253 254 global $woocommerce; 255 $items = $woocommerce->cart->get_cart(); 256 257 // bail if no items in cart 258 if (!count($items)) { 259 return; 260 } 261 262 $item = reset($items); 263 $imiSku = $item['data']->post->ID; 264 $cid = is_user_logged_in(); 265 266 ?> 267 268 <style>.cue-wrapper iframe{margin:0;padding:0;}.cue-wrapper>* {display:inline-block}</style> 269 270 <div class="cue-wrapper" style="margin:1em 0; clear:both;"> 271 <div class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div> 272 </div> 273 274 <?php 275 275 } 276 276 … … 296 296 /** 297 297 * Renders tracking pixel gif image. 298 * Url format: 298 * Url format: 299 299 * //api.cueconnect.com/imi/cart_track/json? 300 300 * api_key=XXX … … 343 343 return $url; 344 344 } 345 346 345 } -
cue-connect/trunk/readme.txt
r1488760 r1534436 6 6 WC requires at least: 1.6 7 7 WC tested up to: 2.6.4 8 Stable tag: 1.0. 68 Stable tag: 1.0.7 9 9 License: GPLv3 or later License 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 93 93 == Changelog == 94 94 95 = 1.0.7 = 96 * Removed meta tags used for product syncronizations 97 * Updated css for My List page 98 95 99 = 1.0.6 = 96 100 * Updates to products syncronization process -
cue-connect/trunk/templates/mylist.php
r1488760 r1534436 5 5 6 6 ?> 7 8 <style> 9 .cue-mylist-wrapper { 10 max-width: 1000px; 11 width:100%; 12 margin: 2em auto; 13 } 14 </style> 7 15 8 16 <div class="cue-mylist-wrapper">
Note: See TracChangeset
for help on using the changeset viewer.