后台把商品价格从 399 改成 359,保存提示成功,前台却仍显示 399。把所有缓存清一遍可能暂时见效,但无法说明故障是在价格索引、页面缓存、第三方搜索还是店铺作用域。先用同一 SKU 做一次“数据—索引—输出”对照。

确认改的是前台正在使用的网站范围

SELECT entity_id, sku FROM catalog_product_entity WHERE sku='ABC-001';
SELECT store_id, code, website_id FROM store ORDER BY store_id;
SELECT store_id, value
FROM catalog_product_entity_decimal
WHERE entity_id=123 AND attribute_id=(
 SELECT attribute_id FROM eav_attribute
 WHERE attribute_code='price' AND entity_type_id=(
  SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code='catalog_product'
 )
);

不要照抄 attribute_id。若后台切在另一个网站范围,继续清缓存不会改变目标站点价格。

比较源价格与索引价格

SELECT entity_id, customer_group_id, website_id,
 price, final_price, min_price, max_price
FROM catalog_product_index_price
WHERE entity_id=123
ORDER BY website_id, customer_group_id;

bin/magento indexer:status catalog_product_price
bin/magento indexer:show-mode catalog_product_price
SELECT * FROM mview_state WHERE view_id LIKE '%product_price%';

源属性已经是 359、索引表仍是 399,问题落在 indexer/MView。若模式为 Update by Schedule,继续看 Cron 和 changelog 积压,不要把模式永久改成 Save 来掩盖调度问题。

bin/magento indexer:reindex catalog_product_price
bin/magento indexer:status catalog_product_price

索引正确时再查输出缓存

curl -sk https://shop.example.com/product.html -o /tmp/product.html
grep -nE '359|399|priceAmount' /tmp/product.html | head -n 20
curl -skI https://shop.example.com/product.html | egrep -i 'age|x-cache|x-magento-cache-debug'

HTML 仍是旧价,检查 Full Page Cache、Varnish 和 CDN;HTML 已是新价而组件仍旧,检查 customer-data、价格 box 与本地存储。搜索结果页单独使用搜索索引时,也要验证它和商品详情页是否来自不同数据源。

修复后用匿名用户、登录用户和两个 customer group 各验证一次。启用了 catalog price rule 或 group price 的站点,“某一个账号价格正确”不能代表所有维度都恢复。