Show rewards point in header

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
How can show the remaining reward points in header?
6 years ago
Hello,

Yes it is possible without customization in c# code.

From work context you can get current customer than through that customer you can get reward point.

You just display dynamic label in header.

Everything done in view page.
6 years ago
Actually there isn't any reward point in "current customer".
6 years ago
Dear Sohel,

Thanks.
He solved the problem:

@using Nop.Services.Orders
@using Nop.Core
@inject IRewardPointService rewardPointService
@inject IWorkContext workContext
@inject IStoreContext storeContext
@{
    var rewardPoints = rewardPointService.GetRewardPointsBalance(workContext.CurrentCustomer.Id, storeContext.CurrentStore.Id);
}

in Nop.Web\Views\Shared\Components\HeaderLinks\default.cshtml

Thanks again sohel.
Best Regards.
6 years ago
oortaj wrote:
Dear Sohel,

Thanks.
He solved the problem:

@using Nop.Services.Orders
@using Nop.Core
@inject IRewardPointService rewardPointService
@inject IWorkContext workContext
@inject IStoreContext storeContext
@{
    var rewardPoints = rewardPointService.GetRewardPointsBalance(workContext.CurrentCustomer.Id, storeContext.CurrentStore.Id);
}

in Nop.Web\Views\Shared\Components\HeaderLinks\default.cshtml

Thanks again sohel.
Best Regards.




You are most welcome.

Note: Above solution for Nopcommerce 4.00
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.