I realize that the commerce api is always returnin...
# ask-stanley-ai
m
I realize that the commerce api is always returning the price of the item. I know all items to be displayed in the web store are public, but I would like to remove the price when the user is not logged in. I can do it in the configuration record by in the inspect, the price is always there. Could you give a good solution for this ?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you can control the display of the price on the web store by manipulating the price level field in the form. One way to do this is to set the price level to 'Custom' via a script. In a Client Script, you would set the fieldId
price
to
-1
('Custom') in the fieldChanged entry point for field === 'item'. Another way is to hide the price level field in the form. This is a low-tech solution but it might work for your needs. However, please note that these solutions might not completely remove the price from the inspect element as the price is still there, just not displayed. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806396365
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805419922
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.803222716
Please provide your feedback on this answer.