Skip to main content

Latest Order Block

Show a customer's most recent order in the Account Sidebar, with its status, arrival estimate, and a link to the full order details. Visible to logged-in customers only.

Written by Kris James

The Latest Order block shows a customer their single most recent order at a glance, right inside the Account Sidebar.

Tapping the card opens the full order details, and the All orders link at the top of the block takes the customer to their Orders tab. This block is only visible to logged-in customers, and it automatically hides itself when the customer has no orders.


How to Configure the Latest Order Block

  1. From your Shopify admin, open the Mage Loyalty app.

  2. In the left menu, click Account Sidebar.

  3. Click the Blocks tab.

  4. Click Add and select Latest Order (if it is not already in your list of blocks).

  5. Click the Latest Order block to expand its settings, and make sure its toggle is turned on.

  6. Set the Section Title and All orders link text (see Field Reference below).

  7. If you like, drag the block to reorder where it appears in the sidebar.

  8. Click Save.


Field Reference

Field

What It Does

Example

Section Title

The heading shown at the top of the block. Defaults to "Latest order".

"Your latest order", "Recent order"

All orders link text

The link shown at the top-right of the block. Tapping it opens the customer's Orders tab. Defaults to "All orders".

"View all", "Order history"


CSS Reference

Merchants can restyle the Latest Order block with custom CSS. Add your rules in the Account Sidebar Design tab, under Custom CSS. The block uses the classes below.

Class

What it targets

.mage-sidebar-latest-order

The outer wrapper around the whole block.

.mage-sidebar-latest-order__header

The header row (title and All orders link).

.mage-sidebar-latest-order__title

The block title text.

.mage-sidebar-latest-order__all-orders

The All orders link.

.mage-sidebar-latest-order__card

The tappable order card.

.mage-sidebar-latest-order__thumb

The product image container.

.mage-sidebar-latest-order__thumb-icon

The placeholder icon shown when an item has no image.

.mage-sidebar-latest-order__info

The text area next to the image.

.mage-sidebar-latest-order__status

The status line (dot and label).

.mage-sidebar-latest-order__status-dot

The small dot next to the status.

.mage-sidebar-latest-order__arrival

The bold arrival or delivered line.

.mage-sidebar-latest-order__chevron

The arrow icon on the right of the card.

.mage-sidebar-latest-order__skeleton

The loading placeholder shown while the order loads.

The status line also receives one of the modifier classes below, depending on the order's current status. These classes are shared with the Orders list, so any styling you apply also updates the status there. Combine a modifier with the status class to recolour a specific state.

Modifier class

Applied when the status is

.mage-sidebar-orders__item-status--unfulfilled

Unfulfilled

.mage-sidebar-orders__item-status--in-progress

In progress

.mage-sidebar-orders__item-status--partial

Partially fulfilled

.mage-sidebar-orders__item-status--on-hold

On hold

.mage-sidebar-orders__item-status--scheduled

Scheduled

.mage-sidebar-orders__item-status--request-declined

Request declined

.mage-sidebar-orders__item-status--fulfilled

Fulfilled

.mage-sidebar-orders__item-status--cancelled

Cancelled

.mage-sidebar-orders__item-status--in-transit

In transit

.mage-sidebar-orders__item-status--out-for-delivery

Out for delivery

.mage-sidebar-orders__item-status--ready-for-pickup

Ready for pickup

.mage-sidebar-orders__item-status--picked-up

Picked up

.mage-sidebar-orders__item-status--attempted-delivery

Attempted delivery

.mage-sidebar-orders__item-status--delayed

Delayed

.mage-sidebar-orders__item-status--delivery-issue

Delivery issue

.mage-sidebar-orders__item-status--delivered

Delivered

For example, to colour the status green once an order has been delivered:

.mage-sidebar-latest-order__status.mage-sidebar-orders__item-status--delivered {
  color: #1a7f37;
}

The status dot automatically follows the colour of the status text.


Troubleshooting

The block isn't showing

  • It is only visible to logged-in customers. If you are viewing your storefront while logged out, the block will not appear.

  • It automatically hides when the customer has no orders. Test with a customer account that has at least one order.

  • Check that the block toggle is turned on and that you clicked Save.

I can't find the Latest Order block in my list

  • It is not added by default. In the Blocks tab, click Add and select Latest Order.

The status or arrival time looks out of date

  • Order status and delivery timing come from Shopify and the carrier. The block refreshes shortly after an order updates, so give it a few minutes and reopen the sidebar.

  • The arrival estimate only appears when the carrier provides one. Some orders and carriers do not, in which case the card shows the status without an arrival line.

No product image is showing

  • The block uses the image of the first item in the order. If that product has no image in Shopify, a placeholder icon is shown instead.


Still need help or can't find the answers you're looking for? Reach out to the Mage Loyalty team through our live chat support.

Did this answer your question?