Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 8 of 8

Thread: add to cart button disabled

  1. #1
    dev.folks is offline Junior Member
    Join Date
    Apr 2010
    Posts
    20

    Default add to cart button disabled

    Hi,

    I have just installed the code and activated minicart from admin panel by setting the Minicart.UseAjaxAddToCart AppConfig to true.

    After making the above changes if i click on addtocart button in frontend. addtocart button is getting disabled. in explorer its showing javascript error.



    Message: 'ActionService' is undefined
    Line: 165
    Char: 17
    Code: 0
    URI: http://localhost/aspdnf/jscripts/product.js



    Please do let me know whether is that problem in code.


    Thanks in advance
    Raghav
    Store version: 9.0.1.3

  2. #2
    ZachJ85 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philadelphia, PA
    Posts
    99

    Default

    I had this issue before, I'm trying to remember what I did to resolve the issue. Have you tried from an outside source, not just inside the network? Sometimes the machine might have security set too high, that fixed it once but not the first time. Possible a path reference?

    Just tossing out ideas that might hold you over until I can remember the answer or until support replies.

    I'll try and remember and get back to you.
    SQL 2008, Visual Studio 2010
    Source: C#
    Version: AspDotNetStorefront ML 8.0.1.1/8.0.1.1
    Framework: .Net 4.0 (Running)

  3. #3
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi Raghav

    Are you seeing this problem on a page other than an individual product page?

    I've seen this issue before in v9 when the Add To Cart button is used on pages other than the product page (for example Category pages).

    From memory, it was caused because those pages aren't including the Script Manager functions that are required to process the button post back events.

    If you look at the file 'showproduct.aspx.cs', you'll see a method called:
    public override bool RequireScriptManager()

    This is the method that's missing from showcategory.aspx.cs - if you add it, then AddToCart should work.

    Of course, I may have completely misunderstood your issue and am rambling on with the wrong solution!

  4. #4
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Webopius,

    Im having the same problem and its on the manufacturer page ... it works fine on the product page.

    I have added the following to my showmanufacturer.cs

    Code:
            /// <summary>
            /// Registers the required scripts and webservice references
            /// </summary>
            /// <param name="scrptMgr"></param>
            public override void RegisterScriptAndServices(ScriptManager scrptMgr)
            {
                scrptMgr.Scripts.Add(new ScriptReference("~/jscripts/product.js"));
                if (AppLogic.AppConfigBool("Minicart.UseAjaxAddToCart"))
                {
                    scrptMgr.Services.Add(new ServiceReference("~/actionservice.asmx"));
                }
            }
    
    
    
            /// <summary>
            /// Sets that this page requires a scriptmanager
            /// </summary>
            public override bool RequireScriptManager
            {
                get
                {
                    return true;
                }
            }

  5. #5
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi

    If you let me know the link of the page, I'll take a look.
    Adam

  6. #6
    thijs_K_softtech is offline Junior Member
    Join Date
    Jan 2011
    Posts
    2

    Default ActionService undefined

    Hi There,

    been working for hours now on a small problem where it says ActionService undefined. I tried the solutions in this thread, but for some reason it keeps saying that ActionService is undefined at the line where the object is created.

    var ActionService = new ActionService();

    Am I missing some sort of JS include?

  7. #7
    Jordan is offline Member
    Join Date
    Feb 2006
    Posts
    42

    Default

    I have (and am again) experiencing this issue. This time, it was triggered when I renamed the Admin folder -- for some peculiar reason this caused the ActionService variable issue.

    In the past, I've just rolled back to a prior version. It's now problematic enough for me to dig deeper -- I'll post my findings. Any other possible solutions would be greatly appreciated.


    Regards,

    Jordan.

  8. #8
    Jordan is offline Member
    Join Date
    Feb 2006
    Posts
    42

    Default

    I'm not really sure what change I made could have broken this behavior, but I resolved it with the following addition:

    Changed from

    Code:
    	<%-- Only render for pages that require ajax --%>
    	<asp:ScriptManager ID="scrptMgr" runat="server">
    	</asp:ScriptManager>
    To:
    Code:
    	<%-- Only render for pages that require ajax --%>
    	<asp:ScriptManager ID="scrptMgr" runat="server">
            <Services>
                 <asp:ServiceReference Path="~/ActionService.asmx" InlineScript="true" />
            </Services>
    	</asp:ScriptManager>

    I made this change in my template.master file.