Mini-Cart & Checkout Summary Support
Dino Discounts shows two kinds of thing in a cart:
- The totals. Discounts are applied inside WooCommerce’s own cart calculation, so every subtotal and total WooCommerce shows already includes them, and so does the order that is placed. This does not depend on your theme.
- The annotations. The itemised discount lines in a mini-cart drawer, the “Free gift:” prefix and “Free” price on a gift line, per-item discount notes, and the spend-more message. These are drawn into the theme’s own cart markup, so they appear where Dino recognises that markup.
On a theme surface Dino does not recognise, the annotations may not appear, but the totals are always correct. The shopper is charged the right amount whatever the drawer looks like.
Supported out of the box
Section titled “Supported out of the box”Cart and checkout pages
Section titled “Cart and checkout pages”| Surface | What Dino shows | How |
|---|---|---|
| Classic cart page and classic checkout order summary | ”Free gift:” prefix, “Free” price and subtotal, fixed quantity on gift lines; discount rows in the totals | WooCommerce’s standard cart-item filters, so any theme or template that uses WooCommerce’s cart templates gets them |
| Block Cart and block Checkout | The same gift treatment, read from the Store API | WooCommerce Blocks’ own checkout filters |
| Essential Addons for Elementor Woo Checkout widget | The gift treatment above. Dino also corrects the summary when EAEL leaves it showing a stale coupon or total after an apply or remove | A guard script loaded only when Essential Addons is active, on the classic checkout |
Mini-cart drawers
Section titled “Mini-cart drawers”Dino adds its discount lines (and the spend-more message, unless spend-more nudges are switched off, or the mini-cart slot is set to Not shown, in Message Settings) to these drawers:
| Drawer | Recognised by |
|---|---|
| WooCommerce classic mini-cart widget, as used by most classic themes | .widget_shopping_cart_content |
| Elementor Pro Menu Cart | the same container, with Elementor’s .elementor-menu-cart__* footer, subtotal and product list |
| WooCommerce Mini-Cart block drawer | .wc-block-mini-cart__drawer |
Inside a recognised drawer, the discount lines go just above the footer buttons. If there are no buttons they go after the subtotal, and failing that, at the end of the drawer. A page with both a classic header mini-cart and a Mini-Cart block gets both decorated.
Two extras depend on the drawer type:
- Per-item discount notes and the “Free” gift badge are added to classic and Elementor mini-cart items (
.woocommerce-mini-cart-item,.mini_cart_item,.elementor-menu-cart__product), and gift rows in the Mini-Cart block are tagged as free. - A net “after discounts” total is added to the Mini-Cart block drawer only. That drawer shows a pre-discount subtotal and has no slot for a discounted total, so Dino works it out from the subtotal the drawer displays.
The store-wide Discount label settings in Message Settings still apply on every supported surface. A discount line you have hidden on the mini-cart or at checkout stays hidden there.
The drawer layer loads only on stores with WooCommerce cart fragments (classic themes) or WooCommerce Blocks available.
On an unsupported theme surface
Section titled “On an unsupported theme surface”A cart drawer or order summary built with its own markup — a side-cart plugin, a theme’s custom slide-out cart, a page-builder widget not listed above — is not recognised by those selectors. On such a surface:
- Totals are correct. Every price, subtotal and total WooCommerce or the theme displays from WooCommerce’s cart already includes the discount.
- Dino’s itemised discount lines and spend-more message are not shown in that drawer unless a developer registers it (below).
- The gift line may or may not read “Free gift:” / “Free”. If the drawer renders its lines through WooCommerce’s standard cart-item filters, it does. If it builds them some other way, the gift shows as an ordinary £0.00 line.
The cart and checkout pages themselves are usually unaffected, because most themes keep WooCommerce’s templates there.
If a theme’s cart layer clashes with Dino’s, a developer can switch Dino’s drawer layer off entirely:
add_filter( 'dino_discounts_enable_cart_ui_sync', '__return_false' );This also turns off Dino’s removal of a duplicate spend-more message, so the mini-cart copy may then show alongside the cart page’s own.
Registering a custom theme’s selectors
Section titled “Registering a custom theme’s selectors”A developer can register a theme’s own drawer so Dino adds its discount lines and spend-more message there, with the dino_discounts_mini_cart_selectors filter:
add_filter( 'dino_discounts_mini_cart_selectors', function ( $selectors ) { $selectors['drawer'][] = '.my-theme-cart-drawer'; $selectors['items'][] = '.my-theme-cart-drawer__products'; $selectors['footer'][] = '.my-theme-cart-drawer__actions'; return $selectors;} );draweris the drawer’s container.itemsis its product list: Dino waits for it before drawing, so a drawer with its own list needs both.footeris the button row the discount lines go above.subtotalis the row they go below when there is no footer. With neither, they go at the end of the drawer.- Per-item discount notes and the “Free” gift badge stay on the built-in drawers.
A checkout whose order summary Dino does not recognise can be registered with dino_discounts_checkout_summary_selectors, so Dino corrects that summary after an Apple Pay or Google Pay payment is declined:
add_filter( 'dino_discounts_checkout_summary_selectors', function ( $selectors ) { $selectors[] = '.my-checkout-summary'; return $selectors;} );Selectors can use element names, classes, ids and attribute tests, joined by spaces or >, +, ~. Anything else is ignored, including pseudo-classes such as :not() and comma lists. Register each selector as its own entry.
A drawer that is neither built in nor registered gets nothing from Dino. Dino does not detect unknown drawers by itself, and the totals stay correct either way.
Related
Section titled “Related”- Compatibility Center — workarounds for specific checkout conflicts, switched on per store.
- Cart Labels — the wording of the labels shown on cart lines.