Skip to content
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

Open
ChrisPlaneta opened this issue Nov 28, 2023 · 4 comments
Open

Cart block feedback #42051

ChrisPlaneta opened this issue Nov 28, 2023 · 4 comments
Labels
team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: community contribution

Comments

@ChrisPlaneta
Copy link

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.

@ralucaStan ralucaStan added the team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues label Nov 30, 2023
@senadir
Copy link
Member

senadir commented Dec 1, 2023

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.

@ChrisPlaneta
Copy link
Author

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.

@senadir
Copy link
Member

senadir commented Dec 1, 2023

@ChrisPlaneta
Copy link
Author

Thank you very much. This is what I needed :)

@ObliviousHarmony ObliviousHarmony transferred this issue from woocommerce/woocommerce-blocks Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: community contribution
Projects
None yet
Development

No branches or pull requests

3 participants