No announcement yet.

Empty Basket on Logout

  • Filter
  • Time
  • Show
Clear All
new posts

  • Empty Basket on Logout

    So is this still the only way to clear a basket at logout?

    With the Emporium Plus Tool Kit you can reduce the chance of this happening by changing the logout link to
    <a href="&mvt:global:sessionurl;Action=NEW,LOGO&SubSc reen=TKCLEAR&Screen=SFNT&Store_Code=&mvta:global:S tore_Code;">Logout</a>
    I have a store that needs the logged in basket to be cleared when the customer logs out.

    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

  • There is a native function which will do it too. You can wrap it in a conditional and put it globally or the page they land on after they logout

    <mvt:do file="g.Module_Library_DB" name="l.success" value="Basket_Reset(l.settings:basket)" />
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]


    • Just a follow-up to Brennan's answer: you want to be a little careful how you use this, so that users only encounter it when they're actually logging out. If you redirect customers to the Storefront page after they log out, you can't just put this line of code in your SFNT template. You need to either have a special landing page for customers who log out, or wrap the code with an mvt:if such as:
      <mvt:if expr="'LOGO' CIN g.Action">
          <mvt:do file="g.Module_Library_DB" name="l.success" value="Basket_Reset(l.settings:basket)" />
      This will ensure that the basket reset is only done if the customer actually clicked a Logout link.

      Another possibility, if you have Modulator or one of the other utilities that can do pre-actions, is to do the basket reset in a pre-action triggered by the LOGO action code. That's a little more reliable than doing it on a regular page template. It's less likely to be accidentally altered or removed; it won't get clobbered by a new ReadyTheme; etc.

      Also, for the above code to work, you need to have data in the l.settings:basket variable; that will depend on the page template and what components it uses. If you write g.Basket instead of l.settings:basket, I think it will work on any page in the store.
      Kent Multer
      Magic Metal Productions
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:



      This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

      This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.