Menu

We moved ERP company pricing from Magento + Redis to commercetools. The cache layer just disappeared.
📰

We moved ERP company pricing from Magento + Redis to commercetools. The cache layer just disappeared.

DEV Community: nextjs·Sohel Rana·about 6 hours ago
#ftPxOAjZ
#devtonextjs#devto#dev#price#group
Reading 0:00
15s threshold

Every B2B merchant I work with has the same pricing story: "Each company has its own prices, with quantity breaks, and they come from the ERP every night."

On one Magento (Adobe Commerce) project, that story looks like this:

ERP ─► SQL ─► nightly sync script ─► Redis/KeyDB ─► pricing API ─► Magento ▲ one JSON blob per company cached in MariaDB, warmed on every request tier prices injected into products by a plugin listing prices loaded by AJAX so full-page cache still works

Enter fullscreen mode

Exit fullscreen mode

It works. It's also four moving parts whose only job is to answer "what does this company pay for this SKU?"

So for Forgeline v1.3.0 , my open-source commercetools storefront, I rebuilt that pricing model natively. Here's what I learned.

👉 Live demo: https://forgeline-storefront-gamma.vercel.app

💻 Code: https://github.com/sohelrana09/forgeline-storefront

📦 Release: https://github.com/sohelrana09/forgeline-storefront/releases/tag/v1.3.0

1. Don't port the cache.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.