{"id":2908,"date":"2026-11-08T13:22:58","date_gmt":"2026-11-08T13:22:58","guid":{"rendered":"https:\/\/dygistic.com\/?page_id=2908"},"modified":"2026-11-08T13:22:58","modified_gmt":"2026-11-08T13:22:58","slug":"prestashop-price-architecture-sql","status":"publish","type":"page","link":"https:\/\/dygistic.com\/nl\/work\/prestashop-price-architecture-sql\/","title":{"rendered":"Technical case: fixing a catalogue-wide price structure in PrestaShop with SQL"},"content":{"rendered":"<style data-wp-block-html=\"css\">.dy-seo-page{--slate:#1C2333;--slate-mid:#2E3F5C;--slate-ink:#0F1420;--sky:#4A90B8;--sky-deep:#3B7A9E;--sky-soft:#7AB4D6;--sky-light:#EEF3F8;--off-white:#F5F7FA;--white:#FFFFFF;--rule:rgba(28,35,51,0.08);--rule-strong:rgba(28,35,51,0.14);--ink:#1C2333;--ink-70:rgba(28,35,51,0.72);--ink-55:rgba(28,35,51,0.55);--ink-40:rgba(28,35,51,0.4);font-family:\"Plus Jakarta Sans\",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--ink);line-height:1.6;margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);-webkit-font-smoothing:antialiased}.dy-seo-page *,.dy-seo-page *::before,.dy-seo-page *::after{box-sizing:border-box}.dy-seo-page img,.dy-seo-page svg{display:block;max-width:100%}.dy-seo-page a,.entry-content .dy-seo-page a,.ast-single-post .entry-content .dy-seo-page a,.ast-single-post .entry-content .dy-seo-page a:hover{color:inherit;text-decoration:none}.dy-seo-page .wrap{max-width:1200px;margin:0 auto;padding:0 clamp(24px,5vw,72px)}.dy-seo-page .wrap-narrow{max-width:860px}.dy-seo-page .section{padding:clamp(56px,7vw,88px) 0}.dy-seo-page .eyebrow{display:inline-flex;align-items:center;gap:10px;font-size:11px;font-weight:700;letter-spacing:.22em;text-transform:uppercase;color:var(--sky-deep);margin-bottom:18px}.dy-seo-page .eyebrow::before{content:\"\";width:20px;height:1px;background:var(--sky);display:block}.dy-seo-page .title{font-size:clamp(26px,3.6vw,40px);font-weight:700;letter-spacing:-0.025em;line-height:1.1;color:var(--slate);margin-bottom:18px}.dy-seo-page .lead{font-size:17px;font-weight:300;color:var(--ink-70);line-height:1.65;max-width:62ch}.dy-seo-page .bg-off{background:var(--off-white)}.dy-seo-page .btn{display:inline-flex;align-items:center;gap:10px;font-size:14.5px;font-weight:600;letter-spacing:-0.005em;padding:14px 24px;border-radius:10px;cursor:pointer;border:1px solid transparent;transition:transform .15s,background .2s,box-shadow .2s,color .2s}.dy-seo-page .btn-primary{background:var(--sky);color:var(--white)}.dy-seo-page .btn-primary:hover{background:var(--sky-deep);box-shadow:0 10px 28px rgba(74,144,184,.35)}.dy-seo-page .btn-outline{background:transparent;color:var(--white);border-color:rgba(255,255,255,.22)}.dy-seo-page .btn-outline:hover{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.4)}.dy-seo-page .seo-hero{position:relative;background:radial-gradient(1200px 500px at 85% -10%,rgba(74,144,184,.22),transparent 60%),radial-gradient(900px 400px at -10% 110%,rgba(74,144,184,.08),transparent 60%),linear-gradient(180deg,var(--slate-ink),var(--slate));color:var(--white);overflow:hidden}.dy-seo-page .hero-inner{padding:clamp(56px,8vw,88px) 0 clamp(120px,14vw,160px);text-align:center}.dy-seo-page .hero-eyebrow{display:inline-flex;align-items:center;gap:10px;font-size:11px;font-weight:600;letter-spacing:.22em;text-transform:uppercase;color:rgba(255,255,255,.55);margin-bottom:24px;justify-content:center}.dy-seo-page .hero-eyebrow::before{content:\"\";width:20px;height:1px;background:var(--sky);display:block}.dy-seo-page .hero-h1{font-size:clamp(34px,5.4vw,62px);font-weight:800;letter-spacing:-0.035em;line-height:1.04;color:var(--white);max-width:18ch;margin:0 auto}.dy-seo-page .hero-h1 em{font-style:normal;background:linear-gradient(180deg,var(--sky-soft),var(--sky));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.dy-seo-page .hero-sub{margin:22px auto 0;max-width:58ch;font-size:17px;font-weight:300;line-height:1.65;color:rgba(255,255,255,.72)}.dy-seo-page .tool-section{margin-top:clamp(-90px,-10vw,-120px);position:relative;z-index:2;padding-bottom:clamp(40px,6vw,64px)}.dy-seo-page .tool-panel{background:var(--white);border:1px solid var(--rule-strong);border-radius:20px;padding:clamp(18px,3vw,28px);box-shadow:0 30px 80px rgba(15,20,32,.14)}.dy-seo-page .tool-panel .dyt-form{border:0;box-shadow:none;padding:0;background:transparent}.dy-seo-page .tool-panel .dyt-url{background:var(--off-white)}.dy-seo-page .metric-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:32px}@media (max-width:860px){.dy-seo-page .metric-grid{grid-template-columns:1fr}}.dy-seo-page .metric-card{padding:26px 24px;background:var(--white);border:1px solid var(--rule);border-radius:14px}.dy-seo-page .mc-abbr{font-size:11px;font-weight:700;letter-spacing:.22em;color:var(--sky);margin-bottom:10px}.dy-seo-page .mc-title{font-size:17px;font-weight:700;color:var(--slate);margin-bottom:8px;letter-spacing:-0.01em}.dy-seo-page .mc-text{font-size:13.5px;color:var(--ink-70);line-height:1.6}.dy-seo-page .mc-good{display:inline-block;margin-top:12px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#1F8F5F;background:#E6F5EE;padding:5px 10px;border-radius:999px}.dy-seo-page .tips{display:grid;grid-template-columns:repeat(2,1fr);gap:16px;margin-top:32px}@media (max-width:760px){.dy-seo-page .tips{grid-template-columns:1fr}}.dy-seo-page .tip{padding:24px;background:var(--white);border:1px solid var(--rule);border-radius:14px}.dy-seo-page .tip-title{font-size:15px;font-weight:700;color:var(--slate);margin-bottom:8px}.dy-seo-page .tip p{font-size:13.5px;color:var(--ink-70);line-height:1.6;margin:0}.dy-seo-page .tip ul{margin:8px 0 0;padding-left:18px;font-size:13.5px;color:var(--ink-70)}.dy-seo-page .tip li{margin:4px 0}.dy-seo-page .other-tools{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}.dy-seo-page .other-tools a{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border:1px solid var(--rule-strong);border-radius:999px;font-size:13.5px;font-weight:600;color:var(--slate);background:var(--white);transition:border-color .2s,background .2s}.dy-seo-page .other-tools a:hover{border-color:var(--sky);background:var(--sky-light);color:var(--sky-deep)}.dy-seo-page .cta-block{padding:clamp(40px,6vw,64px);border-radius:24px;background:radial-gradient(800px 300px at 90% -20%,rgba(74,144,184,.22),transparent 60%),linear-gradient(135deg,var(--slate-ink),var(--slate));color:var(--white);position:relative;overflow:hidden;display:grid;grid-template-columns:1.2fr 1fr;gap:48px;align-items:center}@media (max-width:820px){.dy-seo-page .cta-block{grid-template-columns:1fr;gap:28px}}.dy-seo-page .cta-h{font-size:clamp(26px,3.4vw,38px);font-weight:700;letter-spacing:-0.025em;line-height:1.12;color:var(--white);margin:0 0 14px}.dy-seo-page .cta-p{font-size:16px;color:rgba(255,255,255,.7);line-height:1.65;max-width:44ch;margin:0}.dy-seo-page .cta-right{display:flex;flex-direction:column;align-items:flex-start;gap:20px}.dy-seo-page .cta-detail{font-size:13.5px;color:rgba(255,255,255,.65);line-height:1.85;border-left:2px solid var(--sky);padding-left:14px}.dy-seo-page .case-hero .hero-inner{text-align:left;padding-bottom:clamp(56px,7vw,80px)}.dy-seo-page .case-hero .hero-eyebrow{justify-content:flex-start}.dy-seo-page .case-hero .hero-h1{margin:0;max-width:22ch}.dy-seo-page .case-hero .hero-sub{margin-left:0}.dy-seo-page .case-meta{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:rgba(255,255,255,.08);border-top:1px solid rgba(255,255,255,.08)}@media (max-width:780px){.dy-seo-page .case-meta{grid-template-columns:repeat(2,1fr)}}.dy-seo-page .cm{padding:22px clamp(20px,3vw,40px);background:var(--slate-ink)}.dy-seo-page .cm-l{font-size:11px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;color:rgba(255,255,255,.45);margin-bottom:6px}.dy-seo-page .cm-v{font-size:14.5px;font-weight:600;color:var(--white);line-height:1.4}.dy-seo-page .case-body{display:grid;grid-template-columns:1fr 1.6fr;gap:56px;align-items:start}@media (max-width:900px){.dy-seo-page .case-body{grid-template-columns:1fr;gap:28px}}.dy-seo-page .case-body h2{font-size:clamp(22px,2.6vw,30px);font-weight:700;letter-spacing:-.02em;color:var(--slate);margin:0 0 12px;line-height:1.15}.dy-seo-page .case-body p{font-size:16px;color:var(--ink-70);line-height:1.7;margin:0 0 16px}.dy-seo-page .case-body ul{margin:0 0 16px;padding-left:20px;color:var(--ink-70);font-size:15.5px;line-height:1.65}.dy-seo-page .case-body li{margin:6px 0}.dy-seo-page .case-body code{font-size:13px;background:var(--sky-light);color:var(--sky-deep);padding:2px 6px;border-radius:5px}.dy-seo-page .case-side{position:sticky;top:96px}@media (max-width:900px){.dy-seo-page .case-side{position:static}}.dy-seo-page .ba{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:8px 0 24px}@media (max-width:640px){.dy-seo-page .ba{grid-template-columns:1fr}}.dy-seo-page .ba-card{padding:22px;border-radius:14px;border:1px solid var(--rule);background:var(--white)}.dy-seo-page .ba-card.after{border-color:rgba(74,144,184,.35);background:var(--sky-light)}.dy-seo-page .ba-l{font-size:11px;font-weight:700;letter-spacing:.2em;text-transform:uppercase;color:var(--ink-55);margin-bottom:8px}.dy-seo-page .ba-card.after .ba-l{color:var(--sky-deep)}.dy-seo-page .ba-t{font-size:14.5px;color:var(--ink);line-height:1.55}.dy-seo-page .kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:0 0 24px}@media (max-width:640px){.dy-seo-page .kpis{grid-template-columns:1fr}}.dy-seo-page .kpi{padding:18px;border-radius:12px;background:var(--white);border:1px solid var(--rule);border-top:3px solid var(--sky)}.dy-seo-page .kpi-n{font-size:28px;font-weight:800;letter-spacing:-.03em;color:var(--slate)}.dy-seo-page .kpi-l{font-size:12.5px;color:var(--ink-70);margin-top:2px}.dy-seo-page .todo{background:#FBF1DF;border:1px dashed #B8771A;color:#7a4e0b;border-radius:10px;padding:12px 14px;font-size:13px;margin:0 0 24px}.dy-seo-page .case-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:32px}@media (max-width:900px){.dy-seo-page .case-grid{grid-template-columns:1fr}}.dy-seo-page .case-card{display:flex;flex-direction:column;padding:30px 28px;background:var(--white);border:1px solid var(--rule);border-radius:16px;transition:transform .2s,box-shadow .2s,border-color .2s;color:inherit}.dy-seo-page a.case-card:hover{transform:translateY(-3px);box-shadow:0 24px 60px rgba(15,20,32,.08);border-color:rgba(74,144,184,.3);color:inherit}.dy-seo-page .cc-cat{font-size:11px;font-weight:700;letter-spacing:.22em;color:var(--sky);margin-bottom:12px;text-transform:uppercase}.dy-seo-page .cc-title{font-size:20px;font-weight:700;color:var(--slate);margin-bottom:10px;letter-spacing:-0.01em;line-height:1.2}.dy-seo-page .cc-text{font-size:14px;color:var(--ink-70);line-height:1.6;margin-bottom:18px;flex:1}.dy-seo-page .cc-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px}.dy-seo-page .cc-tags span{font-size:11.5px;font-weight:600;padding:4px 9px;border-radius:999px;background:var(--off-white);color:var(--ink-70)}.dy-seo-page .cc-arrow{font-size:13px;font-weight:600;color:var(--sky-deep)}.dy-seo-page .cat-head{margin-top:56px}.dy-seo-page .cat-head .title{margin-bottom:8px}<\/style>\n<div class=\"dy-seo-page\">\n<section class=\"seo-hero case-hero\">\n<div class=\"wrap hero-inner\">\n<div class=\"hero-eyebrow\">Technical case &middot; <a href=\"\/nl\/work\/\" style=\"color:inherit\">All work<\/a><\/div>\n<h1 class=\"hero-h1\">Fixing a <em>catalogue-wide price problem<\/em> in PrestaShop with SQL<\/h1>\n<p class=\"hero-sub\">Base prices at zero, the real price stored in the default combination, multistore on top. How I corrected the price structure at database level instead of product by product.<\/p>\n<\/div>\n<div class=\"case-meta\"><div class=\"cm\"><div class=\"cm-l\">Period<\/div><div class=\"cm-v\">Early 2026<\/div><\/div><div class=\"cm\"><div class=\"cm-l\">Environment<\/div><div class=\"cm-v\">E-commerce, multistore<\/div><\/div><div class=\"cm\"><div class=\"cm-l\">Platform<\/div><div class=\"cm-v\">PrestaShop 8, MySQL<\/div><\/div><div class=\"cm\"><div class=\"cm-l\">Disciplines<\/div><div class=\"cm-v\">Database analysis, SQL, e-commerce development<\/div><\/div><\/div>\n<\/section>\n<section class=\"section\">\n<div class=\"wrap\">\n<div class=\"case-body\">\n<div class=\"case-side\">\n<div class=\"eyebrow\">In short<\/div>\n<h2 style=\"font-size:clamp(24px,3vw,34px)\">One query beats a thousand clicks.<\/h2>\n<p>When a data problem is structural, the fix should be structural too. This webshop showed the right prices on the front end, but the database stored them in a way that made every price change, discount and export error-prone.<\/p>\n\n<\/div>\n<div>\n<h2>The problem<\/h2><p>In <code>ps_product<\/code> en <code>ps_product_shop<\/code> the base price of the products was <code>0<\/code>. The actual selling price lived entirely in the price impact of the default combination. The storefront showed the right amount, so the problem was invisible to customers, but anything that reads the base price works with a zero. With multistore active, every product also exists in several shop contexts, which makes a partial fix easy and dangerous.<\/p><h2>Diagnosis<\/h2><ul><li>Mapped how PrestaShop builds a final price: base price plus the impact of the selected combination, per shop context.<\/li><li>Identified the default combination of each product (<code>default_on = 1<\/code>) and confirmed it carried the full price.<\/li><li>Listed which product, shop and combination tables needed the same change, so the fix could not drift between shop contexts.<\/li><\/ul><h2>The fix<\/h2><ul><li>Used the price of the default combination as the new base price of each product.<\/li><li>Recalculated the price impact of every other combination as the difference to that base, so the price a customer pays stays the same.<\/li><li>Applied the change at both product and shop level, and checked the multistore logic separately.<\/li><li>Cleared the PrestaShop cache after the database changes.<\/li><\/ul>\n<h2>Before and after<\/h2>\n<div class=\"ba\"><div class=\"ba-card\"><div class=\"ba-l\">Before<\/div><div class=\"ba-t\">Base price 0, combinations carried the full selling price. Every tool that reads the base price saw a zero.<\/div><\/div><div class=\"ba-card after\"><div class=\"ba-l\">After<\/div><div class=\"ba-t\">A correct base price per product, combinations carry only the real difference. Same prices for customers, a consistent structure underneath.<\/div><\/div><\/div>\n<h2>What this means for you<\/h2>\n<p>Webshop platforms let you build a catalogue that looks right and is wrong underneath. If your feeds, discounts or reports disagree with your storefront, the database is where I start. See <a href=\"\/nl\/diensten\/seo\/ecommerce-seo\/\">e-commerce SEO<\/a> for what else I check on webshops.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<section class=\"section\" style=\"padding-top:0\">\n<div class=\"wrap\">\n<div class=\"cta-block\">\n<div>\n<h2 class=\"cta-h\">Something in your catalogue does not add up?<\/h2>\n<p class=\"cta-p\">Prices, stock, categories or URLs that look fine on the front end and wrong everywhere else usually have one structural cause. I find it and fix it at the source.<\/p>\n<\/div>\n<div class=\"cta-right\">\n<a href=\"\/nl\/contact\/\" class=\"btn btn-primary\">Start a conversation<\/a>\n<div class=\"cta-detail\">One consultant, start to finish.<br>Developer-ready deliverables.<br>NL, BE, DE and UK markets.<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Base prices at zero, the real price stored in the default combination, multistore on top. How I corrected the price structure at database level instead of product by product.<\/p>","protected":false},"author":1,"featured_media":0,"parent":2906,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-2908","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/pages\/2908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/comments?post=2908"}],"version-history":[{"count":1,"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/pages\/2908\/revisions"}],"predecessor-version":[{"id":2977,"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/pages\/2908\/revisions\/2977"}],"up":[{"embeddable":true,"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/pages\/2906"}],"wp:attachment":[{"href":"https:\/\/dygistic.com\/nl\/wp-json\/wp\/v2\/media?parent=2908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}