Skip to content

Power Discount 1.1.1

Choose a tag to compare

@lukehsuhao lukehsuhao released this 17 Apr 09:47
· 25 commits to master since this release

🐛 Bug Fix

  • 修正 條件免運 規則在購物車/結帳頁「已套用折扣」面板顯示 -NT$1.00 的問題,現在會正確顯示顧客實際節省的運費金額。

🔧 技術細節

  • FreeShippingStrategy 原本回傳 sentinel amount 1.0(因為折扣聚合需要 amount > 0),而 UI 顯示層直接讀取造成錯誤顯示。
  • 改由 ShippingHookswoocommerce_package_rates 過濾時對 chosen shipping rate 即時計算實際扣除金額,並以購物車商品雜湊作為有效性標記,持久化到 WC session。
  • AppliedRulesDisplay 顯示 shipping scope 項目時改從 session 讀取真實金額覆蓋 sentinel。
  • 採用「商品組成雜湊」(不含 chosen shipping method / fees)確保 add-to-cart 與 cart render 兩個 request 間資料能對齊。

⬆️ 升級方式

已安裝 1.0.x 的站台:WordPress 後台 → 外掛 → 有可用更新 → 直接點「立即更新」即可。


Full Changelog: v1.0.3...v1.1.1