Hello, I know that Wix Store is now working with wix code. I am hoping to change the visibility of my store’s prices using wix code. Previously my store was set to hide prices on the products gallery and only a member could access the store product pages to view the prices and make purchases. The problem with this is I had to turn off the products quick view because the price was visible there without being logged in. I would also like the prices to be visible on the product galleries to members that are logged in and not only visible on the product pages.
I started the code as follows but I’m really unsure of how to code the price to show or hide:
import wixUsers from ‘wix-users’;
import wixStores from ‘wix-stores-backend’;
$w.onReady(() => {
if (wixUsers.currentUser.loggedIn) { (From below********** I know it is wrong)
wixStores.price.show(“price”);
} else {
wiStores.price.hide(“price”);
}
} );
Any advice on how to correct the code to show/hide price in the product galleries based on a member being logged in or not would be much appreciated. Also should I add this code to each individual store page that is displaying a collection or should I add it once to the site? Thank you!