{"id":228356,"date":"2025-10-05T18:29:57","date_gmt":"2025-10-05T18:29:57","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/hide-product-prices-until-login-for-woocommerce\/"},"modified":"2025-10-05T18:30:52","modified_gmt":"2025-10-05T18:30:52","slug":"hide-product-prices-until-login-for-woocommerce","status":"publish","type":"plugin","link":"https:\/\/da.wordpress.org\/plugins\/hide-product-prices-until-login-for-woocommerce\/","author":23265485,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.2","stable_tag":"1.2.2","tested":"6.7.5","requires":"5.8","requires_php":"7.4","requires_plugins":null,"header_name":"Hide Product Prices Until Login \u2013 for WooCommerce","header_author":"Nelegines","header_description":"A plugin by Nelegines to hide WooCommerce product prices and disable purchasing unless the user is logged in or from an allowed region.","assets_banners_color":"","last_updated":"2025-10-05 18:30:52","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/nelegines.com\/plugins\/hide-prices","header_author_uri":"https:\/\/nelegines.com","rating":0,"author_block_rating":0,"active_installs":10,"downloads":270,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.2.2":{"tag":"1.2.2","author":"nelegines","date":"2025-10-05 18:30:52"}},"upgrade_notice":{"1.2.2":"<p>Added ABSPATH protection to all PHP files to prevent direct access.<\/p>","1.2.1":"<p>Introduces centralized saving and sanitization for settings fields, allowing clean integration with premium extensions and avoiding potential saving bugs.<\/p>","1.2.0":"<p>Added support for user role-based restrictions, improved admin UI, and moved HTML rendering to template files for better extensibility.<\/p>"},"ratings":[],"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.2.2"],"block_files":[],"assets_screenshots":[],"screenshots":{"1":"Settings screen under WooCommerce \u2192 Products \u2192 Hide Prices","2":"Custom message field on product edit screen","3":"Frontend example of price hidden message"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[4124,190088,41177,11917,286],"plugin_category":[45,49],"plugin_contributors":[248786],"plugin_business_model":[],"class_list":["post-228356","plugin","type-plugin","status-publish","hentry","plugin_tags-geolocation","plugin_tags-hide-prices","plugin_tags-login-required","plugin_tags-user-roles","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_category-maps-and-location","plugin_contributors-nelegines","plugin_committers-nelegines"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/hide-product-prices-until-login-for-woocommerce.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p><strong>WooCommerce Hide Prices Until Login or Region<\/strong> 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.<\/p>\n\n<h3>Developer Features<\/h3>\n\n<p>This plugin supports integrations with premium extensions via a global override flag and centralized architecture:<\/p>\n\n<ul>\n<li>Set <code>$GLOBALS['hpulr_force_hide'] = true<\/code> before calling <code>HPULR_Price_Handler::filter_price()<\/code> to trigger the free plugin\u2019s hidden price message<\/li>\n<li>Inject premium settings using <code>hpulr_additional_settings<\/code> filter<\/li>\n<li>Automatically save premium and custom fields via centralized update hook<\/li>\n<li>Sanitize both free and premium fields with centralized filter <code>sanitize_all_options<\/code><\/li>\n<\/ul>\n\n<p>\ud83c\udfaf <strong>Key Features:<\/strong>\n- Hide prices for non-logged-in users\n- Disable Add to Cart for guests\n- Geolocation-based visibility (by allowed countries)\n- User role-based visibility (NEW in 1.2.0)\n- Custom message with <code>{login_url}<\/code> support\n- Redirects users back to the product after login\n- Integrated directly into WooCommerce settings\n- Per-product custom message override (Lite)\n- Test mode for admin previewing behavior\n- Supports all product types (simple, variable, etc.)\n- Centralized saving and sanitization (NEW in 1.2.1)\n- Compatible with premium add-ons (e.g., category-based hiding)<\/p>\n\n<h3>License<\/h3>\n\n<p>This plugin is licensed under the GPLv2 or later.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/hide-product-prices-until-login<\/code> directory or install through the WordPress plugin screen.<\/li>\n<li>Activate the plugin through the \"Plugins\" menu.<\/li>\n<li>Go to <strong>WooCommerce \u2192 Settings \u2192 Products \u2192 Hide Prices<\/strong> to configure.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='can%20i%20add%20a%20login%20link%20in%20the%20message%3F'><h3>Can I add a login link in the message?<\/h3><\/dt>\n<dd><p>Yes! Use the <code>{login_url}<\/code> placeholder in your message. It will be automatically replaced with a clickable link to the login page.<\/p><\/dd>\n<dt id='can%20i%20show%20a%20different%20message%20for%20individual%20products%3F'><h3>Can I show a different message for individual products?<\/h3><\/dt>\n<dd><p>Yes! Edit a product and use the \u201cHide Price Message\u201d field in the sidebar to override the global message.<\/p><\/dd>\n<dt id='will%20it%20redirect%20users%20back%20after%20login%3F'><h3>Will it redirect users back after login?<\/h3><\/dt>\n<dd><p>Yes. After logging in, users are redirected to the product they were viewing.<\/p><\/dd>\n<dt id='can%20i%20simulate%20as%20a%20guest%20while%20logged%20in%3F'><h3>Can I simulate as a guest while logged in?<\/h3><\/dt>\n<dd><p>Yes. Enable \u201cTest Mode\u201d in the plugin settings to preview hidden prices while logged in as an admin.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>\u2705 REFACTOR: Centralized settings saving and sanitization for both free and premium fields<\/li>\n<li>\u2705 NEW: Added filter <code>hpulr_additional_settings<\/code> to allow premium plugins to register their settings<\/li>\n<li>\u2705 NEW: Unified <code>sanitize_all_options<\/code> method for secure value handling<\/li>\n<li>\u2705 FIX: Prevented fatal error when sanitizing array-based inputs<\/li>\n<li>\u2705 REFACTOR: JavaScript update logic for role and category tables generalized<\/li>\n<li>\u2705 Tweak: Updated hidden field support for WooCommerce compatibility<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>\u2705 NEW: Hide prices based on user roles<\/li>\n<li>\u2705 NEW: Dynamic UI to manage restricted roles in admin<\/li>\n<li>\u2705 FIX: Ensures restricted roles are saved as an array<\/li>\n<li>\u2705 FIX: Proper handling of empty state in roles table (no-available-data)<\/li>\n<li>\u2705 FIX: JavaScript updates to restore placeholder row when roles removed<\/li>\n<li>\u2705 REFACTOR: Moved HTML render logic to template files for better maintainability<\/li>\n<li>\u2705 Tweak: Minor styling and JS enhancements for settings UI<\/li>\n<li>\u2705 NEW: Added support for external price hiding override via <code>$GLOBALS['hpulr_force_hide']<\/code><\/li>\n<li>\u2705 NEW: This enables premium add-ons to trigger hidden price logic (e.g., for category-based restrictions)<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>\u2705 NEW: Per-product custom message override<\/li>\n<li>\u2705 NEW: Hide Add to Cart button in product loops<\/li>\n<li>\u2705 NEW: Login redirect after login back to product<\/li>\n<li>\u2705 NEW: Admin Test Mode for debugging<\/li>\n<li>\u2705 Tweak: Global <code>{login_url}<\/code> placeholder replacement<\/li>\n<li>\u2705 Updated: Translatable strings and inline documentation<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release with price hiding and region-based logic<\/li>\n<\/ul>","raw_excerpt":"Hide WooCommerce product prices and Add to Cart buttons unless customers are logged in or from allowed countries or roles.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/228356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=228356"}],"author":[{"embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/nelegines"}],"wp:attachment":[{"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=228356"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=228356"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=228356"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=228356"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=228356"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/da.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=228356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}