內容簡介
總結:Price Shortcode for WooCommerce 是一個方便的外掛,讓您能夠使用 [psfw_price] 彈性的短碼插入商品價格,支援隱藏或顯示貨幣符號、展示特價及平常價格,以及為變動產品自訂價格範圍輸出。以下提供一組問題與答案:
1. Price Shortcode for WooCommerce 可以使用哪個簡短代碼來插入商品價格?
- [psfw_price]
2. 請列出 Price Shortcode for WooCommerce 的特點有哪些?
- 可以使用產品的 ID 或 SKU 進行定位
- 安全的 SKU 回退邏輯:數字值首先被視為產品 ID;只有在 ID 和 SKU 都不符時,才會嘗試 SKU 查找。
- 可以選擇顯示或隱藏貨幣符號。
- 特價時可以劃掉原價。
- 提供變動產品的靈活價格範圍顯示,可以強制顯示完整範圍、僅顯示最低價、或僅顯示最高價。
- 可以在管理員中設置默認選項。
- 可選擇在刪除時刪除設置。
- 如果 WooCommerce 未啟用,系統將優雅地退化,前端不顯示任何內容,並提供管理警告。
- 通過基本的 SKU 緩存,環輕,簡潔,友好開發者。
- 完全國際化並準備好進行翻譯。
外掛標籤
開發者團隊
② 後台搜尋「Price Shortcode for WooCommerce」→ 直接安裝(推薦)
原文外掛簡介
Price Shortcode for WooCommerce lets you insert product prices using a flexible shortcode: [psfw_price]. It supports showing or hiding the currency symbol, displaying sale and regular prices, and customizable price range output for variable products.
Features:
Use ID or SKU to target products
Safe SKU fallback logic: numeric values are treated as product IDs first; SKU lookup is attempted only if no product matches the ID and the SKU is unique.
Show/hide currency symbol.
Strike-through regular price if on sale.
Flexible price range display for variable products:
Use price_range="force" to always display the full range (min–max) even if both values are the same.
Use price_range="min" to display only the lowest variation price.
Use price_range="max" to display only the highest variation price.
Defaults to WooCommerce’s auto range behavior if not specified.
Set default options in the admin.
Optionally delete settings on uninstall.
Gracefully degrades if WooCommerce is not active — shows nothing on the frontend, with an admin warning.
Lightweight, clean, and developer-friendly, with basic SKU caching.
Fully internationalized and ready for translation.
