Matrace Lema
An online store for a Slovak maker of orthopedic mattresses, sewn to order and to custom sizes, with a showroom near Prešov. I have looked after it since 2023: a move to PrestaShop 8, a new theme, the modules that connect it to the rest of the business, and a mobile PageSpeed score that went from about 40 to over 90.
- Client
- Matrace Lema, Slovakia
- My role
- Development, integrations, performance
- Timeline
- 2023 to now
- Stack
- PrestaShop 8.2, PHP, Smarty, JavaScript, MySQL, custom modules

The brief
Matrace Lema has made mattresses for twenty years. The store sells about 165 products: mattresses in any size, pillows, duvets, merino blankets and herbal products, with a showroom in Župčany. It ran on PrestaShop 1.7 with a bought theme and no link to the company’s accounting system.
What I did
- Upgraded PrestaShop 1.7.8 to 8.2.3 with my own database migration, based strictly on the official upgrade scripts.
- Replaced the bought theme with a lean child theme of the classic one.
- Wrote the store’s own modules, 38 of them so far. The four below do the most work.
- Performance work in several rounds since 2023. Mobile PageSpeed went from about 40 to over 90; the most recent pass alone moved Lighthouse from 79 to 91.

On a phone
- PageSpeed since 2023~40 → 90+
- Lighthouse, last pass79 → 91
- Total blocking time~500 → under 120 ms
- Images854 → 264 kB
- JavaScript896 → 651 kB
- Icon font61 → 5 kB
Performance, before and after
Modules I wrote for the shop
- Custom size configurator.A mattress is sold by the centimetre. The customer types width and length, the price is recalculated from the area, and the custom size becomes a real product combination, so the cart, the order and the invoice treat it like any other size.
- MKSoft ERP sync.MKSoft is the ERP the company runs its products and orders in. The module imports the catalogue from it and exports orders back as XML over FTP on a schedule, with a history of every transfer in the admin. The custom size travels inside the order line, so production reads “90x200cm, height 17” instead of “custom”.
- Home Credit instalments.A calculator on the product page, instalments as a payment method at checkout, and the applications handled inside PrestaShop. If the application is declined, the customer keeps the cart and lands back on the payment step.
- AI descriptions and SEO texts.A module that drafts product descriptions and SEO texts and extracts parameters from supplier data, using OpenAI and Anthropic models, with the result edited in the admin before it goes live.
The rest are smaller: rich snippets, Google reviews, redirects, a loyalty programme, abandoned-cart follow-up and an llms.txt so AI search engines can read the catalogue.
Problems worth mentioning
- Analytics wait for the visitor.Tag Manager, and the pixels it pulls in, are held back until the first interaction, with a five-second fallback. The order confirmation page is exempt, so conversions still count.
- 228 kB of jQuery UI for one slider.The platform loads the whole jQuery UI bundle whatever a page asks for. An override skips it except on category pages, where the price slider needs it.
- An icon font with 1,272 glyphs, 126 used.Subset with
pyftsubsetfrom a glyph list read out of the font’s own substitution table, so ligature icons keep working. 61 kB became 5 kB. - Instalments that get declined.When Home Credit rejects an application, the customer used to lose their checkout. The module now rebuilds the cart session and returns them to the payment step, with an ownership check so nobody can take over someone else’s cart.
- Custom sizes that reach the workshop.A mattress made to measure is a product with free-form dimensions. The ERP sync writes the size into the order line, so production sees it without opening the store.