內容簡介
PN Scripts Price History for Discounts 外掛專為歐盟商店設計,確保在價格折扣公告時,顯示的最低價格符合法規要求。它記錄每次價格變動,並在折扣下方顯示過去 30 天內的最低價格,確保透明度與合規性。
【主要功能】
• 記錄所有產品及變體的價格變動
• 自動計算符合規定的最低價格
• 支援多種價格更新方式(如 CSV 匯入、REST API 等)
• 90 天的價格歷史記錄(可調整)
• 背景作業自動記錄安裝後的起始價格
外掛標籤
開發者團隊
② 後台搜尋「PN Scripts Price History for Discounts」→ 直接安裝(推薦)
原文外掛簡介
When a shop in the EU announces a price reduction, the prior price it shows must be the lowest price applied during at least the 30 days before the reduction (Price Indication Directive 98/6/EC, Art. 6a, added by the “Omnibus” Directive (EU) 2019/2161).
PN Scripts Price History for Discounts records every price change of your products and variations, works out that lowest prior price and prints it under the price:
Lowest price in the 30 days before the discount: €21.00
It is built around one promise: if the price history cannot prove the number, the plugin shows nothing. No guesses, no “current price” fallbacks.
Records every price change
Simple products, external products and each variation separately, regular and sale price, including the sale schedule.
Every way a price is saved: product editor, quick edit, bulk edit, CSV import, REST API, WP-CLI, WooCommerce’s scheduled sale start and end, and code that calls $product->save(). Price fields written directly to the database by other software are picked up at the end of the request.
Stored in its own database table (not in post meta), only when the price actually changes.
A background job (Action Scheduler) records the starting prices of your catalogue after installation. No catalogue scans on page load.
Keeps 90 days of history by default (configurable, minimum 31) and never deletes prices that a running discount still needs.
Calculates the prior price the way the rules describe it
The period ends when the current discount started, not today.
Progressive discounts (lowering the sale price again) keep the start of the first reduction, so the prior price does not drift down to the previous sale price.
Every price in force during the period counts, including earlier promotions and a lower regular price.
The period is counted in calendar days in your shop’s time zone and is never shorter than 30 days.
New products: hide the notice (strict, default) or, where your country allows a shorter period, use the lowest price since launch.
Perishable goods: optional exemption per product or per category, off by default.
Prices are shown with or without tax exactly like your shop shows its prices.
History gaps (the plugin was inactive, a price was changed outside WooCommerce) are detected and make the result “unknown”.
Shows it in classic and block themes
Product pages, shop and category pages, related products and product blocks (the Product Price block and product collections in block themes such as Twenty Twenty-Five).
The selected variation of a variable product.
Anywhere else with the shortcode [pnscripts_price_history] or [pnscripts_price_history id="123"].
Your own wording with {price}, {days} and {date} placeholders, or the translated default.
Brings your existing history
One-click, read-only import of the price history saved by Omnibus — show the lowest price (iWorks), WC Price History for Omnibus and Omnibus by iLabs (separate plugins by other authors). Imported prices only fill the time before this plugin started recording.
Admin tools
Settings under WooCommerce → Price History, with rule presets (EU strict, Bulgaria, Germany, Poland, custom).
Coverage report: every product and variation on sale, the prior price shown, or why nothing is shown.
A price history table and the computed prior price on the product edit screen.
WP-CLI: wp pnscripts-price-history reference|history|backfill|import|prune.
Compatibility
WooCommerce High-Performance Order Storage (HPOS) and the Cart and Checkout blocks: declared compatible (the plugin does not touch orders or checkout).
Multisite: each site keeps its own history.
Translations included: Bulgarian, Polish, German.
Important
This plugin helps display prices; you remain responsible for compliance. It does not give legal advice and cannot know every national rule. The presets are starting points; check the rules of the countries you sell to.
Privacy
The plugin stores product prices only. It stores no personal data, sets no cookies and makes no external requests.
