system/modules/Ecommerce/models/Item.php 1 location
                
                
                    
                                                
                                                    
                                 | 
                                
                                    @@ 411-414 (lines=4) @@
                                 | 
                            
                                                            
                                    | 408 | 
                                     | 
                                            if (\Users\User::$cur->id) { | 
                                
                                                            
                                    | 409 | 
                                     | 
                                                $fav = \Ecommerce\Favorite::get([['user_id', \Users\User::$cur->id], ['item_id', $this->id]]);  | 
                                
                                                            
                                    | 410 | 
                                     | 
                                                return (bool) $fav;  | 
                                
                                                            
                                    | 411 | 
                                     | 
                                            } else { | 
                                
                                                            
                                    | 412 | 
                                     | 
                                                $favs = !empty($_COOKIE['ecommerce_favitems']) ? json_decode($_COOKIE['ecommerce_favitems'], true) : [];  | 
                                
                                                            
                                    | 413 | 
                                     | 
                                                return in_array($this->id, $favs);  | 
                                
                                                            
                                    | 414 | 
                                     | 
                                            }  | 
                                
                                                            
                                    | 415 | 
                                     | 
                                        }  | 
                                
                                                            
                                    | 416 | 
                                     | 
                                    }  | 
                                
                                                                        
                 
                                                            
                    
system/modules/Ecommerce/Ecommerce.php 1 location
                
                
                    
                                                
                                                    
                                 | 
                                
                                    @@ 463-466 (lines=4) @@
                                 | 
                            
                                                            
                                    | 460 | 
                                     | 
                                        public function getFavoriteCount() { | 
                                
                                                            
                                    | 461 | 
                                     | 
                                            if (Users\User::$cur->id) { | 
                                
                                                            
                                    | 462 | 
                                     | 
                                                return \Ecommerce\Favorite::getCount(['user_id', Users\User::$cur->id]);  | 
                                
                                                            
                                    | 463 | 
                                     | 
                                            } else { | 
                                
                                                            
                                    | 464 | 
                                     | 
                                                $favs = !empty($_COOKIE['ecommerce_favitems']) ? json_decode($_COOKIE['ecommerce_favitems'], true) : [];  | 
                                
                                                            
                                    | 465 | 
                                     | 
                                                return count($favs);  | 
                                
                                                            
                                    | 466 | 
                                     | 
                                            }  | 
                                
                                                            
                                    | 467 | 
                                     | 
                                        }  | 
                                
                                                            
                                    | 468 | 
                                     | 
                                     | 
                                
                                                            
                                    | 469 | 
                                     | 
                                        public function siteSearch($search) { |