How would I add a button to remove an item from the cart?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • teedle
    Mini Mivite

    • Mar 2017
    • 53

    #1

    How would I add a button to remove an item from the cart?

    I was wondering if there was some easy code to also have a remove cart button. My ideal thing would be just a button right under this wish list one here:
    <mvt:if expr="l.settings:group:product:id">
    <p><a href="&mvte:urls:WISH:secure_sep;Action=MPWL&Group _ID=&mvta:group:group_id;">+ Add To Wishlist</a></p>
    </mvt:if>

    But I haven't found what it would be from my googling, thank you
  • kayakbabe
    Mega Mivite




    • Jun 2008
    • 1520

    #2
    The cart itself is tied to the session. So you can’t exacty remove it. You could empty the cart with one button. If you have toolkit, there is a way to do this. In toolkit look for empty basket. It will give you the snippet of code you need.

    Comment

    • heatherwebdev
      Mivite

      • May 2017
      • 157

      #3
      I have a button for deleting the whole cart without using toolkit

      Code:
      <a class="linkbutton btn-xs redbtn" href="&mvt:global:sessionurl;Screen=BASK&SubScreen=TKCLEAR&Action=NEW&Store_Code=&mvta:store:code;"> <i class="fa fa-remove"></i> Empty Cart</a>

      Comment

      • Bruce - PhosphorMedia
        Developer Partner











        • Mar 2006
        • 11256

        #4
        Originally posted by heatherwebdev View Post
        I have a button for deleting the whole cart without using toolkit

        Code:
        <a class="linkbutton btn-xs redbtn" href="&mvt:global:sessionurl;Screen=BASK&SubScreen=TKCLEAR&Action=NEW&Store_Code=&mvta:store:code;"> <i class="fa fa-remove"></i> Empty Cart</a>
        I believe that IS using toolkit.

        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

        • teedle
          Mini Mivite

          • Mar 2017
          • 53

          #5
          I see, thank you guys. I have the toolkit but I'm only really looking for individual item removal. But if there's no simple way it's fine. I was more looking for how like when you subtract an item down to zero it removes it.

          Comment

          • Bruce - PhosphorMedia
            Developer Partner











            • Mar 2006
            • 11256

            #6
            That's simple

            Code:
                                    <form method="post" action="&mvte:urls:BASK:auto;" class="form-inline remove-form" role="form">
                                        <input type="hidden" name="Action" value="RGRP" />
                                        <input type="hidden" name="Basket_Group" value="&mvte:group:group_id;" />
                                        <input type="hidden" name="Offset" value="&mvte:global:Offset;" />
                                        <input type="hidden" name="AllOffset" value="&mvte:global:AllOffset;" />
                                        <input type="hidden" name="CatListingOffset" value="&mvte:global:CatListingOffset;" />
                                        <input type="hidden" name="RelatedOffset" value="&mvte:global:RelatedOffset;" />
                                        <input type="hidden" name="SearchOffset" value="&mvte:global:SearchOffset;" />
                                        <div class="text-center">
                                            <button type="submit" class="button">Remove</button>
                                        </div>
            You probably need to change the button class to something another button on your site uses.
            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

            • Matt Zimmermann
              Mega Mivite










              • Apr 2008
              • 2482

              #7
              The Levels ReadyTheme does ship with a remove item function, however it is hidden via CSS. If you edit the Basket Contents, you can find the form with a class of 'hide' located under the quantity form. If you remove the 'hide' class, the button will show on the basket page. If you wanted, you could move where that form appears in the layout.
              Matt Zimmermann

              Miva Web Developer
              Alchemy Web Development
              https://www.alchemywebdev.com
              Site Development - Maintenance - Consultation

              Miva Certified Developer
              Miva Professional Developer

              https://www.dev4web.net | Twitter

              Comment

              • kayakbabe
                Mega Mivite




                • Jun 2008
                • 1520

                #8
                does levels have a remove all from basket feature? I found the remove line items from the shopping cart. But I want to be able to empty the entire thing. We do wholesale and sometimes our customers want to just start over. Since it is wholesale, they can have 50 or a hundred skus in their cart. deleting one by one is painful.

                I get this question at least once a week from our customers.
                Last edited by kayakbabe; 10-12-18, 09:24 PM.

                Comment

                • Matt Zimmermann
                  Mega Mivite










                  • Apr 2008
                  • 2482

                  #9
                  Levels does not have that function, however it can be added. On the basket page, above the HTML tag, add this code:
                  Code:
                  <mvt:comment>
                      /**
                       * This controls the `Delete Entire Cart` function.
                      */
                  </mvt:comment>
                  <mvt:if expr="g.Clear_Cart">
                      <mvt:do file="g.Module_Library_DB" name="l.settings:result" value="Basket_Reset_Contents( g.Basket )" />
                      <mvt:assign name="l.result" value="miva_output_header( 'Location', l.settings:urls:BASK:auto )" />
                      <mvt:assign name="l.result" value="miva_output_header( 'Status', '302 Moved Temporarily' )" />
                  </mvt:if>
                  Then add a link in your basket content to delete all items:
                  Code:
                  <a href="&mvte:urls:BASK:auto_sep;Clear_Cart=1" title="Delete Entire Cart">Delete Entire Cart</a>
                  This is the same code we use in Shadows.
                  Matt Zimmermann

                  Miva Web Developer
                  Alchemy Web Development
                  https://www.alchemywebdev.com
                  Site Development - Maintenance - Consultation

                  Miva Certified Developer
                  Miva Professional Developer

                  https://www.dev4web.net | Twitter

                  Comment

                  • kayakbabe
                    Mega Mivite




                    • Jun 2008
                    • 1520

                    #10
                    Matt, Thank you! That works perfectly!

                    Comment

                    • lesliekirk
                      Super Moderator











                      • Aug 2008
                      • 9296

                      #11
                      Originally posted by Matt Zimmermann View Post
                      Levels does not have that function, however it can be added. On the basket page, above the HTML tag, add this code:
                      Code:
                      <mvt:comment>
                      /**
                      * This controls the `Delete Entire Cart` function.
                      */
                      </mvt:comment>
                      <mvt:if expr="g.Clear_Cart">
                      <mvt:do file="g.Module_Library_DB" name="l.settings:result" value="Basket_Reset_Contents( g.Basket )" />
                      <mvt:assign name="l.result" value="miva_output_header( 'Location', l.settings:urls:BASK:auto )" />
                      <mvt:assign name="l.result" value="miva_output_header( 'Status', '302 Moved Temporarily' )" />
                      </mvt:if>
                      Then add a link in your basket content to delete all items:
                      Code:
                      <a href="&mvte:urls:BASK:auto_sep;Clear_Cart=1" title="Delete Entire Cart">Delete Entire Cart</a>
                      This is the same code we use in Shadows.
                      Can this code be used somewhat universally to replace the Toolkit snippet? Or is it dependent upon a particular ReadyTheme? (I'm thinking it's universal but I need to ask)
                      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: X | Facebook | Pinterest

                      Comment

                      • Matt Zimmermann
                        Mega Mivite










                        • Apr 2008
                        • 2482

                        #12
                        Hi Leslie,

                        It's universal...as far as I know.
                        Matt Zimmermann

                        Miva Web Developer
                        Alchemy Web Development
                        https://www.alchemywebdev.com
                        Site Development - Maintenance - Consultation

                        Miva Certified Developer
                        Miva Professional Developer

                        https://www.dev4web.net | Twitter

                        Comment

                        Working...
                        X