WordPress.org

Hong Kong 香港中文

  • 佈景主題
  • 外掛
  • News
  • Support
  • About
  • 重要通知
  • WordPress 常見問題
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

Hide Product Prices Until Login – for WooCommerce

  • Submit a plugin
  • My favorites
  • Log in
  • Submit a plugin
  • My favorites
  • Log in

Hide Product Prices Until Login – for WooCommerce

由nelegines
下載
  • 詳情
  • 評價
  • 安裝
  • 開發
支援

描述

WooCommerce Hide Prices Until Login or Region helps store owners control who can see prices and add products to their cart. Useful for wholesale stores, restricted content, or region-specific pricing policies.

Developer Features

This plugin supports integrations with premium extensions via a global override flag and centralized architecture:

  • Set $GLOBALS['hpulr_force_hide'] = true before calling HPULR_Price_Handler::filter_price() to trigger the free plugin’s hidden price message
  • Inject premium settings using hpulr_additional_settings filter
  • Automatically save premium and custom fields via centralized update hook
  • Sanitize both free and premium fields with centralized filter sanitize_all_options

🎯 Key Features:
– Hide prices for non-logged-in users
– Disable Add to Cart for guests
– Geolocation-based visibility (by allowed countries)
– User role-based visibility (NEW in 1.2.0)
– Custom message with {login_url} support
– Redirects users back to the product after login
– Integrated directly into WooCommerce settings
– Per-product custom message override (Lite)
– Test mode for admin previewing behavior
– Supports all product types (simple, variable, etc.)
– Centralized saving and sanitization (NEW in 1.2.1)
– Compatible with premium add-ons (e.g., category-based hiding)

License

This plugin is licensed under the GPLv2 or later.

安裝

  1. Upload the plugin files to the /wp-content/plugins/hide-product-prices-until-login directory or install through the WordPress plugin screen.
  2. Activate the plugin through the “Plugins” menu.
  3. Go to WooCommerce → Settings → Products → Hide Prices to configure.

常見問題

Can I add a login link in the message?

Yes! Use the {login_url} placeholder in your message. It will be automatically replaced with a clickable link to the login page.

Can I show a different message for individual products?

Yes! Edit a product and use the “Hide Price Message” field in the sidebar to override the global message.

Will it redirect users back after login?

Yes. After logging in, users are redirected to the product they were viewing.

Can I simulate as a guest while logged in?

Yes. Enable “Test Mode” in the plugin settings to preview hidden prices while logged in as an admin.

評價

There are no reviews for this plugin.

貢獻者及開發者

“Hide Product Prices Until Login – for WooCommerce” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者
  • nelegines

將 Hide Product Prices Until Login – for WooCommerce 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

修改日誌

1.2.1

  • ✅ REFACTOR: Centralized settings saving and sanitization for both free and premium fields
  • ✅ NEW: Added filter hpulr_additional_settings to allow premium plugins to register their settings
  • ✅ NEW: Unified sanitize_all_options method for secure value handling
  • ✅ FIX: Prevented fatal error when sanitizing array-based inputs
  • ✅ REFACTOR: JavaScript update logic for role and category tables generalized
  • ✅ Tweak: Updated hidden field support for WooCommerce compatibility

1.2.0

  • ✅ NEW: Hide prices based on user roles
  • ✅ NEW: Dynamic UI to manage restricted roles in admin
  • ✅ FIX: Ensures restricted roles are saved as an array
  • ✅ FIX: Proper handling of empty state in roles table (no-available-data)
  • ✅ FIX: JavaScript updates to restore placeholder row when roles removed
  • ✅ REFACTOR: Moved HTML render logic to template files for better maintainability
  • ✅ Tweak: Minor styling and JS enhancements for settings UI
  • ✅ NEW: Added support for external price hiding override via $GLOBALS['hpulr_force_hide']
  • ✅ NEW: This enables premium add-ons to trigger hidden price logic (e.g., for category-based restrictions)

1.1.0

  • ✅ NEW: Per-product custom message override
  • ✅ NEW: Hide Add to Cart button in product loops
  • ✅ NEW: Login redirect after login back to product
  • ✅ NEW: Admin Test Mode for debugging
  • ✅ Tweak: Global {login_url} placeholder replacement
  • ✅ Updated: Translatable strings and inline documentation

1.0.0

  • Initial release with price hiding and region-based logic

其它

  • Version 1.2.2
  • Last updated 1 個月之前
  • Active installations 少於10
  • WordPress version 5.8 or higher
  • Tested up to 6.7.4
  • PHP version 7.4 or higher
  • Language
    English (US)
  • Tags
    geolocationhide priceslogin requireduser roleswoocommerce
  • 進階顯示

評分

No reviews have been submitted yet.

Add my review

See all reviews

貢獻者

  • nelegines

支援

有話想說?需要協助?

檢視支援論壇

  • 關於我們
  • 最新消息
  • 寄存
  • 隱私權
  • 展示網站
  • 佈景主題
  • 外掛
  • 區塊版面配置
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • Events
  • Donate ↗
  • Five for the Future
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

Hong Kong 香港中文

  • Visit our X (formerly Twitter) account
  • Visit our Bluesky account
  • Visit our Mastodon account
  • Visit our Threads account
  • 訪問我們的 Facebook 專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • Visit our TikTok account
  • Visit our YouTube channel
  • Visit our Tumblr account
代碼就是詩歌。