E-commerce
October 29, 2026
Wondering how to create a cart page that adapts naturally to small screens while maintaining a smooth shopping experience?
The key: by combining Bootstrap's responsive grid with Shopify Liquid tags, you get a cart that is readable on mobile and performant on desktop.
The challenge lies in converting a traditional table into a vertical display that remains clear and interactive.
So, how to develop a mobile-first and responsive cart page with Bootstrap? Here's what's on the agenda:
Why must the cart be mobile-first?
How to structure the page with the Bootstrap grid?
Which Bootstrap classes are used for a fluid display?
How to center and style the cart header?
How to integrate the cart update form?
How to display each product with Liquid?
How to organize images, titles, and prices in nested columns?
What custom CSS adjustments are necessary?
How to handle item removal and the total?
What payment elements to add before the checkout funnel?
How does Qstomy optimize your cart conversion?
What checklist before publishing your cart page?
Let's go.
In addition to visual responsiveness, a mobile-first cart must load quickly, adhere to WCAG accessibility standards, and preserve local SEO by maintaining correct semantic tags. This guide walks you step by step to achieve these goals.
Summary
Why must the cart be mobile-first?
Mobile commerce represents more than half of global traffic, and customers quickly abandon a cart that is difficult to read on a small screen. A vertical display, adapted to smartphone width, reduces zoom gestures and improves readability of key information: title, price, quantity, and total. By offering a fluid experience, you increase conversion rates and decrease abandonment rates, two crucial indicators for your store's growth. To deepen the impact of mobile on sales, consult our guide How to increase e-commerce store sales?. En outre, a mobile-first design improves Core Web Vitals scores, promotes better organic search ranking, and meets user expectations who prioritize speed and simplicity of use on their devices.

Convert over 2,000 customers on average per month with Qstomy.
The world’s 1st Shopify AI dedicated to customer conversion



