Skip to product information
1 of 1
Published:2026.05.03

[Horizon] Add a FAQ accordion to the cart drawer and cart page

[Horizon] Add a FAQ accordion to the cart drawer and cart page

Applications

  • カート編集
View full details

An example of adding a FAQ accordion to the cart drawer and cart page in the Horizon theme. No theme file edits required — just paste a single Custom Liquid section into the Theme Editor. Theme updates won't break this customization.


Result

A "Frequently Asked Questions" accordion appears alongside the existing "Order note" and "Discount" rows. Borders integrate naturally with the existing frame, and JavaScript injects a synthetic frame when both note and discount are disabled, so borders never disappear.

Cart drawer with FAQ accordion added

Opening the outer accordion reveals nested Q&A items inside. The expanded height is capped at 40% of the viewport (or 360px), so cart items remain visible even on small phones.

FAQ expanded showing questions and answers


How it works — Handling the Section Rendering API

Horizon re-renders the cart drawer via the Section Rendering API each time a cart item is added, removed, or updated. Naively injected DOM elements would get wiped on every cart update. This TIPS uses a scoped MutationObserver on cart-drawer-component and cart-items-component, plus the official cart:update event, to automatically re-inject the FAQ after every re-render. The same script works on the cart page (/cart) as well.


Adding or editing Q&A

Each Q&A is a 4-line <details class="cart-faq__item"> block. Copy and paste to add or remove items.

Q&A editing area in the code


Setup

◆ STEP 1
Open the Theme Editor and add a "Custom Liquid" section to the header group.

◆ STEP 2
Paste the entire sample code into that section.

◆ STEP 3
Verify the FAQ appears in the cart drawer and on the cart page.


Related TIPS

For more cart customization ideas:
[Horizon] Free shipping progress bar in the cart

After making a purchase (all items are ¥0), you will be able to view the sample code.

If you have already made a purchase, please login here.

Sample Codes

Test Theme :Horizon 3.5.1

カスタムLiquidに貼り付けるコード(全体)

テーマエディタ → ヘッダーグループ → セクションを追加 → 「カスタムLiquid」を選び、下のコードを丸ごと貼り付けてください。中ほどの <details class="cart-faq__item"> ブロックを編集すれば Q&A を増減できます。