The Dynamic Access extension offers you from Shopware version 6.4.6.0 in cooperation with the Rule Builder the possibility to hide certain contents of your store depending on the rules.
In our example configuration, we support an online store that offers souvenirs for Germany, Austria and Switzerland. Accordingly, our customers come from these three countries and should be shown different categories with different articles.
For example, we would like to offer customers from Germany only the specialties from the countries Austria and Switzerland, but not the specialties from our own country. Accordingly, the view should also affect logged-in customers from Austria and Switzerland.
At first we create three rules below Settings > Rule Builder.
In our example, we name the rules Customers from Germany, Customers from Austria and Customers from Switzerland. Within each rule, we need a condition that identifies the customer according to the country of origin. In this case, we use the condition Billing country > Is one of and add the country of the corresponding rule here.
For the rule Customers from Germany this looks as follows:
Within our store we create below Catalogues > Categories the following three new categories, which should be displayed later depending on the billing country. The three categories will be created below the main category of our store:
- Specialties from Germany
- Specialties from Austria
- Specialties from Switzerland
Next, we perform the configuration of the new category Specialties from Germany.
Within this category, under the General tab, we find the Dynamic Access item. In this field, all the rules of the Rule Builder are now available to us. In order to determine which customers should have access to this category, we now select our created rules Customers from Austria and Customers from Switzerland here and save.
From now on, this category will be displayed only for logged-in customers who have set Austria or Switzerland as the billing country.
Finally, we can adjust the configuration for the categories Specialties from Austria and Specialties from Switzerland and store the desired rules in the Dynamic Access field.
As requested, from now on the categories will be displayed according to the billing address of the logged in customer. As a customer who is not logged in, none of the categories will be displayed.
In order for the products within the categories to be displayed only to the corresponding customers via the search, we still have to assign the Dynamic Access rules to the corresponding products via Catalogues > Products. Otherwise, it would still be possible for all items to be accessible via the search, which is not desired in our example.
To do this, we simply open the products in question and select the corresponding rules under the General tab under the item Visibility & structure> Dynamic Access:
Thus, we have achieved that depending on the billing country, different categories are displayed to our customers in the store. We could now add another category to which we do not store a Dynamic Access rule, so that this is then available to customers who are not yet logged in.
Another example is the creation of a category (e.g. VIP), which is only displayed to customers who have already placed x orders or who belong to a certain customer group.
In this case, the first thing we need to do is to create another rule in the Rule Builder. Conceivable here would be the condition Count of orders > Is greater than/equal to > 100.
We can now assign this new rule to any category or any article again, as described in example 1, and thus make it available only to certain customers.
For a newly created category, this could then look as follows:
This category is thus only displayed to customers who have already placed at least 100 orders.
Based on the examples, we can see that the Dynamic Access extension allows us to show and hide a wide variety of content relatively quickly and easily. With the help of the Rule Builder, this can be mapped for a wide variety of scenarios.