Announcement

Collapse
No announcement yet.

Empty Basket on Logout

Collapse
X
 
  • 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
    Code:
    <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]
    www.lesliekirk.com

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

    #2
    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]
    https://www.miva.com

    Comment


      #3
      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:
      Code:
      <mvt:if expr="'LOGO' CIN g.Action">
          <mvt:do file="g.Module_Library_DB" name="l.success" value="Basket_Reset(l.settings:basket)" />
      </mvt:if>
      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
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment

      Working...
      X