Announcement

Collapse
No announcement yet.

Toolkit Forced Login Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Toolkit Forced Login Problem

    HI All,

    I'm having a problem with Toolkit Render/forced login. This code:

    Code:
    <mvt:if expr="basket:cust_id EQ 0">
    <mvt:item name="toolkit" param="vassign|myprodvar|l.all_settings:product:code" /> 
    <mvt:item name="toolkit" param="render|LOGN" />
    <mvt:exit />
    </mvt:if>
    Is run if someone tries to add something to their cart when not logged in. It redirects, but there's no session in the URL, so you have to click the login button twice to login, once to get a session, then once to login. Here's the form:


    Code:
    <form method="post" action="&mvt:global:secure_sessionurl;" class="form-horizontal">
                <mvt:comment>
                <mvt:item name="ratethis" param="logn" />
                </mvt:comment>
                <input type="hidden" name="Store_Code" value="&mvte:store:code;">
                <mvt:if expr="g.Write_Review">
                    <input type="hidden" name="Write_Review" value="1">
                    <input type="hidden" name="Product_Code" value="&mvt:global:Product_Code;">
                </mvt:if>
                <mvt:if expr="g.OrderHistory">
                    <input type="hidden" name="Screen" value="OLST">
                    <mvt:elseif expr="g.myprodvar">
                        <input type="hidden" name="Screen" value="PROD">
                    <mvt:else>
                        <input type="hidden" name="Screen" value="ACOV">
                </mvt:if>
                <input type="hidden" name="Action" value="LOGN">
                <div class="muted-header more-muted">
                    <h5>Log Into an existing account</h5>
                </div>
                <div class="well headless-well">
                    <div class="control-group">
                        <label class="control-label" for="Customer_Login">Login Name</label>
                        <div class="controls">
                            <input type="text"  id="Customer_Login" name="Customer_Login"  value="&mvte:global:Customer_Login;">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Customer_Password">Password</label>
                        <div class="controls">
                            <input type="password" id="Customer_Password" name="Customer_Password" >
                        </div>
                    </div>
                    <div class="control-group">
                        <div class="controls">
                            <button class="btn btn-large btn-info btn-block" type="submit">Login To Account</button>
                        </div>
                    </div>
                </div>
            </form>

    A separate issue is that I'd like to add the product that they tried to add, to their cart after logging in (that's why I'm capturing the product code). Do I need to create a subscreen to do that bit of work, or is their a simpler way?

    Any help greatly appreciated.

    best
    Paul

    #2
    Re: Toolkit Forced Login Problem

    Sorry to be a wet blanket...but this seems backwards. If you are going to require folks to sign in before adding things to the basket (and hope you have a really good reason for that, since most wont)...why not put the test on the "Add to Basket" button.

    Code:
    <mvt:if expr="basket:cust_id EQ 0">
    You must Login Before Adding and Item to the Cart
    --insert login form here--
    <mvt:else>
    <mvt:item name="button" param="AddtoBasket" />
    </mvt:if>
    When you render the Login Form, just make sure Screen=PROD and Product Code = the current product code
    You can then do an "adpr" action through tool kit when the returns to the product page.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Re: Toolkit Forced Login Problem

      Actually Action="LOGN,ADPR" may do it all in one step. You can string multiple functions together. Course you would get unexpected results if one of the actions failed, e.g. bad password.
      Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
      Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
      Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
      Facebook http://www.facebook.com/EmporiumPlus
      Twitter http://twitter.com/emporiumplus

      Comment


        #4
        Re: Toolkit Forced Login Problem

        Fair point Bruce, this site is a medical devices company, and all the shoppers are patients, (they all have accounts). The general public can't shop there,.

        I've since realized that the button action is the way to go, but I didn't know you could string together form actions.

        Many thanks guys, I'll try it out.

        best
        Paul

        Comment


          #5
          Re: Toolkit Forced Login Problem

          No problem. Of course, you have the Login Requirement prominent on the home page<g>?
          Bruce Golub
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


            #6
            Re: Toolkit Forced Login Problem

            Well, we changed the language on the button if you're not logged in, so all add to cart buttons say "Login to Order", as well as the proper upfront messaging.

            Comment

            Working...
            X