Skip to content
Learnomy
Get Learnomy Pro

Wishlist

How to Save Courses to a Wishlist in Learnomy1:52Chapters and transcript

The wishlist lets a logged-in learner save courses for later with a single heart button, then find them again from a Wishlist item in My Account. It is a lightweight "come back to this" list, separate from enrollment.

What you can do#

  • Save any course for later by clicking the heart button on its course card.
  • Remove a course from your wishlist by clicking the same heart again -- it toggles.
  • Reach everything you saved from the Wishlist item in the My Account menu.
  • See the heart update instantly, with the change saved to your account so it persists across devices and sessions.

How to use it#

Step 1 -- log in#

The heart button only does something for logged-in users, since a wishlist belongs to an account.

Step 2 -- click the heart on a course card#

Each course card has a heart button, and so does the course page. Click it to add the course to your wishlist; the heart fills in and a short message confirms "Saved to your Wishlist" with a View link that opens your Wishlist. Click the heart again to remove the course; the message reads "Removed from your Wishlist".

Step 3 -- open your wishlist#

In My Account, open the Wishlist item to see the courses you have saved. From there you can go to any course to enroll or buy when you are ready.

Settings and options#

  • Logged-in only. The heart toggle acts on the current user's account. The assets that power it load only where they are needed and only for logged-in users.
  • Where the Wishlist lives. The Wishlist is a My Account menu item that deep-links to the wishlist tab of your Courses page.
  • Persistence. Your wishlist is stored on your account, so it is the same on any browser or device where you are logged in.
  • Accessible labels. The heart button carries an accessible label that switches between "Add to wishlist" and "Remove from wishlist" and reflects its pressed state.

For developers#

REST API (namespace learnomy/v1, logged-in user):

  • POST /courses/{id}/wishlist -- add a course to the current user's wishlist.
  • DELETE /courses/{id}/wishlist -- remove a course from the wishlist.
  • GET /wishlist -- the current user's wishlisted course IDs.

Data and helpers:

  • Stored in the learnomy_wishlist user-meta. Read it through \Learnomy\wishlist_ids( $user_id ), the single tolerant reader (do not decode the meta directly).
  • \Learnomy\wishlist_url() returns the address of the Wishlist, for a link in your own menu or template. The learnomy_wishlist_url filter changes it; the account menu and the confirmation message both use it.

Frontend:

  • The heart button uses the Interactivity API store learnomy/wishlist (assets/js/wishlist-view.js). Localised labels can be supplied via window.lrnWishlistI18n or per-button data-i18n-add / data-i18n-remove attributes.