The problem
I can’t get a reference to a button inside the Wix standard “Product Page”. A call for $w(“Button”) on the standard Product Page will return empty instead of returning a reference to the “Add to Cart” button on the standard Wix Product Page.
The reason
Locking out the standard widgets/pages from further customization using the current API fails Wix’s own objective of making it easier and faster to create a website. I want to use Wix because it makes it faster to create pages. But if instead I will have to create a custom Product Page from the ground up just because I can’t add an event listener to the “Add to Cart” button, that defeats the entire objective of using Wix.
Suggestion
At a minimum, allow for the $w() function to grab a reference to the objects within the standard pages/widgets. Then, allow the user to modify the event listeners related to these objects.
Use cases
I have two use cases in mind:
- Once my customer adds a product to the cart from the standard Wix Product Page by pressing the “Add to Cart” button, the product is added to the cart and then a lightbox opens where the customer can select to add an additional product related to the product he just added to the cart.
- When using the Product Gallery widget, when the customer clicks on a product, instead of redirecting to the standard Wix Product Page, I would like to redirect it to another custom product page depending on the type of product.