Despite using the correct element ID and being on a Wix Studio Product Page, I receive a 'getQuantity is not a function' error when attempting to call getQuantity() on the product page element

Question:
Why am I receiving a “getQuantity is not a function” error when trying to use the getQuantity()method on my Wix Studio Product Page element?

Product:
Wix Studio Editor - Product Page feature

What are you trying to achieve:
I am trying to retrieve the initial quantity of a product on a Wix Studio Product Page using the getQuantity() method. My goal is to dynamically update certain calculations on the page based on the quantity selected by the user.

What have you already tried:
I have verified that the element ID is correct and that I’m working on a Wix Studio Product Page. I’ve reviewed the documentation for getQuantity() and tested the method with a minimal code snippet. I also tried refreshing the editor and clearing the browser cache, but the error persists.

Additional information:
The getQuantity() method appears as an available method in the editor when I type $w("#myProductPage").getQuantity(). Despite this, I continue to receive a “getQuantity is not a function” error when running the code. I would appreciate any guidance on why this might be happening or if there are additional setup steps I may have missed.