We rebuilt Roshni's Mehndi Art, an Ahmedabad henna shop, as a static Astro storefront with WooCommerce kept as a private back office, and we did it without changing a single product link. Customers now get pre-built pages and small WebP photos, pay through our own branded Razorpay checkout, and Roshni still runs orders, stock, refunds and shipping from the WooCommerce screens she already knew. The new store went live on 26 November 2026.
Below: what was wrong with the old site, why we picked headless WooCommerce over a new theme or Shopify, how the checkout works, and the problems we hit on the way, for shop owners weighing up a rebuild. The short version, with screens, is on the Roshni's Mehndi Art case study page.
The shop and what was wrong with it
Roshni's Mehndi Art is the shop of Roshni, a working mehndi artist in Ahmedabad. It sells reusable mehndi practice books, a 30 page book and a 14 page beginner book, plus cones, pins, oil, powder and a beginner kit. Seven products in all, with sizes as variations.
The old site ran on WordPress with the Avada theme and 29 active plugins. Every page came with Avada's 1.5 MB stylesheet and a 2.4 MB logo file. Google's field data for real phone users showed the site failing Core Web Vitals.
- Largest Contentful Paint for real phone users
- 5.1 s
- Cumulative Layout Shift for real phone users
- 0.33
- Admin dashboard load, with 559 database queries
- 11.75 s
- Practice work photos on one 3.4 MB page
- 1,553
For context, web.dev (opens in a new tab) sets a good LCP at 2.5 seconds or less and a good CLS at 0.1 or less, measured at the 75th percentile of page loads. The old shop was at double the LCP limit and more than three times the CLS limit.
In lab tests on a phone, the main content took 7.8 s on the home page, 12.5 s on the 30 page book and 23.6 s on the practice work gallery, with PageSpeed scores of 48, 38 and 25.
The back office had its own problems. The database was 277 MB, about 200 MB of it logs, Rank Math was empty on 9 of 13 pages, and 125 images had no alt text.
Why headless WooCommerce, not a new theme or Shopify
We compared four options before writing any code: WooCommerce with a new custom theme, headless WooCommerce, headless Shopify, and a fully custom shop. We picked an Astro storefront with WooCommerce kept as the back office.
| Option | What it meant for this shop |
|---|---|
| New WooCommerce theme | Pages still built by PHP on the same WordPress install |
| Headless WooCommerce with Astro | Static pages, nothing to migrate, same admin, no new monthly fees |
| Headless Shopify | Could keep the URLs, but adds monthly fees and a full migration |
| Custom shop | A new platform, so orders, reviews and stock would all move |
Three things decided it. Astro pre-renders pages to static HTML at build time by default, as the Astro docs (opens in a new tab) describe, so pages are ready files on the CDN. Nothing had to move: 51 orders, 26 reviews, coupons and 1,827 media items stayed where they were. Roshni kept the admin she knew. And it was the same stack as the shop's existing ebooks site, which already runs on Astro with Razorpay.
A normal Shopify theme was ruled out for a plainer reason: it would have changed the product addresses. If you want the general pattern rather than this one shop, our guide to an Astro and WooCommerce headless store compares the hybrid and fully headless setups.
Keeping every URL
The owner's top rule was that product links must never change, so we froze them before design started.
We crawled the site and wrote a URL sheet with 44 rows. Four pages were locked so they can never move: both book pages, the shop page and the practice work gallery. The old beginner book address still got 1,745 hits through its redirect, so outside sites link to it.
On the new site, 20 key URLs are checked after every deploy and all 20 answer on the same address, plus 11 redirects. Every old WordPress address type now goes to a working page in one hop: post and page IDs, all 1,827 attachment pages, feeds, author pages, product tags and paginated pages. Our sitemaps sit on the same addresses the old SEO plugin used. We cover the full checklist in our WordPress to Astro migration guide.
State machines before screens
Before building any page, we wrote the cart, the checkout hand-off and the gallery loading as small state machines with tests. The checkout hand-off, for example, moves through idle, checking, handing off and failed, and only the newest network answer can win.
So a slow stock check that answers late cannot overwrite a newer one, and a cart saved by an older version of the site still loads. By the end of the build, 17 of 17 tests passed.
Our own Razorpay checkout
The customer now stays on the new site from cart to thank-you page, while WooCommerce still does the shop work behind the scenes. It follows the create-order, pay and verify steps Razorpay documents for its standard web checkout (opens in a new tab).
- WooCommerce prices the cart
- We create a pending order
- Razorpay order for that exact total
- Signature checked on our server
- Order marked paid
In plain words:
- WooCommerce prices the cart and works out shipping, using the Store API (opens in a new tab), WooCommerce's public API for carts and checkout. The browser never decides a price.
- Our server creates a pending WooCommerce order, then a Razorpay order for exactly that total.
- After payment, our server checks Razorpay's payment signature with the secret key, which never reaches the browser.
- The order is marked paid by the page or by the Razorpay webhook (opens in a new tab), whichever arrives first. If a customer closes the tab at the wrong moment, the webhook is there to mark the order paid.
Orders, stock, emails, refunds and Shiprocket all stay in WooCommerce. Shiprocket reads paid orders from WooCommerce and marks them completed once they ship or are delivered, while WooCommerce keeps the stock. Refunds go through the order screen's own Refund button, which returns the money through Razorpay. If you are choosing a gateway for an Indian shop, our comparison of WooCommerce payment gateways in India is a good starting point, and our checkout and payment gateway service covers builds like this one.
A payment screen built never to mislead
We set one rule for payments: a customer must never feel their money is lost. So after Pay, a branded overlay walks through Preparing, Verifying and Payment successful. If the network is slow, calm notes appear at 8 and 25 seconds. On a failure it offers Try again or WhatsApp. If we cannot confirm yet, it says so and offers Check again. It is built never to show a wrong success or a wrong failure.
The thank-you page follows the same idea. It keeps checking for about two minutes and turns to paid on its own once the payment is confirmed.
Emails, account pages and one product feed
A small plugin now brands all 13 WooCommerce emails with the shop's header, colours and type. The My account pages, password reset, "Pay for your order" and order confirmation use our own frame too, while WooCommerce's own forms and checks run inside unchanged.
For selling beyond the website, we built one live product feed from our own site. It reads WooCommerce when it is asked and keeps a copy for at most half an hour, so prices and stock stay current, and it lists 14 items, with every size as its own item. Google Merchant Center reads it daily, and the Pinterest Catalogs tool reads it every night. The Google for WooCommerce plugin could not be used for India, so the feed replaced it and the plugin was removed.
On Pinterest we replaced the 22 old pins with three boards and 10 new pins, each linking to the right page.
Launch day
On launch day we took a fresh database backup, moved WordPress behind the scenes, switched the domain to the Astro build and ran our checks on the real domain: all 20 key URLs, all 11 redirects, live shipping quotes and live stock.
Then we placed a ₹1 order for a hidden test product and paid by UPI with the live Razorpay keys. The branded overlay ran, Razorpay took the payment, WooCommerce marked the order Processing, both emails went out and the thank-you page showed the order as paid. The test product went back to draft straight after.
What changed
| Item | Before | After |
|---|---|---|
| Active WordPress plugins | 29 | 17 switched off |
| Practice work photos | 1,553 on one 3.4 MB page | 36 at a time, on request |
| Product photos | About 200 KB JPG | 20 to 80 KB WebP |
| Key URLs kept | Not applicable | 20 of 20, plus 11 redirects |
| Product feed | None of our own | 14 live items |
| First full build | Not applicable | 25 pages in 5.5 s |
Four problems we hit and how we fixed them
Other headless shops can run into these too.
The checkout could not reach the shop
The cart checks live prices and stock before payment. At first it asked WooCommerce straight from the browser, but the shop runs on another address that does not allow those calls, so the browser blocked them and the cart said "We could not reach the shop". The fix was to let our own server ask WooCommerce and answer the cart, with no change to the shop itself.
Phones cut content at the right edge
On a 412 px phone, the product gallery and buy box were 510 px wide. A grid column set to share space evenly cannot shrink below its widest item, here a strip of six thumbnails. A clipping rule hid the sideways scroll, so a scroll test passed while titles and buttons were cut off. We changed 93 grid columns so they can shrink, then scanned all 23 pages at 360, 375, 390, 412 and 768 px and found nothing past the edge.
Razorpay left the page locked
Razorpay's payment window locks page scrolling while it is open and does not always unlock it. After a closed or failed payment the page could be stuck. We now clear that lock after paying, closing or failing, and after every page change.
Contact emails went to spam
The first contact form sent plain PHP mail with no domain signature, so the messages failed DMARC and the host marked them as spam. It now sends through WooCommerce's mailer and WP Mail SMTP, signed for the shop's own domain, in the branded template, with a copy to the customer.
Is this setup right for your shop?
A headless store is not the answer for every WooCommerce shop, and we would say so on a call. Here is how we would decide.
A normal WooCommerce theme is probably enough if:
- your pages are already reasonably fast and the real problems are stock, shipping or product data;
- you rely on checkout plugins, subscriptions or bookings that live inside the WooCommerce checkout;
- you have no developer to look after a second system.
Headless with Astro pays off when:
- a heavy theme or page builder is what makes the shop slow, as it was here;
- your product links carry traffic you cannot afford to lose, so the rebuild must keep them;
- you want a custom design and checkout without moving orders, reviews and history to a new platform.
If your shop sits in the second group, our Astro website development team can plan it with you, and a full website redesign can start from the same URL freeze we used here. If speed alone is the issue, website performance optimisation on your current setup may be the cheaper first step. You can see the finished shop and its screens on the Roshni's Mehndi Art case study.
Frequently asked questions
Can WooCommerce keep running behind an Astro storefront?
Yes. In this project WooCommerce still prices the cart, works out shipping, stores orders, holds stock and handles refunds, while Astro builds the pages customers see. The shop owner keeps the same admin, and nothing had to be migrated.
Will my product links change if we rebuild in Astro?
They do not have to. We froze the URLs before design started, built every page on its old address, and redirected every old WordPress address type in one hop. On this shop, 20 of 20 key URLs stayed the same.
Is a custom Razorpay checkout safe?
It can be, when the server does the checks. In our build WooCommerce sets the price, our server creates the Razorpay order for that exact total and checks the payment signature with a secret key the browser never sees. If the customer's page never reports back, the Razorpay webhook can still mark the order paid.
Does Shiprocket still work with a headless WooCommerce shop?
Yes. Shiprocket reads paid orders from WooCommerce and sends shipped and delivered updates back to the order. Because the orders still live in WooCommerce, only its store connection needed updating and testing.
Sources
The facts in this article were checked against these pages, last reviewed 27 November 2026.
- Web Vitals, web.devweb.dev/articles/vitals
- On-demand rendering, Astro Docsdocs.astro.build/en/guides/on-demand-rendering/
- Store API, WooCommerce Developer Docsdeveloper.woocommerce.com/docs/apis/store-api/
- Standard checkout integration steps, Razorpay Docsrazorpay.com/docs/payments/payment-gateway/web-integration/standard/integration-steps/
- Webhooks, Razorpay Docsrazorpay.com/docs/webhooks/
- Roshni's Mehndi Art case study, Worklancioworklancio.in/work/roshni-mehndi-art
- Roshni's Mehndi Art, the live shoproshnimehndiart.com/




