Uncategorized

Wishlist Code (Part 1, Dec. 2017)

Tutorial Video Code Queen Nayeli walks you step by step on how to create a Wish List using Wix Code on your Wix website. Wix Code is...

Tutorial Video

Code Queen Nayeli walks you step by step on how to create a Wish List using Wix Code on your Wix website. Wix Code is now available on ALL Wix accounts!

Follow Along #1

Tutorial Page

Good to Know #1

The Code

Be sure to watch the tutorial video above to understand the code and how to modify it.


import wixUsers from 'wix-users';
import wixData from 'wix-data';
$w.onReady( () => {
 if(wixUsers.currentUser.loggedIn) {
    $w("#addtowishlist").label = "ADD TO WISH LIST";
  }
 else {
    $w("#addtowishlist").label = "SIGN IN TO SAVE";
  }
} );
export function addtowishlist_onclick() {
    wixData.insert('wishlist', 
    {wishlist_item: $w('#Itemdetails').getCurrentItem()._id}),
    $w('#success').show(),  //These are extra lines in case you have buttons or other
    $w('#addtowishlist').hide(),  //These are extra lines in case you have buttons or other
    $w('#viewlist').show();  //These are extra lines in case you have buttons or other
}

Author

by Code Queen

Corvid , Wix Design, Project Planning, Private Tutoring

Services world wide

Stuck on a project? Hire Code Queen, LLC!

Schedule a phone call or video call directly online. In a different time zone? No problem! Code Queen currently has clients around the world.

Share this post

Loading...