Dynamically change text on product page button

I have a product page where a button is added to open the mini cart through its settings (‘show button’ is ticked).
I want to dynamically change the text of the button based on a property set on the product shown. I can easily get the product by calling getProduct on the result of w$(‘#productPage1’), however, my issue is that the button seems to be locked because it’s part of the product page. As I see it, there are two ways this can be solved:

  1. I can change the text on the existing button dynamically. For this solution, I need help getting access to the built-in button on the product page
  2. The other solution would be to create a custom button that I can easily access, however, the editor does not seem to support custom buttons that open the mini cart. Therefore, I need help to programmatically open the mini cart.
1 Like

If it a button that comes already setup through Wix Stores app, then it is most likely that you won’t be able to interject it with code.

Have you seen CartIcon in the Wix API reference.
https://www.wix.com/corvid/reference/$w.CartIcon.html

Thank you for the reply! CartIcon might actually be just what I’m looking for.