Log in
Model

Wishlist

Magento\Wishlist\Model\Wishlist

What it does

This is the core Wishlist model that manages a customer's wishlist in Magento 2.

Developers use this class to create, load, and manipulate wishlists, add/update products, manage wishlist items, and handle wishlist sharing functionality.

It serves as the main business logic layer for all wishlist operations including customer ownership verification, item collection management, and product availability checks.

Public Methods

  • loadByCustomerId()
  • getName()
  • generateSharingCode()
  • loadByCode()
  • beforeSave()
  • afterSave()
  • getItemCollection()
  • getItem()
  • addItem()
  • addNewItem()
  • setCustomerId()
  • getCustomerId()
  • getDataForSave()
  • getSharedStoreIds()
  • setSharedStoreIds()
  • getStore()
  • setStore()
  • getItemsCount()
  • isSalable()
  • isOwner()
  • updateItem()
  • getIdentities()