Empowering 200+ e-commerce merchants
How to structure the page with the Bootstrap grid?
Bootstrap relies on a 12-column grid system. Start by wrapping your cart in a <div class="container-fluid"> to achieve maximum width. Inside, create a <div class="row"> which will contain each product line. Each line can be split into columns using col-xs-12 (for screens < 768 px) et col-sm-2, col-sm-4 … for larger screens. This structure ensures the same code automatically adapts to smartphones, tablets, and computers. Astuce : use gutters (g-3) to create consistent spacing between columns, and consider breakpoints (col-md‑*) to adjust the layout for landscape tablets. Thus, your cart will remain balanced regardless of the device.
Which Bootstrap classes are used for a fluid display on small screens?
The essential classes are:
col‑xs‑12 : takes full width on mobile screens.
col‑sm‑2 / col‑sm‑4 : distribute space when exceeding 768px.
img‑responsive : automatically resizes product images without overflow.
table‑responsive : transforms the table into a scrollable block if you choose to keep the tabular structure.
In addition to these classes, you can leverage utility classes d‑none / d‑sm‑block to show or hide elements based on screen size, as well as margin and padding classes (p‑2, mb‑3) to refine positioning. By combining these classes, every cart element adjusts harmoniously, whether the customer uses an iPhone, an Android device, or a tablet.
How to center and style the cart header on mobile?
By default, .page-header align text to the left. Create a small file custom.css with:
.page-header { text-align: center; } .page-header small { display: block; }These rules apply first to mobile devices. Then, add a media query to restore left alignment on screens >= 768 px:
@media (min-width: 768px) { .page-header { text-align: left; } .page-header small { display: inline; } }The result: a centered title and a subtitle on its own line on smartphones, while maintaining the classic layout on desktop. Additional tip : add a subtle drop shadow (text-shadow: 0 1px 2px rgba(0,0,0,0.1)) to improve readability on high-contrast backgrounds, and use a fluid font size (font-size: clamp(1.5rem, 4vw, 2rem)) so the title remains proportional regardless of the device.
What is the best way to integrate the cart update form?
Wrap the cart content in a <form method="post" action="/cart/update">tag. Each quantity field uses the name quantity[{{ item.key }} so Shopify recognizes the changes. Add a button <button type="submit" class="btn btn-primary">Update</button> to trigger the submission. This form remains fully functional even without JavaScript, ensuring compatibility with simpler browsers. For a complete overview of payment gateway creation, read How to create a payment gateway for an e‑commerce site?. Good to know : add a hidden field {{ form.authenticity_token }} to protect against CSRF attacks, and ensure labels are associated with fields (<label for="quantity_{{ item.key }}">) to improve accessibility for screen readers.
How to display each product using Shopify Liquid loops?
Liquid allows you to iterate through cart items:
{% for item in cart.items %} … {% endfor %}Inside the loop, each {{ item.title }}, {{ item.quantity }} and {{ item.price | money }} becomes available. Place this block where you opened your <form>. Thus, the same HTML fragment is automatically repeated for each product, guaranteeing instant updates whenever a customer adds or removes an item. Advanced tip : leverage the item.variant_title ou item.sku properties to display variant information, and use the | default: ’N/A’ filter to handle missing values without breaking the rendering.
How to organize images, titles, and prices in nested columns?
After opening the Liquid loop, create an additional row:
<div class="row cart-row">
<div class="col-xs-12 col-sm-2">
<a href="/en/blog-posts/{{ item.url }}"><img src="{{ item.image }}" class="img-responsive" alt="{{ item.title }}"></a>
</div>
<div class="col-xs-12 col-sm-4">
<h4>{{ item.title }}</h4>
</div>
<div class="col-xs-6 col-sm-2">{{ item.price | money }}</div>
<div class="col-xs-6 col-sm-2"><input type="number" name="quantity[{{ item.key }}]" value="{{ item.quantity }}" min="0" class="form-control"></div>
<div class="col-xs-12 col-sm-2">{{ item.line_price | money }}</div>
</div>The columns col‑xs‑12 ensure each piece of information stacks vertically on mobile, while the col‑sm‑* classes place elements side by side on large screens. To optimize performance, ajoutez l’attribut loading="lazy" to tags to defer loading of off-screen images, and use the filter | img_url: ’200x200’ to serve compressed thumbnails, thereby reducing page weight.
What custom CSS adjustments are needed for the aesthetic?
A few quick settings improve the visual appearance:
.cart-row : ajoute
margin-bottom: 15px; padding: 10px; border-bottom: 1px solid #eaeaea;to separate the rows..img-responsive : limits the maximum width to
120pxto keep the cart compact..form-control : harmonizes the quantity field with other form elements.
These small touches ensure the cart remains clean, even when it contains many items. In addition, you can add transition effects to the cart rows (.cart-row { transition: background-color 0.2s ease; }) to highlight the hovered row, and apply a subtle alternative background color (background-color: #fafafa;) to even rows to improve readability.
How to handle item removal and total recalculation?
Add a remove link to each row:
<a href="/blog-posts/train-ecommerce-chatbot-with-shopify-data" class="text-danger" title="Supprimer">✕</a>On clicking, Shopify re-evaluates the cart and returns the new total automatically. You can display the subtotal outside the loop:
<h4>Sous‑total : {{ cart.total_price | money }}</h4>This logic reduces the need for JavaScript and remains reliable even with the most basic browsers. Conseil pratique : use a value of quantity[{{ item.key }}]=0 to trigger removal, and display a confirmation message (onclick="return confirm(’Supprimer cet article ?’)") to avoid accidental deletions. You can also consider an AJAX version for a page reload-free experience.
What payment and validation elements should be added before the checkout funnel?
After the cart table, propose a summary section: total, estimated shipping fees, and a button to access the checkout funnel. Example:
<div class="well">
<h4>Total: {{ cart.total_price | money }}</h4>
<a href="/blog-posts/shopify-guide-how-to-build-and-grow-a-successful-online-store" class="btn btn-success btn-block">Proceed to Checkout</a>
</div>To enrich the payment step, consult our article How to create a payment gateway for an e‑commerce site? which details Stripe, PayPal, and Shopify Payments integrations. Ajoutez a shipping fee estimation block (using Shopify scripts or a third-party service) and, if you are in Europe, clearly indicate the applied VAT. A high-contrast button, accessible via keyboard (tabindex="0") and featuring an attribute aria‑label, strengthens compliance with accessibility standards.
How does Qstomy optimize your cart page conversion?
Qstomy integrates directly into your Shopify theme and adds:
Recommandations dynamiques : display of complementary items based on cart content, increasing cross-selling.
Limited stock reminders : urgent messages ("only 3 left in stock") that stimulate a sense of urgency.
Analyse comportementale : tracking of cart abandonments and automatic sending of personalized reminder emails.
Integrated CS : instant contact button that reduces hesitation before checkout.
By combining these features with your responsive Bootstrap page, you maximize conversion rates while maintaining a smooth user experience. Discover more optimizations in our guides FAQ, recherche ou chatbot IA and e-commerce CRM and customer support. Result : our internal studies show an average 12% increase in conversion rates and an 8% reduction in abandonment rates when these modules are enabled.
What checklist before publishing your responsive cart page?
In short
Check rendering on iOS, Android, and tablets.
Test quantity updates and item removal.
Confirm subtotal and total TTC calculations.
Ensure the 'Checkout' button correctly redirects to the Shopify order funnel.
Analyze load times with performance tools (How to increase e-commerce store sales?).
Verify the presence of SEO meta tags (title, description) specific to the cart page.
Ensure GDPR consent is respected for abandonment tracking.
FAQ rapide
Does the cart work without JavaScript? Yes, Shopify's HTML form handles server-side updates.
Can I add a promo code directly on the cart page? Integrate the field
discount_codein the same form.Do I need to redeploy the theme after every modification? A simple 'Publish' of the theme is sufficient; CSS/HTML changes are applied immediately.
Once the checklist is validated, push your theme to production and let Qstomy maximize your sales.

Enzo
October 29, 2026


