chat

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 年 前
hello,

is it possible to make chat available to registered customers only.

Regards,
13 年 前
lubish wrote:
hello,

is it possible to make chat available to registered customers only.

Regards,


By default this feature is not available in nopCommerce but still you can accomplish this by doing some addition/modification.

I am assuming that you have configured the live chat script in the admin section.

Go to MasterPage (TwoColumn or ThreeColumn - whichever you are using)

Comment out this code from your masterpage:

<nopCommerce:LiveChatBlock ID="ctrlLiveChatBlock" runat="server" />


By commenting it out, live chat won't be available to everyone (i.e non-registered customers).
Now create/add a new aspx page in your project.

Let's assume you name it as LiveChat.aspx

Now add the live chat module in this page (same module code that you commented on your masterpage)

<nopCommerce:LiveChatBlock ID="ctrlLiveChatBlock" runat="server" />


Also, at the top of the page add this reference also:

<%@ Register TagPrefix="nopCommerce" TagName="LiveChatBlock" Src="~/Modules/LiveChatBlock.ascx" %>


Now go to .cs file of this new page, LiveChat.aspx.cs

Use this code so that only registered users/members will be able to view the content of this page ( which will be live chat)

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Caching;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NopSolutions.NopCommerce.BusinessLogic;
using NopSolutions.NopCommerce.BusinessLogic.Localization;
using NopSolutions.NopCommerce.BusinessLogic.Payment;
using NopSolutions.NopCommerce.BusinessLogic.SEO;
using NopSolutions.NopCommerce.Common.Utils;

namespace NopSolutions.NopCommerce.Web
{
    public partial class LiveChat : BaseNopFrontendUserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (NopContext.Current.User == null || NopContext.Current.User.IsGuest)
            {
                string loginURL = SEOHelper.GetLoginPageUrl(true);
                Response.Redirect(loginURL);
            }
        }
    }
}




Now, go back to your master page > same place where you commented the live chat module > Now add a image button or hyperlink > link it with the new page "LiveChat.aspx"

Re-built your project and test it - it should work !!!

Now if anyone on your homepage will click on the link/image button > they will be navigated to live chat page > since you have added the above mentioned code, the page will ask the member to login first.

Let me know if you face any problem.
13 年 前
getting the following error

Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

Source Error:

Line 19: namespace NopSolutions.NopCommerce.Web
Line 20: {
Line 21:     public partial class LiveChat : BaseNopFrontendUserControl
Line 22:     {
Line 23:         protected void Page_Load(object sender, EventArgs e)


Source File: e:\web\kropdesi\Chat.aspx.cs    Line: 21

regards
12 年 前
Change your .cs code with this:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Caching;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NopSolutions.NopCommerce.BusinessLogic;
using NopSolutions.NopCommerce.BusinessLogic.Configuration.Settings;
using NopSolutions.NopCommerce.BusinessLogic.Content.Forums;
using NopSolutions.NopCommerce.BusinessLogic.CustomerManagement;
using NopSolutions.NopCommerce.BusinessLogic.Orders;
using NopSolutions.NopCommerce.BusinessLogic.Payment;
using NopSolutions.NopCommerce.BusinessLogic.SEO;
using NopSolutions.NopCommerce.Common.Utils;
using NopSolutions.NopCommerce.BusinessLogic.Infrastructure;
namespace NopSolutions.NopCommerce.Web
{


    public partial class LiveChat : BaseNopFrontendPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CommonHelper.SetResponseNoCache(Response);

            if (NopContext.Current.User == null || NopContext.Current.User.IsGuest)
            {
                string loginURL = SEOHelper.GetLoginPageUrl(true);
                Response.Redirect(loginURL);
            }

          
        }

    }
}


Let me know if you face any problem...
12 年 前
Hi Team,

Can any one please provide step by step to configure or integrate chat feature in NOPCommerce.
Hoping for kind reply from your end. Please help me in this regard.

Also provide solutions to below things
1. What will happen when a user provides information in contactus section
2. Let say I want to provide promotions to NOPCommerce user stating if they buy more than 1000$ on my site & they should get discount of 5% some thing similar kind..


Please provide your valuable input.


Thanks,
Prakash
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.