Announcement

Collapse
No announcement yet.

Multi-Product Add To Cart Button reloads page

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

    Multi-Product Add To Cart Button reloads page

    I had previously posted my question as part of another question and felt it might be better to separate them.

    The store is using the EmporiumPlus Toolkit to create the ability to order from the CTGY page. I am updating the page to be able to use the Multi-Product Add To Cart Button (using the coding from here). The only problem with the coding is that it reloads the page giving the appearance that the page is "jumping" back to the top.them.

    Is there a way to convert this into something that will not make the page "jump" but if it has to reload, it reloads back to the product or products that were last added to the cart?

    Code:
    <form method="post" action="&mvte:global:sessionurl;Screen=CTGY">
      <input type="hidden" name="Action" value="ADPM">
      <input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;" />
      <table class="subcat">
        <tr>
          <td colspan="4"><a name="&mvt:sub_category2:code;"></a>
            <h2 style="margin-bottom:4px; font-family:Arial, Helvetica, sans-serif; font-size:16px;"><!-- &mvt:sub_category2:name;-->&mvt:sub_category2:name;&nbsp;&nbsp;<span style="background-color: #FF0000; color:#FFFF00;"><font size="2"> </font><a href="/&mvt:category:code;.html#top"> <font size="2" color="#FFFF00">Back to top</font></a>&nbsp;</span></h2></td>
        </tr>
        <tr class="red-bg">
          <td></td>
          <td><b>Name</b></td>
          <td><b>Price</b></td>
          <td>&nbsp;</td>
        </tr>
        <mvt:foreach iterator="sub_product" array="sub_products">
          <tr valign="top">
            <td><mvt:if expr="NOT ISNULL l.settings:sub_product:thumbnail"> <img src="&mvte:sub_product:thumbnail;" alt="&mvt:sub_product:name;" title="&mvt:sub_product:name;">
                <mvt:else>
                &nbsp; </mvt:if></td>
            <td>&mvt:sub_product:name;</td>
            <td>&mvt:sub_product:formatted_price;</td>
            <td class="item-buttons" style="text-align:right;"><input type="hidden" name="Products[ &mvt:sub_product:id; ]:code" value="&mvte:sub_product:code;">
              <input type="text" name="Products[ &mvt:sub_product:id; ]:quantity" value="0"></td>
          </tr>
          <tr>
            <td colspan="4" style="border-bottom:#000 solid 1px;"></td>
          </tr>
        </mvt:foreach>
        <tr>
          <td colspan="3"><input type="submit" value="Add to Basket"></td>
        </tr>
      </table>
    </form>
    Or is there a better ReadyTheme to consider? The site is rather "customized".



    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
    Hi Leslie,

    You would have to utilize JavaScript for this; something akin to the standard AJAX Add to Cart. To the best of my knowledge, none of the ReadyThemes have this functionality built into a category page.
    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


      #3
      Originally posted by Matt Zimmermann View Post
      Hi Leslie,

      You would have to utilize JavaScript for this; something akin to the standard AJAX Add to Cart. To the best of my knowledge, none of the ReadyThemes have this functionality built into a category page.
      Hey Matt, I am reworking this into Colossus (it's enabling me to do a few nifty things with the mini-basket) but I'm still stuck on the add to cart thing. What would happen if I changed the body ID to js-PROD?
      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

      Comment


        #4
        Hi Leslie,

        In Colossus, if you changed the body ID for the category page the page would die a horrible death, many errors would be thrown, and mayhem would ensue. Since I have not released a quick-view or multi-Ajax-add extension for the new ReadyThemes, you would have to develop your own code for controlling the form. Those extensions are in the queue, however they won't be worked on until next year.
        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


          #5
          Originally posted by Matt Zimmermann View Post
          Hi Leslie,

          In Colossus, if you changed the body ID for the category page the page would die a horrible death, many errors would be thrown, and mayhem would ensue. Since I have not released a quick-view or multi-Ajax-add extension for the new ReadyThemes, you would have to develop your own code for controlling the form. Those extensions are in the queue, however they won't be worked on until next year.
          Sigh, it's needed yesterday. Should I contact Professional Services?
          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

          Comment


            #6
            Hi Leslie,

            That may be a good course of action.
            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


              #7
              Originally posted by Matt Zimmermann View Post
              Hi Leslie,

              That may be a good course of action.
              Thanks. I am so close but sooooo far away.
              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

              Comment


                #8
                Originally posted by Matt Zimmermann View Post
                Hi Leslie,

                In Colossus, if you changed the body ID for the category page the page would die a horrible death, many errors would be thrown, and mayhem would ensue. Since I have not released a quick-view or multi-Ajax-add extension for the new ReadyThemes, you would have to develop your own code for controlling the form. Those extensions are in the queue, however they won't be worked on until next year.
                Curiosity got to me, I changed the body ID (in Colossus) for this page I'm trying to makeover. It didn't kill it but it still doesn't stay on the page when clicked add to cart. This wasn't a multi-add attempt, just an add to cart button for every product.

                On a side note, I had been sent an ajax snippet but it looks like it completely "redraws" the mini-basket. Is that how the ajax-add-to-cart.js handles the add to cart? It doesn't look like it.

                Okay, it's probably time for me to move this conversation to the Colossus Forum. I'm asking way too many Colossus related questions.
                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

                Comment


                  #9
                  Well, Matt was saying you need to build your own...so...every developer is different, but for things like this, i find it easier to rebuild stuff on my own rather than trying to figure out how someone else wrote something.
                  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


                    #10
                    Originally posted by Bruce - PhosphorMedia View Post
                    Well, Matt was saying you need to build your own...so...every developer is different, but for things like this, i find it easier to rebuild stuff on my own rather than trying to figure out how someone else wrote something.
                    I've moved this conversation over to the Colossus forum https://www.miva.com/forums/forum/de...n-on-ctgy-page so hopefully, I can get back on track with the correct ReadyTheme. One of the reasons I'm not trying to build my own is that I thought the whole reasoning behind the use of these latest released ReadyThemes was to have some sort of consistency in coding, along with plug & play abilities. It was also my understanding that Shadows and Colossus "may" be part of the underpinnings of Miva 10.
                    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

                    Comment

                    Working...
                    X