Answer the question
In order to leave comments, you need to log in
How to display cross-sells through the Woocommerce loop?
Hello, I need to display crossels on the cart page. Tell me how can I do this through a loop in order to display the structure that I need?)
Thanks in advance
Answer the question
In order to leave comments, you need to log in
1. Connect to the hook of the place where you want to display
2. Run through the contents of the cart and collect the IDs of the added products
3. Make an arbitrary request to the database and create a custom output loop. You can read it in the codex or here
4. Output your html
This is the standard functionality. If cross-sells for products are specified, they are displayed automatically. Output by functionwoocommerce_cross_sell_display
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question