Hi @3rdDay, this is a common issue with themes and apps that add items to the cart. Not all themes are compatible with all apps.
My suggestions here would be in the following order:
- Request the app developer’s help to ensure that the event they fire also refreshes your theme’s cart implementation (might be the cleanest). Since this is a native Shopify theme (horizon) - I’m sure they can help you with the implementation.
- Shopify just released a new feature called AI toolkit that allows you to connect AI models like ChatGPT or Claude and let them edit your theme code for you.
- Do it yourself following the steps I outlined in this reply.
For (2) Once you set everything up for the AI toolkit following this Shopify article the prompt would be fairly simple:
Help me update my theme code to update my cart when the wishlist event fires.
swishlist:st-wishlist-add-to-cart (Triggered when a customer clicks the “Add to cart”, “Add all to cart” button on the Wishlist page.)
(3) Do it yourself guide
Connects the Swishlist app’s swishlist:st-wishlist-add-to-cart event to the Horizon theme’s cart UI so the cart icon, drawer, and items refresh automatically when a customer adds a product from their wishlist.
How It Works
When Swishlist adds an item to cart it fires swishlist:st-wishlist-add-to-cart on document. The bridge script listens for that event, fetches the current cart from Shopify’s AJAX API, then re-dispatches a cart:update event that Horizon’s built-in components already know how to handle.
Files Changed
| File |
Action |
assets/swishlist-cart-bridge.js |
Created — the bridge script |
snippets/scripts.liquid |
Edited — loads the bridge on every page |
Step-by-Step
Step 1 — Create the bridge script
Create a new file at assets/swishlist-cart-bridge.js with the following content:
window.addEventListener('swishlist:st-wishlist-add-to-cart', async () => {
try {
const response = await fetch('/cart.js', {
headers: { Accept: 'application/json' },
});
if (!response.ok) return;
const cart = await response.json();
document.dispatchEvent(
new CustomEvent('cart:update', {
bubbles: true,
detail: {
resource: cart,
sourceId: 'swishlist',
data: {
source: 'swishlist',
itemCount: cart.item_count,
},
},
})
);
} catch (error) {
console.error('[swishlist-cart-bridge] Failed to refresh cart:', error);
}
});
Step 2 — Load the script on every page
Open snippets/scripts.liquid and find this block (or add somewhere near the bottom of the file):
<script
src="{{ 'auto-close-details.js' | asset_url }}"
defer="defer"
></script>
Add the bridge script directly after it:
<script
src="{{ 'swishlist-cart-bridge.js' | asset_url }}"
defer="defer"
></script>