Announcement

Collapse
No announcement yet.

Sort by Description on BASK page

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

    Sort by Description on BASK page

    Hello - Anyone have any suggestions or a solution on how I can make the products listed in BASK to always display the list in alphabetical order by Product Name?

    Thank you!
    Corina

    #2
    Re: Sort by Description on BASK page

    Hello Corina,

    I don't know of a quick and easy way to do this. There is a toolkit function which lets you alphabetize an array, but it seems to only work on single dimension arrays. Unfortunately, the basket items array is two dimensional due to nested product attributes, inventory kits and inventory variant products so that function won't work (I just tested it to be sure).

    Toolbelt's Array_Sort function is supposed to be able to handle complex arrays, but I've been unable to get it to work for the basket contents thus far either.

    I wasn't able to find any other third party modules which list basket or array sorting among their features.

    It's still possible, but the only other way I can think of to do it right now would require a fair amount of custom programming. You could basically run through the array once just to build a new single-dimension array variable using the product names, sort that new array alphabetically, and then run the basket items array once for each of the items in the new array and only print the one that matches each time, so that they are printed on the page alphabetically. That's a somewhat roundabout solution, and not particularly efficient, but it would work.

    Maybe someone else will chime in with a better solution.
    Last edited by KNewbrough; 07-22-13, 05:48 PM.
    Kyle Newbrough
    Technical Support / Web Developer
    Miva Merchant

    Comment


      #3
      Re: Sort by Description on BASK page

      I'd have to wonder why? I'd expect the basket to show the list of products in the order I put them in...just saying<g>.
      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


        #4
        Re: Sort by Description on BASK page

        Hi Bruce - I sell Index Tabs that have Titles (or names) on each tab. We carry over 110 of these in stock. Our shopping carts almost always have 20 or so products per cart with varying quantities for each product.

        These are the main reasons:

        1. We store these items alphabetically, so as we go down the aisle, we can go one way down the storage aisle instead of jumping back forth.

        2. We pack the sheets and ship them alphabetically which allows the client to easily open their shipment and locate each Title easily. Otherwise they'd have to thumb through the stack of sheets trying to find the title they need at the moment.

        3. If the client wants the index tabs supplied in a specific order - they have to pay for that service since it takes us a lot longer to pull it in that order. We have a custom module that does the custom order calculation for us already. If we sort the cart, there is no misunderstanding on what the "free" service is (alphabetical) and what the "custom paid" for service is (any order the clients wants them in).

        Thank you!
        Corina
        Last edited by s1b; 07-22-13, 04:46 PM.

        Comment


          #5
          Re: Sort by Description on BASK page

          Thanks for your input, Kyle! Way over my head, but it gives me some kind direction.

          Comment


            #6
            Re: Sort by Description on BASK page

            Well, now that is an odd one. Personally, I'd see if a developer couldn't help you out with a simple custom module. Wouldn't take much, certainly would be faster than trying to do it with tool belt (in both development time and run time).
            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


              #7
              Re: Sort by Description on BASK page

              Thanks Bruce! I will ask Kent Multer since he has been doing all my custom work for me. I did not realize the request was this tricky.

              Comment


                #8
                Re: Sort by Description on BASK page

                Well it wont be tricky for Kent :)
                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


                  #9
                  Re: Sort by Description on BASK page

                  Are you sure you tested this correctly. Try this token just before the foreach. Locate the foreach tag you see here and put the asortmulti token just before it like
                  Code:
                  <mvt:item name="toolkit" param="asortmulti|l.all_settings:basket:items|:name|1" />
                  
                  	<mvt:foreach iterator="item" array="basket:items">
                  Seems like this should work in your store. I've tested it with name and price and it sorts instantly.
                  Last edited by wcw; 07-22-13, 05:35 PM.
                  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


                    #10
                    Re: Sort by Description on BASK page

                    Bill - Thank you so much! That worked!

                    I also inserted the asortmulti token onto the pages that I had not originally thought about like the invoice page and email notifications.

                    So far so good!
                    Corina

                    Comment


                      #11
                      Re: Sort by Description on BASK page

                      Ah, I hadn't tested asortmulti, as I wasn't familiar with that function. I searched for "alphabet" and the only function that came up was asort. It seems I need to work on my ctrl+f kung fu. Thanks for the heads up and solution, Bill!
                      Kyle Newbrough
                      Technical Support / Web Developer
                      Miva Merchant

                      Comment

                      Working...
                      X