Announcement

Collapse
No announcement yet.

Sort by and Per Page Levels

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

    Sort by and Per Page Levels

    I figured out the levels CTGY Sort_By and Per_Page with the instructions on the Miva knowledge base article link below, simply by changing the onchange event only, and yes the URLs item was assigned. They operated in my browser as they should at least.

    My PLST and SRCH pages were also fine as they were in a post by Leslie (https://www.miva.com/forums/forum/de...sort-by-broken).

    The link tells me to do the same with ABAL, so I only edited it the same as I did for the CTGY page. URLs item assigned to this page too.

    Didn't have to do the PROD pages, as the instruction indicate, since the related product has no sort by or per page.

    Then, I get to WISH and WLST. The link instructions don't appear to be correct for those pages in Levels, since there are no onchange events. I see it when I use developer tools, but not in the page template. Funny part is that both the SRCH and the PLST have the same onChange="this.form.submit(); event, which works, as WISH and WLST that doesn't work.

    Anyone got any ideas on how I update WISH an WLST pages, since they are also screwing up on my Levels theme too? Also, since that knowledge base article is 2016, was there a better (or more correct) way to update my CTGY and ABAL pages?

    Thanks,

    Jamie
    Jamie Donaldson
    JSDVS Web Design / Development
    Web Design | Web Development | E-commerce Design & Integration

    #2
    Hi Jamie,

    Here is the default Per_Page code for the WISH and WLST pages from a fresh 9.7 store.

    WISH

    Code:
    <mvt:if expr="l.settings:wishlistitems:total_count GT 1">
        <div class="per-page">
            <label for="Per_Page">View:</label>
            <select name="Per_Page" id="Per_Page" onchange="window.location.href='&mvtj:urls:_self:auto_sep;WishList_ID=' + encodeURIComponent( '&mvtj:global:WishList_ID;' ) + '&amp;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' );">
                <mvt:if expr="g.Per_Page EQ 10">
                    <option value="10" selected="selected">10</option>
                <mvt:else>
                    <option value="10">10</option>
                </mvt:if>
                <mvt:if expr="g.Per_Page EQ 20">
                    <option value="20" selected="selected">20</option>
                <mvt:else>
                    <option value="20">20</option>
                </mvt:if>
                <mvt:if expr="g.Per_Page EQ 40">
                    <option value="40" selected="selected">40</option>
                <mvt:else>
                    <option value="40">40</option>
                </mvt:if>
                <mvt:if expr="g.Per_Page EQ -1">
                    <option value="-1" selected="selected">All</option>
                <mvt:else>
                    <option value="-1">All</option>
                </mvt:if>
            </select>
        </div>
    </mvt:if>

    WLST

    Code:
    <mvt:if expr="l.settings:wishlists:total_count GT 1">
        <div class="sorting">
            <label for="Sort_By">Sort By:</label>
            <select name="Sort_By" id="Sort_By" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( '&mvtj:global:Per_Page;' ) + '&amp;Sort_By=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;WishListSearch=' + encodeURIComponent( '&mvtj:global:WishListSearch;' );">
                <mvt:if expr="ISNULL g.Sort_By">
                    <option value="id" selected="selected">Default</option>
                <mvt:else>
                    <option value="id">Default</option>
                </mvt:if>
                <mvt:if expr="g.Sort_By EQ 'title_asc'">
                    <option value="title_asc" selected="selected">Title Ascending</option>
                <mvt:else>
                    <option value="title_asc">Title Ascending</option>
                </mvt:if>
    
                <mvt:if expr="g.Sort_By EQ 'title_desc'">
                    <option value="title_desc" selected="selected">Title Descending</option>
                <mvt:else>
                    <option value="title_desc">Title Descending</option>
                </mvt:if>
            </select>
        </div>
    </mvt:if>
    
    <mvt:if expr="l.settings:wishlists:total_count GT 1">
        <div class="per-page">
            <label for="Per_Page">View:</label>
            <select name="Per_Page" id="Per_Page" onchange="window.location.href='&mvtj:urls:_self:auto_sep;Per_Page=' + encodeURIComponent( this.options[ this.selectedIndex ].value ) + '&amp;Sort_By=' + encodeURIComponent( '&mvtj:global:Sort_By;' ) + '&amp;WishListSearch=' + encodeURIComponent( '&mvtj:global:WishListSearch;' );">
                <mvt:if expr="g.Per_Page EQ 10">
                    <option value="10" selected="selected">10</option>
                <mvt:else>
                    <option value="10">10</option>
                </mvt:if>
                <mvt:if expr="g.Per_Page EQ 20">
                    <option value="20" selected="selected">20</option>
                <mvt:else>
                    <option value="20">20</option>
                </mvt:if>
                <mvt:if expr="g.Per_Page EQ 40">
                    <option value="40" selected="selected">40</option>
                <mvt:else>
                    <option value="40">40</option>
                </mvt:if>
                <mvt:if expr="g.Per_Page EQ -1">
                    <option value="-1" selected="selected">All</option>
                <mvt:else>
                    <option value="-1">All</option>
                </mvt:if>
            </select>
        </div>
    </mvt:if>
    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
      Thank you Matt!! You always come through! Works perfectly!

      Jamie
      Jamie Donaldson
      JSDVS Web Design / Development
      Web Design | Web Development | E-commerce Design & Integration

      Comment


        #4
        Originally posted by jsdva View Post
        I figured out the levels CTGY Sort_By and Per_Page with the instructions on the Miva knowledge base article link below, simply by changing the onchange event only, and yes the URLs item was assigned. They operated in my browser as they should at least.

        Thanks,

        Jamie
        Jamie - do you have the name of the Knowledge Base article? I can't seem to find what you used.

        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