Inheritance: extends Mage2\Framework\System\Models\BaseModel
Ejemplo n.º 1
0
 public function isInWishlist($productId)
 {
     $wishList = Wishlist::where('website_id', '=', $this->websiteId)->where('user_id', '=', $this->attributes['id'])->where('product_id', '=', $productId)->get();
     if (count($wishList) <= 0) {
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 public function remove($slug)
 {
     $id = $this->_getProductIdBySlug($slug);
     Wishlist::where(['user_id' => Auth::user()->id, 'website_id' => $this->websiteId, 'product_id' => $id])->delete();
     return redirect()->back()->with('notificationText', "Product Removed from your Wishlist Successfully!!");
 }