• Resolved mrwweb

    (@mrwweb)


    I would like to show cross-sell products in the mini-cart’s slideout drawer. This doesn’t appear to be working.

    I have created a cross-sell between two products and I can tell that it works because it correctly shows up on the /cart/ page:

    Cart block displays the expected cross-sell product below the cart contents.

    However, our store is primarily built to use the new mini-cart block and it’s slide-out drawer. We’ve added both(?) Cross-sell blocks to the cart (woocommerce/cart-cross-sells-block and woocommerce/cart-cross-sells-products-block), and neither appears to work with the same cart contents:

    The mini-cart’s slideout drawer is empty with the same product in it. There is a “You may be interested in…” line at the bottom of the mini cart but no products below it.
    The mini-cart’s block list view shows two different blocks for cross sells in it: “Cart Cross-Sells” and “Cross-Sells”.

    We have a custom hybrid theme where the mini-cart block is added in a template part. However, these screenshots were taken with the Twenty Twenty Five theme active and all plugins deactivated.

    I believe I have correctly configured the cross-sells block in the cart and here is that block markup:

    <!-- wp:woocommerce/product-collection {"queryId":2,"query":{"perPage":1,"pages":1,"offset":0,"postType":"product","order":"asc","orderBy":"title","search":"","exclude":[],"inherit":false,"taxQuery":[],"isProductCollectionBlock":true,"featured":false,"woocommerceOnSale":false,"woocommerceStockStatus":["instock"],"woocommerceAttributes":[],"woocommerceHandPickedProducts":[],"filterable":false,"relatedBy":{"categories":true,"tags":true}},"tagName":"div","displayLayout":{"type":"list","columns":4,"shrinkColumns":true},"dimensions":{"widthType":"fill"},"collection":"woocommerce/product-collection/cross-sells","hideControls":["inherit","filterable"],"queryContextIncludes":["collection"],"__privatePreviewState":{"isPreview":true,"previewMessage":"Actual products will vary depending on the page being viewed."}} -->
    <div class="wp-block-woocommerce-product-collection"><!-- wp:heading {"textAlign":"center","style":{"spacing":{"margin":{"bottom":"1rem"}}}} -->
    <h2 class="wp-block-heading has-text-align-center" style="margin-bottom:1rem">You may be interested in…</h2>
    <!-- /wp:heading -->

    <!-- wp:woocommerce/product-template -->
    <!-- wp:woocommerce/product-image {"imageSizing":"thumbnail","isDescendentOfQueryLoop":true} /-->

    <!-- wp:post-title {"textAlign":"center","level":3,"isLink":true,"style":{"spacing":{"margin":{"bottom":"0.75rem","top":"0"}}},"fontSize":"medium","__woocommerceNamespace":"woocommerce/product-collection/product-title"} /-->

    <!-- wp:woocommerce/product-price {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small"} /-->

    <!-- wp:woocommerce/product-button {"textAlign":"center","isDescendentOfQueryLoop":true,"fontSize":"small"} /-->
    <!-- /wp:woocommerce/product-template --></div>
    <!-- /wp:woocommerce/product-collection -->

    And here’s my site details report from my local site while testing with Twenty Twenty Five and most plugins turned off. (it’s also not working anywhere else):

    <details><summary>System Status Report</summary>

    <br><br>### WordPress Environment ###<br><br>WordPress address (URL): [Redacted]<br><br>Site address (URL): [Redacted]<br><br>WC Version: 9.5.1<br><br>Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.<br><br>Action Scheduler Version: ? 3.8.2<br><br>Log Directory Writable: ?<br><br>WP Version: 6.7.1<br><br>WP Multisite: –<br><br>WP Memory Limit: 256 MB<br><br>WP Debug Mode: ?<br><br>WP Cron: ?<br><br>Language: en_US<br><br>External object cache: –<br><br>### Server Environment ###<br><br>Server Info: nginx/1.26.1<br><br>PHP Version: 8.1.29<br><br>PHP Post Max Size: 1,000 MB<br><br>PHP Time Limit: 1200<br><br>PHP Max Input Vars: 4000<br><br>cURL Version: 8.4.0<br><br>OpenSSL/1.1.1w<br><br>SUHOSIN Installed: –<br><br>MySQL Version: 8.0.16<br><br>Max Upload Size: 300 MB<br><br>Default Timezone is UTC: ?<br><br>fsockopen/cURL: ?<br><br>SoapClient: ?<br><br>DOMDocument: ?<br><br>GZip: ?<br><br>Multibyte String: ?<br><br>Remote Post: ?<br><br>Remote Get: ?<br><br>### Database ###<br><br>[REDACTED]<br><br>### Post Type Counts ###<br><br>acf-field: 1<br><br>acf-field-group: 1<br><br>amn_mi-lite: 2<br><br>attachment: 866<br><br>certifications: 6<br><br>courses: 8<br><br>customize_changeset: 1<br><br>custom_css: 2<br><br>flamingo_contact: 13<br><br>fmemailverification: 1<br><br>iwp_log: 1201<br><br>jetpack_migration: 2<br><br>kr_access_token: 1<br><br>nav_menu_item: 69<br><br>nf_sub: 464<br><br>oembed_cache: 8<br><br>page: 79<br><br>post: 208<br><br>ppmacf_field: 5<br><br>ppma_boxes: 6<br><br>product: 16<br><br>revision: 8<br><br>shop_coupon: 1<br><br>shop_order_placehold: 5<br><br>tec_tc_attendee: 78<br><br>tec_tc_order: 119<br><br>tec_tc_ticket: 7<br><br>ticket-meta-fieldset: 9<br><br>tribe_events: 593<br><br>tribe_organizer: 13<br><br>tribe_rsvp_attendees: 10056<br><br>tribe_rsvp_tickets: 102<br><br>tribe_venue: 30<br><br>wp-help: 5<br><br>wp_block: 5<br><br>wp_font_face: 36<br><br>wp_font_family: 12<br><br>wp_global_styles: 4<br><br>wp_navigation: 6<br><br>wp_template_part: 3<br><br>### Security ###<br><br>Secure connection (HTTPS): ?<br><br>Hide errors from visitors: ?<br><br>### Active Plugins (4) ###<br><br>WooCommerce Stripe Gateway: by Stripe – 9.0.0<br><br>WooCommerce: by Automattic – 9.5.1 (update to version 9.6.0 is available)<br><br>### Inactive Plugins (41) ###<br><br>ACF Input Counter: by John A. Huebner II – 1.5<br><br>Advanced Custom Fields PRO: by WP Engine – 6.3.11<br><br>Ajax add to cart for WooCommerce: by QuadLayers – 2.4.4<br><br>BE Media from Production: by CultivateWP – 1.7.0<br><br>Blur No-Alt: by Kerri Hicks – 0.92<br><br>Bot Block: by Sean & Ricky Dawn – 2.6<br><br>Content Audit: by Stephanie Leary – 2.0<br><br>Editoria11y Accessibility Checker: by Princeton University<br><br>WDS – 2.0.9<br><br>Enhanced YouTube Embed Block: by Mark Root-Wiley<br><br>MRW Web Design – 0.1.0<br><br>Event Tickets: by The Events Calendar – 5.18.0.1<br><br>Event Tickets Extension: Promoter WP Admin Integration: by Modern Tribe<br><br>Inc. – 1.0.0<br><br>Event Tickets Plus: by The Events Calendar – 5.9.0<br><br>Gravity Forms: by Gravity Forms – 2.9.1<br><br>Gravity Forms Utility: by gravity+ – 3.0.0<br><br>Maximum Quantity for WooCommerce Shops: by PT Woo Plugins (by Webdados) – 2.2.1<br><br>MRW Accordion: by Mark Root-Wiley – 0.5.0<br><br>MRW Card Block Variation: by Mark Root-Wiley<br><br>MRW Web Design – 0.4.3<br><br>MRW Simplified Editor: by Mark Root-Wiley – 2.13.0<br><br>Plugin Notes Plus: by Jamie Bergen – 1.2.8<br><br>Post Type Archive Descriptions: by Mark Root-Wiley<br><br>MRW Web Design<br><br>NonprofitWP.org – 1.5.0<br><br>PublishPress Authors: by PublishPress – 4.7.3<br><br>Query Monitor: by John Blackbourn – 3.17.0<br><br>Redirection: by John Godley – 5.5.1<br><br>Relevanssi: by Mikko Saari – 4.24.3<br><br>Simple Page Ordering: by 10up – 2.7.2<br><br>Sucuri Security - Auditing, Malware Scanner and Hardening: by Sucuri Inc. – 1.9.7<br><br>The Events Calendar: by The Events Calendar – 6.9.1<br><br>The Events Calendar: Virtual Events: by The Events Calendar – 1.15.5<br><br>The Events Calendar Extension: Only Location-Based Time Zones: by Modern Tribe<br><br>Inc. – 1.0.0<br><br>The Events Calendar Extension: Remove Export Links: by Modern Tribe<br><br>Inc. – 1.1.1<br><br>Transients Manager: by WPBeginner – 2.0.7<br><br>Useful Block Styles: by Mark Root-Wiley<br><br>Ryan Tvenge – 0.3.1<br><br>WooCommerce SkyPrep Integration: by Mark Root-Wiley<br><br>MRW Web Design – 0.1.0<br><br>WP All Export Pro: by Soflyy – 1.9.3<br><br>WP All Import - WooCommerce Add-On: by Soflyy – 1.5.4<br><br>WP All Import Pro: by Soflyy – 4.9.7<br><br>WP Comment Humility: by John James Jacoby – 0.1.0<br><br>WP Help: by Mark Jaquith – 1.7.5<br><br>WP Mail Logging: by WP Mail Logging Team – 1.14.0<br><br>WP Migrate: by WP Engine – 2.7.0<br><br>Yoast Duplicate Post: by Enrico Battocchi & Team Yoast – 4.5<br><br>Yoast SEO: by Team Yoast – 24.1<br><br>YotuWP - YouTube Gallery: by  – 1.3.14<br><br>### Settings ###<br><br>Legacy API Enabled: –<br><br>Force SSL: –<br><br>Currency: USD ($)<br><br>Currency Position: left<br><br>Thousand Separator: ,<br><br>Decimal Separator: .<br><br>Number of Decimals: 2<br><br>Taxonomies: Product Types: external (external)<br><br>grouped (grouped)<br><br>simple (simple)<br><br>variable (variable)<br><br>Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)<br><br>exclude-from-search (exclude-from-search)<br><br>featured (featured)<br><br>outofstock (outofstock)<br><br>rated-1 (rated-1)<br><br>rated-2 (rated-2)<br><br>rated-3 (rated-3)<br><br>rated-4 (rated-4)<br><br>rated-5 (rated-5)<br><br>Connected to WooCommerce.com: –<br><br>Enforce Approved Product Download Directories: ?<br><br>HPOS feature enabled: ?<br><br>Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore<br><br>HPOS data sync enabled: –<br><br>### Logging ###<br><br>Enabled: ?<br><br>Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2<br><br>Retention period: 30 days<br><br>Level threshold: –<br><br>Log directory size: 299 KB<br><br>### WC Pages ###<br><br>Shop base: ? Page not set<br><br>Cart: #24067 - /cart/ -  Contains the [woocommerce_cart] shortcode<br><br>Checkout: #24068 - /checkout/ -  Contains the [woocommerce_checkout] shortcode<br><br>My account: ? Page ID is set<br><br>but the page does not exist<br><br>Terms and conditions: ? Page not set<br><br>### Theme ###<br><br>Name: Twenty Twenty-Five<br><br>Version: 1.0<br><br>Author URL: https://www.ads-software.com<br><br>Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme<br><br>Theme type: Block theme<br><br>WooCommerce Support: ? Not declared<br><br>### Templates ###<br><br>Overrides: –<br><br>### Admin ###<br><br>Enabled Features: activity-panels<br><br>analytics<br><br>product-block-editor<br><br>coupons<br><br>core-profiler<br><br>customize-store<br><br>customer-effort-score-tracks<br><br>import-products-task<br><br>experimental-fashion-sample-products<br><br>shipping-smart-defaults<br><br>shipping-setting-tour<br><br>homescreen<br><br>marketing<br><br>mobile-app-banner<br><br>onboarding<br><br>onboarding-tasks<br><br>pattern-toolkit-full-composability<br><br>product-custom-fields<br><br>remote-inbox-notifications<br><br>remote-free-extensions<br><br>payment-gateway-suggestions<br><br>printful<br><br>shipping-label-banner<br><br>subscriptions<br><br>store-alerts<br><br>transient-notices<br><br>woo-mobile-welcome<br><br>wc-pay-promotion<br><br>wc-pay-welcome-page<br><br>launch-your-store<br><br>Disabled Features: product-data-views<br><br>experimental-blocks<br><br>coming-soon-newsletter-template<br><br>minified-js<br><br>product-pre-publish-modal<br><br>settings<br><br>async-product-editor-category-field<br><br>product-editor-template-system<br><br>blueprint<br><br>reactify-classic-payments-settings<br><br>use-wp-horizon<br><br>add-to-cart-with-options-stepper-layout<br><br>Daily Cron: ? Next scheduled: 2025-01-28 22:32:19 -08:00<br><br>Options: ?<br><br>Notes: 70<br><br>Onboarding: skipped<br><br>### Action Scheduler ###<br><br>Complete: 133<br><br>Oldest: 2024-12-28 14:35:41 -0800<br><br>Newest: 2025-01-28 09:20:08 -0800<br><br>Failed: 13<br><br>Oldest: 2025-01-14 14:03:13 -0800<br><br>Newest: 2025-01-28 08:58:07 -0800<br><br>Pending: 3<br><br>Oldest: 2025-01-29 07:54:09 -0800<br><br>Newest: 2025-01-29 07:54:10 -0800<br><br>### Status report information ###<br><br>Generated at: 2025-01-28 09:32:37 -08:00<br><br>

    </details>
    • This topic was modified 1 month, 4 weeks ago by mrwweb. Reason: fixed images and added block names of cross-sell blocks for clarity
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    Thank you for providing more information about the issue.

    I have tried to replicate this on my site, and I can see that cross-sell products appear in the mini-cart only when viewing the product details page of the product that has cross-sells assigned. For example, if you add a cross-sell product to a product like a cap, the mini-cart will show the cross-sell products only when you are on the cap’s product details page.

    For testing purposes, could you please open the product details page that has cross-sell products, open the cart drawer on that page, and check if the cross-sell products appear on your site?

    In the meantime, I will discuss this behavior with our developers to determine whether this is the expected behavior or a bug. I’ll update you once I have more information.

    Thread Starter mrwweb

    (@mrwweb)

    Thanks for your support, @shahzeenfarooq.

    When viewing a product details page that has a cross-sell:

    • The woocommerce/cart-cross-sells-block (the one with the Column block icon) still only shows a heading.
    • The woocommerce/cart-cross-sells-products-block shows the cross-sell product.

    It had never occurred to me that the cross-sell block in the cart would be contextual to the product page and not the cart contents, given that it’s always been possible to show cross-sells on the /cart/ page.

    Inspecting the code, I fear that the current behavior may be intended:

    data-__private-preview-state='{“isPreview”:true,”previewMessage”:”Actual products will vary depending on the page being viewed.”}’

    However, I hope the development team might reconsider and make the cross-sell block contextual to the cart contents which strikes me as much more useful and likely to work.

    In our case, we never expose the individual product detail pages, so this block currently has no value to us.

    If this is the intended behavior of the block, and tips, pointers, and suggestions for a path forward on cart-based cross-sells would be greatly appreciated.

    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello mrwweb,

    Thank you for your patience.

    I understand your concern about the cross-sell block behavior.
    It is designed to work this way, showing cross-sells based on the product page rather than cart contents.

    I recommend sharing your suggestion on our Feature Request portal so the team can review it for potential improvements.

    Please don’t hesitate to contact us again if you have more questions or concerns.
    We are here to help ??

    Best regards.

    Thread Starter mrwweb

    (@mrwweb)

    Thank you for the clarity, @woo-hc. That’s quite disappointing, but obviously not your fault. I hope the developers will see fit to add this option sooner than later!

    I have submitted a feature request. For anyone else who wants this feature, please give it an up-vote!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.