show number of items in the basket?

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

    • Nov 2013
    • 42

    #1

    show number of items in the basket?

    I am in the process of customizing a template and want to add something to the global navigation bar. I currently have several links, one of which is "My Basket". the code I am using for this is taken from the original template:

    Code:
        
    <!--- BASKET LINK ------->
        <mvt:if expr="l.settings:page:code EQ 'BASK'">
        <li class="navigation-item-on" id="nav-basket">
        <mvt:else>
        <li class="navigation-item-off" id="nav-basket">
        </mvt:if>
            <div class="item-left-side"><div class="item-right-side"><mvt:item name="cssui_links" param="basket">My Basket</mvt:item></div></div>
        </li>
    You can view it here:


    What I want to do, is to show how many items are in the cart, so for example, if the user is logged in and currently has 8 products in the basket, the navigation link should say "My Basket (8)"

    Ive searched the forum but have been unable to find any posts about this. I have toolkit installed but havent used it for anything yet (Im still learning my way around)

    Thanks for everyone's help!

    Roz
  • papi34
    Mighty Mivite

    • Mar 2008
    • 703

    #2
    Re: show number of items in the basket?

    try
    Code:
    &mvte:toolkit:basketcount;
    Bronson Design Studio, LLC
    Website: bronsondesign.com
    Facebook: facebook.com/bronsondesign

    Comment

    • neuroticartist
      Mini Mivite

      • Nov 2013
      • 42

      #3
      Re: show number of items in the basket?

      thanks for your fast reply, Im still a little green but learning. where would I put that? I tried:
      Code:
      <mvt:item name="cssui_links&mvte:toolkit:basketcount;" param="basket">
      but that didnt work, MIVA wouldnt let me save that.

      Comment

      • neuroticartist
        Mini Mivite

        • Nov 2013
        • 42

        #4
        Re: show number of items in the basket?

        *Bump* Hi papi34, I was wondering if you could expand on your post a little bit? Im not sure of the syntax or where to put it. Or anyone else know how to use this properly?

        Comment

        • Bruce - PhosphorMedia
          Developer Partner











          • Mar 2006
          • 11256

          #5
          Re: show number of items in the basket?

          <mvt:item name="cssui_links" param="basket">&mvte:toolkit:basketcount; View Basket</a>

          (Make sure the Toolkit ITEM is active on all pages.)
          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

          • neuroticartist
            Mini Mivite

            • Nov 2013
            • 42

            #6
            Re: show number of items in the basket?

            Hi Bruce, thanks for this info. I get a syntax error when I enter this and attempt to save it. I am assuming that the problem is that you added a closing href tag < /a > instead of a < /mvt:item >? I did make this change and it allowed me to save it but it still did not show me the number of items in the cart.

            I logged into a user account, added 3 items and am looking on the "about us" page, where I have made sure that toolkit was check marked. The link to the basket works, it just isnt showing me a product count.

            Comment

            • wcw
              Developer Partner

              • Mar 2006
              • 11329

              #7
              Re: show number of items in the basket?

              The item token name above is not correct. See #35 at http://www.emporiumplus.com/1AA00223.html The doc is your friend; please use it. The exact example is in the #35 paragraph.
              Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
              Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
              Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
              Facebook http://www.facebook.com/EmporiumPlus
              Twitter http://twitter.com/emporiumplus

              Comment

              • neuroticartist
                Mini Mivite

                • Nov 2013
                • 42

                #8
                Re: show number of items in the basket?

                Voilà
                ! thats it. Thanks for that and yes, looks like I will stop and go read all those examples before continuing with my customization.

                Comment

                • neuroticartist
                  Mini Mivite

                  • Nov 2013
                  • 42

                  #9
                  Re: show number of items in the basket?

                  for anyone else finding this page via a search, this would be that code

                  Code:
                  <mvt:item name="toolkit" param="basket|itemcount" />
                  <mvt:if expr="g.itemcount GT 0">
                  Items in Basket: &mvte:toolkit:basketcount;
                  <br>Subtotal: &mvte:toolkit:baskettotalF;
                  <mvt:else>
                  Basket Empty
                  </mvt:if>
                  Only problem though, is that it doesnt link back to your basket. what would be the best way to do that?

                  Comment

                  • nottheusual1
                    Mega Mivite


                    • Jul 2008
                    • 1124

                    #10
                    Re: show number of items in the basket?

                    What is the HTML you currently use to link to your basket? I ask because of short links, etc.

                    Comment

                    • neuroticartist
                      Mini Mivite

                      • Nov 2013
                      • 42

                      #11
                      Re: show number of items in the basket?

                      Im using this, which is based off a templates navigation bar and customized:


                      Code:
                           
                          <!--- BASKET LINK ------->
                          <mvt:if expr="l.settings:page:code EQ 'BASK'">
                          <li class="navigation-item-on" id="nav-basket">
                          <mvt:else>
                          <li class="navigation-item-off" id="nav-basket">
                          </mvt:if>
                              <div class="item-left-side"><div class="item-right-side"><mvt:item name="toolkit" param="basket|itemcount" /><mvt:if expr="g.itemcount GT 0">My Basket: &mvte:toolkit:basketcount; - Subtotal: &mvte:toolkit:baskettotalF; <mvt:else>Basket Empty</mvt:if></div></div>
                          </li>
                      Im still learning the MIVA/Toolkit stuff so any advise always helps a great deal!

                      Comment

                      • nottheusual1
                        Mega Mivite


                        • Jul 2008
                        • 1124

                        #12
                        Re: show number of items in the basket?

                        Do you have this working where we can see it? Your mixing some things that aren't usually mixable.

                        Comment

                        • neuroticartist
                          Mini Mivite

                          • Nov 2013
                          • 42

                          #13
                          Re: show number of items in the basket?

                          I freely admit, Im still learning. I find things close to what I need and try to adapt them to learn the code. doesnt always go smoothly lol

                          Comment

                          • nottheusual1
                            Mega Mivite


                            • Jul 2008
                            • 1124

                            #14
                            Re: show number of items in the basket?

                            Try this. Should make "My Basket" a link. You can move the closing "a" tag to change it:

                            Code:
                                <!--- BASKET LINK ------->
                                <mvt:if expr="l.settings:page:code EQ 'BASK'">
                                <li class="navigation-item-on" id="nav-basket">
                                <mvt:else>
                                <li class="navigation-item-off" id="nav-basket">
                                </mvt:if>
                                    <div class="item-left-side"><div class="item-right-side"><mvt:item name="toolkit" param="basket|itemcount" /><mvt:if expr="g.itemcount GT 0"><a href="/mm5/merchant.mvc?Screen=BASK">My Basket</a>: &mvte:toolkit:basketcount; - Subtotal: &mvte:toolkit:baskettotalF; <mvt:else>Basket Empty</mvt:if></div></div>
                                </li>

                            Comment

                            • neuroticartist
                              Mini Mivite

                              • Nov 2013
                              • 42

                              #15
                              Re: show number of items in the basket?

                              oh I see what you did there. That makes some sense to me. Thanks again I really appreciate the help!

                              Comment

                              Working...
                              X