Topdata Topdata Docs

TopdataPrivateShopSW6

Introduction

Welcome to the user manual for the Topdata Private Shop plugin for Shopware 6.

This plugin provides two primary functions to turn a public Shopware store into a private, members-only shop:

  1. Private Shop Mode: Restricts what non-logged-in users can see, ranging from hiding only prices to hiding all products and categories.
  2. Disable Registration: Completely deactivates the customer registration form, requiring administrators to create new customer accounts manually.

This manual will guide you through the installation and configuration of these features.

Installation Guide

Follow these steps to install and activate the plugin in your Shopware 6 environment.

1. System Requirements

  • Shopware 6.7 or higher
  • PHP 8.2 or higher

2. Plugin Installation

  1. Clone or download this repository into your shop’s custom/plugins/ directory. The final path should be custom/plugins/TopdataPrivateShopSW6.
  2. Connect to your server via SSH and navigate to your Shopware root directory.
  3. Refresh the plugin list to make Shopware aware of the new plugin:
    bin/console plugin:refresh
  4. Install and activate the plugin. The -ac flags will automatically activate it and clear the cache.
    bin/console plugin:install TopdataPrivateShopSW6 -ac

3. Theme Configuration (Crucial Step)

For the plugin’s visibility rules to work correctly, you must register its template directory in your active storefront theme.

  1. Locate the theme.json file for your active theme. This is typically found in custom/plugins/MyTheme/src/Resources/theme.json.
  2. Find the "views" array within the configuration.
  3. Add @TopdataPrivateShopSW6 to the end of this array. This ensures its templates have the final say on what gets hidden.

Example theme.json:

{
  "name": "MyTheme",
  // ... other settings
  "views": [
    "@Storefront",
    "@Plugins",
    "@MyTheme",
    "@TopdataPrivateShopSW6" // <-- Add this line at the end
  ],
  // ... other settings
}
  1. After saving the theme.json file, you must recompile your theme for the changes to take effect:
    bin/console theme:compile

The installation is now complete. You can proceed to the plugin configuration.

Plugin Configuration

All settings for the Topdata Private Shop plugin can be found in the Shopware Administration under Extensions > My extensions > Topdata Private shop > Configuration.

The plugin offers two main settings:

Private Shop Mode

This setting controls what non-logged-in (guest) users can see on the storefront.

  • Hide Categories and Products: This is the most restrictive mode.

    • The main navigation menu is hidden.
    • Category pages are inaccessible and will redirect to the login page.
    • Product detail pages are inaccessible and will redirect to the login page.
    • Product sliders and product boxes on landing pages are hidden.
    • The cart widget, prices, and “Add to Cart” buttons are hidden everywhere.
  • Hide Products: In this mode, guests can browse categories, but cannot see products.

    • Category pages are visible, but product listings are replaced with a “Product is visible after login” placeholder.
    • Product detail pages are inaccessible and will redirect to the login page.
    • Search results are inaccessible and will redirect to the login page.
    • The cart widget, prices, and “Add to Cart” buttons are hidden everywhere.
  • Hide Prices: In this mode, guests can browse all categories and products, but cannot see prices or make purchases.

    • All product and category pages are visible.
    • All prices are replaced with a “Login to see prices” link.
    • All “Add to Cart” buttons are hidden or replaced with a login link.
    • The cart widget is hidden.
  • Hide Nothing: The plugin’s private shop functionality is disabled. All users can see all content, prices, and can add products to the cart. The shop behaves like a standard public store.

Disable Registration

This is a boolean switch to control new customer registrations.

  • Enabled (Checked): The customer registration form is hidden on the /account/login page and during the checkout process. A message is displayed informing the user that registration is disabled.
  • Disabled (Unchecked): The standard Shopware registration form is available to all users.

Frequently Asked Questions (FAQ)

Q: I’ve set the plugin to “Hide Prices”, but everything is still visible to guests. What’s wrong?

A: The most common reason for this is a missing or incorrect theme configuration. You must add @TopdataPrivateShopSW6 to the views array in your theme’s theme.json file and then recompile the theme. Please see the Installation Guide for detailed instructions on this crucial step.

Q: Can I disable registration for one Sales Channel but not another?

A: No. The plugin settings are global and apply to all Sales Channels active in your Shopware environment.

Q: If registration is disabled, how do I create new customer accounts?

A: You must create new customer accounts manually through the Shopware Administration. Navigate to Customers > Overview and click the “Add customer” button.

Q: Will this plugin hide content from search engine bots like Google?

A: Yes. Because the plugin redirects non-logged-in users (which includes bots) away from protected pages or hides content directly in the template, that content will not be accessible for indexing. This is ideal for a truly private shop.