Developer forum

Forum » Ecommerce - Standard features » Assortments - Product is hidden in nav, but accessible via direct link

Assortments - Product is hidden in nav, but accessible via direct link

Andrew Rushworth
Reply

I have a set of products that I've put into an assortment for a specific customer.
There are no other Assortments set up.
I enabled the "Assortments on Frontend" checkbox and rebuilt the assortment.

We don't use the product navigation in the menu, but have custom pages for each group/category.
As expected, only the customer can find the product (searching or ecom catalog's).

However, anyone that has the direct url for the product can still access the product.

Is there a way to prevent direct access to the product?


Replies

 
Andrew Rushworth
Reply

example: 
https://www.arcstore.co.za/products/addict-lipstick can be accessed even though it is part of an assortment and cannot be searched.

 

 
Andrew Rushworth
Reply

we are using verion 9.17.7

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Andrew

Yes - this is registered as bug 23681 on DW10 - I just merged it to 9.20 and it will be in the next hotfix of 9.20.

You can add something like this to your template if you want to handle it without an upgrade:

var user = User.GetCurrentUser(PagePermissionLevels.Frontend);

if (!Services.Assortments.HasAccessToProduct(product, user))
{
    <h1>Product not in assortment</h1>
}
 
Andrew Rushworth
Reply

Thanks, much appreciated.

 

You must be logged in to post in the forum