How can I limit the number of products to be displayed on home page?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
один год назад
nopcommerce 4/50

\Vews\Home\Index.cshtml
@await Component.InvokeAsync("Widget", new { widgetZone = PublicWidgetZones.HomepageBeforeProducts })
        @await Component.InvokeAsync("HomepageProducts")


how can i allow displaying only 5 products on home page?

all products are displayed on home page by default
один год назад
Unfortunately there is no such settings to control it. You have to ensure by yourself that ShowOnHomepage is enable only on 5 products.
один год назад
The admin Product edit page has a setting "Show on home page".  If selected, it will show without limitation.  You need to manually unselect it.  (Or, you can use SQL to UPDATE as needed.)
один год назад
Mahbubur Rahman wrote:
Unfortunately there is no such settings to control it. You have to ensure by yourself that ShowOnHomepage is enable only on 5 products.


ok, thanks. i found solution for this one.

can you help me also. how can i display current customer login in _AdminLayout.cshtml?

i'll appreciate it if you'd help me
один год назад
arthur_shneider wrote:

can you help me also. how can i display current customer login in _AdminLayout.cshtml?

please describe more. do you want to show the total logged-in customer? it's already showing the logged-in customer's full name & avatar at _AdminLayout.cshtml.
один год назад
Rashed Khan wrote:

can you help me also. how can i display current customer login in _AdminLayout.cshtml?
please describe more. do you want to show the total logged-in customer? it's already showing the logged-in customer's full name & avatar at _AdminLayout.cshtml.


no, i just want to show current customer login on Admin side on _AdminLayout.cshtml (on the very top)

like this
current logged user's login: agoodguy

i use this for showing user id

@{
int user_id = (await iWorkContext.GetCurrentCustomerAsync()).Id;
}

then in body i use @user_id


it works fine

i need the same like this but for login
один год назад
Rashed Khan wrote:

can you help me also. how can i display current customer login in _AdminLayout.cshtml?
please describe more. do you want to show the total logged-in customer? it's already showing the logged-in customer's full name & avatar at _AdminLayout.cshtml.


can you help me please?
один год назад
arthur_shneider wrote:

can you help me please?

Please describe more what do you mean by for login ?
один год назад
Rashed Khan wrote:

can you help me please?
Please describe more what do you mean by for login ?


sorry, i gues i had to use the word username instead of login :) that's why you didn't understand me. sorry, it's my mistake)

go here: https://admin-demo.nopcommerce.com/Admin/Setting/CustomerUser
then: Customer settings
then go to tab: Account
'Usernames' enabled

this is login
один год назад
you can use @currentCustomer.Username at _AdminLayout.cshtml
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.