Missing products for certain users?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
We've started having a problem with one of our sites where certain users can search for products or view a category and see all the products like normal. However, some users have now started having issues where no products are displayed. In the example of the category the pages still show but there are no products on the page. Even guests can see products as normal, there’s just a selection of users who cannot.

I have checked the ACL rules, in fact I turned the entire system off to make sure that wasn't the issue. I also analysed the execution of the stored procedure for loading products and both customers are returned the same result. I checked the view on the conditions in which it will show the grid and it seems the view is being sent 0 products, but the paged list is still being provided.

Below are two screenshots of the same category but one is a working customer and one is not.

Bad


Good


NopCommerce version is 3.8, fair number of plugins some built by us but none that should effect this. I have tried looking through the SearchProducts method in the ProductService but I can't identify anything that would remove the products for certain users, all the ACL rules seem to be in the stored procedure.

Any help will be greatly appreciated!
4 years ago
Hello,

The pager indicates there are loaded products for this customer - 4 pages of them in fact but they aren't visible to you. Have you inspected the HTML of the page to see if the products are there but are hidden with CSS somehow?
Also, have you done any modifications to the CategoryTemplate.ProductsInGridOrLines.cshtml file?

Regards,
Anton
4 years ago
Nop-Templates.com wrote:
Hello,

The pager indicates there are loaded products for this customer - 4 pages of them in fact but they aren't visible to you. Have you inspected the HTML of the page to see if the products are there but are hidden with CSS somehow?
Also, have you done any modifications to the CategoryTemplate.ProductsInGridOrLines.cshtml file?

Regards,
Anton


Thanks for your reply, below is the markup where the product list should be in CategoryTemplate.ProductsInGridOrLines.cshtml:

        @if (Model.Products.Count > 0)
        {
            <div class="@(Model.PagingFilteringContext.ViewMode == "list" ? "product-list" : "product-grid")">
                <div class="item-grid">
                    @foreach (var product in Model.Products)
                    {
                        <div class="item-box">
                            @Html.Partial("_ProductBox", product)
                        </div>
                    }
                </div>
            </div>
        }


As you can see this is completely unedited by it seems the products list has no products in it as it's this block of HTML that isn't shown for the customer, as seen below:

Working Customer (Some trimming where the ellipses(...) are)
<div class="page-body">
    ...        
    <div class="product-grid">
        <div class="item-grid">
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
            <div class="item-box">...</div>
        </div>
    </div>
    <div class="pager">
        <ul><li class="current-page"><span>1</span></li><li class="individual-page"><a href="/Hand-Towels---Folded?pagenumber=2">2</a></li><li class="individual-page"><a href="/Hand-Towels---Folded?pagenumber=3">3</a></li><li class="individual-page"><a href="/Hand-Towels---Folded?pagenumber=4">4</a></li><li class="next-page"><a href="/Hand-Towels---Folded?pagenumber=2">Next</a></li></ul>
    </div>
</div>


Not Working Customer
<div class="page-body">
    <div class="product-filters">
    </div>
    <div class="pager">
        <ul><li class="current-page"><span>1</span></li><li class="individual-page"><a href="/Hand-Towels---Folded?pagenumber=2">2</a></li><li class="individual-page"><a href="/Hand-Towels---Folded?pagenumber=3">3</a></li><li class="individual-page"><a href="/Hand-Towels---Folded?pagenumber=4">4</a></li><li class="next-page"><a href="/Hand-Towels---Folded?pagenumber=2">Next</a></li></ul>
    </div>
</div>


As you can see the product-grid element isn't even there which is what makes me think no products are sent to the view but the pager is getting them somehow?
4 years ago
It's also worth noting the customers that can't see the grid/list can view the product if they go to the link directly.
4 years ago
Hi,
Same here, I'm in testing about 1 week ago, I created two product where I play with customer role/tier price.

I not have selected guest as customer role on product, but only registered and here it's good because guest can see product but not price.

Today I look at my website with guest without change anything and guest cannot see the product where 1week ago he can see it.

What happend ?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.