Changeset 2747697
- Timestamp:
- 06/24/2022 04:33:50 PM (4 years ago)
- Location:
- shinystat-analytics/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (3 diffs)
-
includes/class-shinystat-analytics.php (modified) (1 diff)
-
public/class-shinystat-analytics-public.php (modified) (7 diffs)
-
shinystat-analytics.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shinystat-analytics/trunk/README.txt
r2719488 r2747697 5 5 Requires at least: 3.1.0 6 6 Tested up to: 6.0 7 Stable tag: 1.0. 87 Stable tag: 1.0.9 8 8 Requires PHP: 5.6 or higher 9 9 License: GPLv2 or later … … 55 55 == Changelog == 56 56 57 = 1.0.9 = 58 * Update timestamp in shn_engage.cart_content when add-to-cart is done by entire page refresh (not by ajax request wc-add-to-cart). 59 57 60 = 1.0.8 = 58 61 * Fix timestamp update when cart is empty in get_cart_content js function … … 89 92 90 93 == Upgrade Notice == 94 95 = 1.0.9 = 96 * Update timestamp in shn_engage.cart_content when add-to-cart is done by page refresh. 91 97 92 98 = 1.0.8 = -
shinystat-analytics/trunk/includes/class-shinystat-analytics.php
r2647715 r2747697 70 70 $this->version = SHINYSTAT_ANALYTICS_VERSION; 71 71 } else { 72 $this->version = '1.0. 8';72 $this->version = '1.0.9'; 73 73 } 74 74 $this->plugin_name = 'shinystat-analytics'; -
shinystat-analytics/trunk/public/class-shinystat-analytics-public.php
r2647730 r2747697 204 204 } 205 205 206 /** 207 * Check if the request contains POST attributes to add items in the cart. 208 * 209 * @since 1.0.9 210 */ 211 private function is_post_add_to_cart( ) { 212 global $_POST; 213 214 if ( isset($_POST["add-to-cart"]) && is_numeric($_POST["quantity"]) ) 215 return True; 216 217 return False; 218 } 206 219 207 220 /** … … 219 232 $session_existing = WC()->cart && WC()->session && WC()->session->has_session(); 220 233 $user_logged = is_user_logged_in() || is_admin(); 234 $update_cart_timestamp = $this->is_post_add_to_cart(); 221 235 222 236 ?> … … 229 243 230 244 cart_content: {}, 231 232 245 233 246 /** … … 260 273 typeof(shn_engage.cart_content.item_count) !== "undefined" && 261 274 shn_engage.cart_content.item_count != cart_content.item_count) { 262 263 var t = Math.floor(new Date().getTime() / 1000);264 275 265 cart_content.cart_update_ts = t + ""; 266 localStorage.setItem("cart_update_ts", t); 276 cart_content.cart_update_ts = shn_engage.update_timestamp() + ""; 267 277 } 268 278 … … 270 280 271 281 }, 282 283 /** 284 * Set local storage cart_update_ts with current timestamp 285 */ 286 update_timestamp: function() { 287 288 var t = Math.floor(new Date().getTime() / 1000); 289 localStorage.setItem("cart_update_ts", t); 290 291 return t; 292 }, 272 293 273 294 /** … … 404 425 405 426 } 427 428 <?php if ($update_cart_timestamp) { 429 ?> shn_engage.update_timestamp(); 430 <?php } 431 ?> 406 432 407 433 //set shn_engage object returning selected methods … … 424 450 head[0].append(s); 425 451 } 452 426 453 })(); 427 454 -
shinystat-analytics/trunk/shinystat-analytics.php
r2647715 r2747697 17 17 * Plugin URI: https://wordpress.org/plugins/shinystat-analytics/ 18 18 * Description: Activate the plugin and start to use ShinyStat Web Analytics and On-site Marketing Automation tools. 19 * Version: 1.0. 819 * Version: 1.0.9 20 20 * Author: ShinyStat 21 21 * Author URI: https://www.shinystat.com … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'SHINYSTAT_ANALYTICS_VERSION', '1.0. 8' );38 define( 'SHINYSTAT_ANALYTICS_VERSION', '1.0.9' ); 39 39 40 40 /**
Note: See TracChangeset
for help on using the changeset viewer.