-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cart block feedback #42051
Comments
Hey @ChrisPlaneta ! When it comes to events, the cross sell block uses the same inner blocks as All Products block, so it will trigger similar events, for example, you can subscribe to this add to cart action in the Cart block, Cross sell would be the only block triggring that. wp.hooks.addAction(
"experimental__woocommerce_blocks-cart-add-item",
"test-plugin",
({product}) => {
console.log("add-item-from-cross-sell", product);
}
); I agree that we should consider adding more classes to those divs, or enhance the experience, we have an open project collecting feedback to the cross sell block and I will add that to it. |
Hi Senadir. Thank you for the information. I will chaeck that function if it does what I need. But in the meantime, can you point me where I can find all the JS events that I can hook up to? I tried the "classic" ones but they are hit or miss. I couldn't find documentation with any new events though. I would greatly appreciate it. |
This is the list, it's not currently well documented beyond this list |
Thank you very much. This is what I needed :) |
What do you think is missing from the Cart & Checkout blocks?
There is no way to track what products are added to cart from the cross-sell list under the cart. There are no product IDs that can tracked and no way to hook up custom HTML with product data to the product items. Even the div that wraps the cross sell grid, is unnamed - no ID nor class.
The text was updated successfully, but these errors were encountered: