How to Stay on the Category Page After an Item Has Been Added to the Cart.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Brennan
    Super Moderator









    • Jun 2009
    • 3481

    #16
    Re: How to Stay on the Category Page After an Item Has Been Added to the Cart.

    Yes here are the docs:

    http://docs.miva.com/v1.0/docs/uri-m...-documentation
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment

    • ids
      Developer Partner








      • Mar 2006
      • 2171

      #17
      Re: How to Stay on the Category Page After an Item Has Been Added to the Cart.

      Stupid question maybe: Does this new functionality break all the forms I've configured in the past to stay on the same page when doing ADPR?

      Scott
      Need to offer Shipping Insurance?
      Interactive Design Solutions https://www.myids.net
      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
      Competitive Rates, Custom Modules and Integrations, Store Integration
      AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
      My T-shirt Collection is mostly MivaCon T-shirts!!

      Comment

      • Brennan
        Super Moderator









        • Jun 2009
        • 3481

        #18
        Re: How to Stay on the Category Page After an Item Has Been Added to the Cart.

        By Default, nothing changes. However if you explicitly update the forms actions to use the the URI Management variables (&mvte:urls:CTGY:rr;) then it is possible you need to modify the form inputs.
        Brennan Heyde
        VP Product
        Miva, Inc.
        [email protected]
        https://www.miva.com

        Comment

        • jsmirnow
          Mini Mivite

          • Sep 2015
          • 20

          #19
          Re: How to Stay on the Category Page After an Item Has Been Added to the Cart.

          Works great ... Saved me! Almost ...

          Is there a way to give the user a message that a product has been added to the cart and stay on the same page?

          Comment

          • lesliekirk
            Super Moderator











            • Aug 2008
            • 9304

            #20
            Originally posted by fastees View Post
            Re: How to Stay on the Category Page After an Item Has Been Added to the Cart.

            this works with attributes:

            <form method="post" action="&mvte:category:link;">
            <input type="hidden" name="Action" value="ADPR" />
            <input type="hidden" name="Quantity" value="1" />
            <input type="hidden" name="Product_Code" value="&mvte:product:code;" />
            <mvt:item name="buttons" param="AddToBasketE" />
            </form>
            This method seems to reload the selected attribute into all the other attributes on the page. It might freak someone out, I know I was by it. So what is the best way to stay on the CTGY page that has attributes being added to the basket and have it clear the previously selected attributes when the page reloads?
            Last edited by lesliekirk; 01-15-16, 12:14 PM.
            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

            • titlehere
              Mini Mivite

              • Dec 2007
              • 82

              #21
              Are you using the "Quick View" readytheme function from the category screen? If so, you can pass whatever variables in the data-product-link of the quickview link, including screen or category codes. That way you can retain offset, customer-selected filters and searches, etc.

              As for a "cart success" message, all you need to do is add a detection for the ADPR action to your CTGY header (or wherever you want it to appear) and style it appropriately:

              Code:
              <mvt:if expr="g.Action EQ 'ADPR' AND l.settings:messages:error_message_count EQ 0">
              I can't speak to the attribute portion since I filter customers to product pages for attribute selection, but I would imagine using the quick view function instead of embedding attribute selections on the CTGY pages would solve this since quick view of product is loaded independently of the category products.

              Comment

              • fastees
                Mivite

                • Dec 2007
                • 194

                #22
                I have another issue in the same topic here. I have attributes on a cat page with a default option. It adds to cart fine and resolves back to the cat page fine but the default options are no longer selected except for the one that I added to cart originally. Here is the form code and some screen shots.

                <form method="post" action="&mvte:global:sessionurl;Screen=CTGY">
                <input type="hidden" name="Old_Screen" value="&mvte:global:Screen;" />
                <input type="hidden" name="Old_Search" value="&mvte:global:Search;" />
                <input type="hidden" name="Action" value="ADPR" />
                <input type="hidden" name="Store_Code" value="&mvte:store:code;" />
                <input type="hidden" name="Product_Code" value="&mvte:product:code;" />
                <input type="hidden" name="Category_Code" value="&mvte:global:category_code;" />
                <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;" />


                atts1.jpgatts2.jpg
                Last edited by fastees; 03-28-17, 11:57 AM.

                Comment

                • fastees
                  Mivite

                  • Dec 2007
                  • 194

                  #23
                  Not sure why these images are so small. I picked large. I can email if need be.

                  Comment

                  • fastees
                    Mivite

                    • Dec 2007
                    • 194

                    #24
                    This is a work around but it leaves ?reload at the end of the url

                    <script type="text/javascript">
                    if (location.href.indexOf('reload')==-1)
                    {
                    location.href=location.href+'?reload';
                    }
                    </script>

                    Comment

                    • fastees
                      Mivite

                      • Dec 2007
                      • 194

                      #25
                      No help here?

                      Comment

                      • lesliekirk
                        Super Moderator











                        • Aug 2008
                        • 9304

                        #26
                        It sounds like you are having the issue I'm having with a CTGY page that has attributes and can be ordered from. When the page reloads all the products have the same attribute previously selected. It can be seen here: https://www.unfinished-kitchen-cabin...WN1KB-BCP.html



                        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

                        • fastees
                          Mivite

                          • Dec 2007
                          • 194

                          #27
                          Actually my issue is the opposite sort of. I have the least amount of a set of measurements as the default. When you add to cart the default selection is not selected anymore throughout the category. I used the above work around but it adds ?reload to the end of the url after adding to cart. Here:

                          Comment

                          • fastees
                            Mivite

                            • Dec 2007
                            • 194

                            #28
                            I guess we're on our own here, right?

                            Comment

                            • lesliekirk
                              Super Moderator











                              • Aug 2008
                              • 9304

                              #29
                              My javascript foo is weak but I think the snippet you are using is doing exactly what it's being told to do:

                              Code:
                              <script type="text/javascript">
                              if (location.href.indexOf('reload')==-1)
                              {
                              location.href=location.href[COLOR=#FF0000][B]+'?reload';[/B][/COLOR]
                              }
                              </script>
                              Try removing the javascript and changing

                              Code:
                              <form method="post" action="&mvte:global:sessionurl;Screen=CTGY">
                              to

                              Code:
                              <form method="post" action="&mvte:category:link;">
                              or an equivalent that uses the category code in the action link.

                              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

                              • fastees
                                Mivite

                                • Dec 2007
                                • 194

                                #30
                                That is what I'm doing. It does add to cart and land back on the cat page but the form has not completely resolved. You have to reload the page for the default attribute selections to refresh. There's got to be a fix for this. It's the same situation when you add to cart on some other pages in miva and then refresh your page, you get a pop up asking you if "Are you sure you want to send a form again?" Something during the add to cart process is not completely resolving.

                                Comment

                                Working...
                                X