Announcement

Collapse
No announcement yet.

Sort by broken

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

  • Sort by broken

    I thought this had come up before but a search of the forum (and a Google search) didn't help me find it. Store is using the Levels ReadyTheme. On the CTGY page, the Items per Page and Sort By are not working. I'm getting a 404 Not Found error because it's producing a link like this http://www.domain.com/CTGY.html&Category_Code=catcode

    The template sort method is set to Default.

    These two functions are working correctly on the PLST and SRCH pages.
    Leslie Kirk
    Miva Merchant 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

  • Hi Leslie,

    Are you using URI Management and is that item assigned to the category page?

    Here is the default code for the sort section to compare with what you are using:
    Code:
    <div class="column half medium-one-fifth large-one-fifth sorting np">
        <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
            <form method="post" action="&mvte:urls:_self:auto;" class="nm">
                <input type="hidden" name="Search" value="&mvte:global:Search;">
                <input type="hidden" name="Per_Page" value="&mvte:global:Per_Page;">
                <!-- <label for="l-sort-by" class="medium uppercase">Sort By</label> -->
                <select name="Sort_By" id="l-sort-by" class="input-medium" onChange="this.form.submit();">
                    <mvt:if expr="ISNULL g.Sort_By">
                        <option value="disp_order" selected="selected">Sort By&hellip;</option>
                    <mvt:else>
                        <option value="disp_order">Sort By&hellip;</option>
                    </mvt:if>
                    <mvt:if expr="g.Sort_By EQ 'newest'">
                        <option value="newest" selected="selected">Newest</option>
                    <mvt:else>
                        <option value="newest">Newest</option>
                    </mvt:if>
                    <mvt:if expr="g.Sort_By EQ 'bestsellers'">
                        <option value="bestsellers" selected="selected">Best Selling</option>
                    <mvt:else>
                        <option value="bestsellers">Best Selling</option>
                    </mvt:if>
                    <mvt:if expr="g.Sort_By EQ 'price_asc'">
                        <option value="price_asc" selected="selected">Lowest Price</option>
                    <mvt:else>
                        <option value="price_asc">Lowest Price</option>
                    </mvt:if>
                    <mvt:if expr="g.Sort_By EQ 'price_desc'">
                        <option value="price_desc" selected="selected">Highest Price</option>
                    <mvt:else>
                        <option value="price_desc">Highest Price</option>
                    </mvt:if>
                    <mvt:if expr="g.Sort_By EQ 'name_asc'">
                        <option value="name_asc" selected="selected">Name Ascending</option>
                    <mvt:else>
                        <option value="name_asc">Name Ascending</option>
                    </mvt:if>
                    <mvt:if expr="g.Sort_By EQ 'name_desc'">
                        <option value="name_desc" selected="selected">Name Descending</option>
                    <mvt:else>
                        <option value="name_desc">Name Descending</option>
                    </mvt:if>
                </select>
                <noscript><button>Go</button></noscript>
            </form>
            <!-- end sorting -->
        </mvt:if>
    </div>
    Matt Zimmermann
    Director of UI/UX Standards and Theme Development
    / Miva, Inc.

    Comment


    • Yes, the store is using the URI Management - what is the actual code for the item that needs to be assigned? Is it "urls" or "cssui_links"?


      Code:
      <div class="row filter-items-container">
      <nav class="column half medium-one-fifth large-one-fifth per-page np">
          <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
              <form method="post" action="&mvte:urls:_self:auto;" class="nm">
                  <input type="hidden" name="Search" value="&mvte:global:Search;">
                  <input type="hidden" name="Sort_By" value="&mvte:global:Sort_By;">
                  <!-- <label for="l-per-page" class="medium uppercase">Per Page</label> -->
                  <select name="Per_Page" id="l-per-page" class="input-medium" onChange="this.form.submit();">
                      <option <mvt:if expr="g.Per_Page EQ 16">selected</mvt:if> value="16">16 items/page</option>
                      <option <mvt:if expr="g.Per_Page EQ 32">selected</mvt:if> value="32">32 items/page</option>
                      <option <mvt:if expr="g.Per_Page EQ -1">selected</mvt:if> value="-1">View All</option>
                  </select>
                  <noscript><button>Go</button></noscript>
              </form>
              <!-- end per-page -->
          </mvt:if>
      </nav>
      <div class="column half medium-one-fifth large-one-fifth sorting np">
          <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
              <form method="post" action="&mvte:urls:_self:auto;" class="nm">
                  <input type="hidden" name="Search" value="&mvte:global:Search;">
                  <input type="hidden" name="Per_Page" value="&mvte:global:Per_Page;">
                  <!-- <label for="l-sort-by" class="medium uppercase">Sort By</label> -->
                  <select name="Sort_By" id="l-sort-by" class="input-medium" onChange="this.form.submit();">
                      <mvt:if expr="ISNULL g.Sort_By">
                          <option value="disp_order" selected="selected">Sort By&hellip;</option>
                      <mvt:else>
                          <option value="disp_order">Sort By&hellip;</option>
                      </mvt:if>
                      <mvt:if expr="g.Sort_By EQ 'newest'">
                          <option value="newest" selected="selected">Newest</option>
                      <mvt:else>
                          <option value="newest">Newest</option>
                      </mvt:if>
                      <mvt:if expr="g.Sort_By EQ 'bestsellers'">
                          <option value="bestsellers" selected="selected">Best Selling</option>
                      <mvt:else>
                          <option value="bestsellers">Best Selling</option>
                      </mvt:if>
                      <mvt:if expr="g.Sort_By EQ 'price_asc'">
                          <option value="price_asc" selected="selected">Lowest Price</option>
                      <mvt:else>
                          <option value="price_asc">Lowest Price</option>
                      </mvt:if>
                      <mvt:if expr="g.Sort_By EQ 'price_desc'">
                          <option value="price_desc" selected="selected">Highest Price</option>
                      <mvt:else>
                          <option value="price_desc">Highest Price</option>
                      </mvt:if>
                      <mvt:if expr="g.Sort_By EQ 'name_asc'">
                          <option value="name_asc" selected="selected">Name Ascending</option>
                      <mvt:else>
                          <option value="name_asc">Name Ascending</option>
                      </mvt:if>
                      <mvt:if expr="g.Sort_By EQ 'name_desc'">
                          <option value="name_desc" selected="selected">Name Descending</option>
                      <mvt:else>
                          <option value="name_desc">Name Descending</option>
                      </mvt:if>
                  </select>
                  <noscript><button>Go</button></noscript>
              </form>
              <!-- end sorting -->
          </mvt:if>
      </div>
      You code looks pretty much like what this site has.
      Leslie Kirk
      Miva Merchant 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


      • Hi Leslie,

        The URLS item
        Matt Zimmermann
        Director of UI/UX Standards and Theme Development
        / Miva, Inc.

        Comment


        • Originally posted by Matt Zimmermann View Post
          Hi Leslie,

          The URLS item
          It's assigned
          Leslie Kirk
          Miva Merchant 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


          • Kinda sad, 2019 and this is still an issue. urls Item is assigned. Still getting broken sort by links
            Leslie Kirk
            Miva Merchant 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


            • Hi Leslie,

              Can you post a link to the site? Is this a new install or an existing one?
              Matt Zimmermann
              Director of UI/UX Standards and Theme Development
              / Miva, Inc.

              Comment


              • Originally posted by Matt Zimmermann View Post
                Hi Leslie,

                Can you post a link to the site? Is this a new install or an existing one?
                Dev site - troll protected

                Levels was installed 6/25/2018

                This code produces a broken link:

                Code:
                <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
                        <form method="post" action="&mvte:urls:_self:auto;" class="nm">
                            <input type="hidden" name="Search" value="&mvte:global:Search;">
                            <input type="hidden" name="Sort_By" value="&mvte:global:Sort_By;">
                            <!-- <label for="l-per-page" class="medium uppercase">Per Page</label> -->
                            <select name="Per_Page" id="l-per-page" class="input-medium" onChange="this.form.submit();">
                                <option <mvt:if expr="g.Per_Page EQ 12">selected</mvt:if> value="12">12 items/page</option>
                                <option <mvt:if expr="g.Per_Page EQ 24">selected</mvt:if> value="24">24 items/page</option>
                                <option <mvt:if expr="g.Per_Page EQ -1">selected</mvt:if> value="-1">View All</option>
                            </select>
                            <noscript><button>Go</button></noscript>
                        </form>
                        <!-- end per-page -->
                    </mvt:if>
                This code produces a broken link:

                Code:
                <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
                        <form method="post" action="&mvte:urls:_self:auto;" class="nm">
                            <input type="hidden" name="Search" value="&mvte:global:Search;">
                            <input type="hidden" name="Per_Page" value="&mvte:global:Per_Page;">
                            <!-- <label for="l-sort-by" class="medium uppercase">Sort By</label> -->
                            <select name="Sort_By" id="l-sort-by" class="input-medium" onChange="this.form.submit();">
                                <mvt:if expr="ISNULL g.Sort_By">
                                    <option value="disp_order" selected="selected">Sort By&hellip;</option>
                                <mvt:else>
                                    <option value="disp_order">Sort By&hellip;</option>
                                </mvt:if>
                                <mvt:if expr="g.Sort_By EQ 'newest'">
                                    <option value="newest" selected="selected">Newest</option>
                                <mvt:else>
                                    <option value="newest">Newest</option>
                                </mvt:if>
                                <mvt:if expr="g.Sort_By EQ 'bestsellers'">
                                    <option value="bestsellers" selected="selected">Best Selling</option>
                                <mvt:else>
                                    <option value="bestsellers">Best Selling</option>
                                </mvt:if>
                                <mvt:if expr="g.Sort_By EQ 'price_asc'">
                                    <option value="price_asc" selected="selected">Lowest Price</option>
                                <mvt:else>
                                    <option value="price_asc">Lowest Price</option>
                                </mvt:if>
                                <mvt:if expr="g.Sort_By EQ 'price_desc'">
                                    <option value="price_desc" selected="selected">Highest Price</option>
                                <mvt:else>
                                    <option value="price_desc">Highest Price</option>
                                </mvt:if>
                                <mvt:if expr="g.Sort_By EQ 'name_asc'">
                                    <option value="name_asc" selected="selected">Name Ascending</option>
                                <mvt:else>
                                    <option value="name_asc">Name Ascending</option>
                                </mvt:if>
                                <mvt:if expr="g.Sort_By EQ 'name_desc'">
                                    <option value="name_desc" selected="selected">Name Descending</option>
                                <mvt:else>
                                    <option value="name_desc">Name Descending</option>
                                </mvt:if>
                            </select>
                            <noscript><button>Go</button></noscript>
                        </form>
                        <!-- end sorting -->
                    </mvt:if>

                BUT this code produces a link that works:

                Code:
                <mvt:if expr="l.settings:category_listing:page_links:last_page GT 1">
                        <span class="page-links-container top-page-links">
                            <mvt:if expr="l.settings:category_listing:page_links:current_page NE 1">
                                <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:prev_link_params;" class="page-links-previous"><span data-icon="&#x34;"></span> Prev</a>
                            <mvt:else>
                                <span class="page-links-previous page-links-deactivated"><span data-icon="&#x34;"></span> Prev</span>
                            </mvt:if>
                            <mvt:if expr="NOT l.settings:category_listing:page_links:contains_first">
                                <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:first_link_params;" class="page-links-inactive">1</a><a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:first_link_params;" class="page-links-inactive hellip">&hellip;</a>
                            </mvt:if>
                            <mvt:foreach iterator="pages" array="category_listing:page_links:pages">
                                <mvt:if expr="l.settings:category_listing:page_links:current_page EQ l.settings:pages:page_num">
                                    <span class="page-links-active">&mvte:pages:page_num;</span>
                                <mvt:else>
                                    <a href="&mvte:urls:_self:auto_sep;&mvte:pages:link_params;" class="page-links-inactive">&mvte:pages:page_num;</a>
                                </mvt:if>
                            </mvt:foreach>
                            <mvt:if expr="NOT l.settings:category_listing:page_links:contains_last">
                                <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:last_link_params;" class="page-links-inactive hellip">&hellip;</a><a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:last_link_params;" class="page-links-inactive">&mvte:category_listing:page_links:last_page;</a>
                            </mvt:if>
                            <mvt:if expr="l.settings:category_listing:page_links:current_page NE l.settings:category_listing:page_links:last_page">
                                <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:next_link_params;" class="page-links-next">Next <span data-icon="&#x35;"></span></a>
                            <mvt:else>
                                <span class="page-links-next page-links-deactivated">Next <span data-icon="&#x35;"></span></span>
                            </mvt:if>
                        </span>
                        <!-- end page-links -->
                    </mvt:if>




                Leslie Kirk
                Miva Merchant 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


                • Hi Leslie,

                  Try replacing the filter items container with this code:

                  Code:
                  <div class="row filter-items-container">
                      <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
                          <mvt:assign name="g.facet_listings" value="''"/>
                          <mvt:foreach iterator="facet" array="facets:facets">
                              <mvt:foreach iterator="facet_value" array="facet:values">
                                  <mvt:if expr="l.settings:facet_value:selected">
                                      <input type="hidden" name="&mvte:facet:code;" value="&mvte:facet_value:value;"/>
                                      <mvt:assign name="g.facet_listings" value="'&' $ l.settings::facet:code $ '=' $ l.settings::facet_value:value"/>
                                  </mvt:if>
                              </mvt:foreach>
                          </mvt:foreach>
                      </mvt:if>
                  
                      <nav class="column half medium-one-fifth large-one-fifth per-page np">
                          <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
                              <form class="nm" method="get" action="&mvte:urls:_self:auto_noparams;">
                                  <mvt:if expr="tolower( l.settings:category_listing:mode ) EQ 'ctgy' AND toupper( g.Screen ) NE 'CTGY'">
                                      <input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;" />
                                  <mvt:elseif expr="tolower( l.settings:category_listing:mode ) EQ 'relp' AND toupper( g.Screen ) NE 'PROD'">
                                      <input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;" />
                                  </mvt:if>
                                  <mvt:item name="urls" param="hidden_params:_self:auto" />
                                  <input type="hidden" name="Search" value="&mvte:global:Search;" />
                                  <input type="hidden" name="Sort_By" value="&mvte:global:Sort_By;" />
                                  <mvt:foreach iterator="facet" array="facets:facets">
                                      <mvt:foreach iterator="facet_value" array="facet:values">
                                          <mvt:if expr="l.settings:facet_value:selected">
                                              <input type="hidden" name="&mvte:facet:code;" value="&mvte:facet_value:value;" />
                                          </mvt:if>
                                      </mvt:foreach>
                                  </mvt:foreach>
                                  <label for="l-per_page" class="medium uppercase hide">Per Page</label>
                                  <select id="l-per_page" class="input-medium" name="Per_Page" onchange="MMProdList_UpdateQuery( this ); return true;">
                                      <mvt:if expr="g.Per_Page EQ 12">
                                          <option value="12" selected="selected">12 Items/Page</option>
                                      <mvt:else>
                                          <option value="12">12 Items/Page</option>
                                      </mvt:if>
                                      <mvt:if expr="g.Per_Page EQ 24">
                                          <option value="24" selected="selected">24 Items/Page</option>
                                      <mvt:else>
                                          <option value="24">24 Items/Page</option>
                                      </mvt:if>
                                      <mvt:if expr="g.Per_Page EQ 48">
                                          <option value="48" selected="selected">48 Items/Page</option>
                                      <mvt:else>
                                          <option value="48">48 Items/Page</option>
                                      </mvt:if>
                                      <mvt:if expr="g.Per_Page EQ -1">
                                          <option value="-1" selected="selected">All Items</option>
                                      <mvt:else>
                                          <option value="-1">All Items</option>
                                      </mvt:if>
                                  </select>
                                  <noscript><button>Go</button></noscript>
                              </form>
                              <!-- end per-page -->
                          </mvt:if>
                      </nav>
                      <div class="column half medium-one-fifth large-one-fifth sorting np">
                          <mvt:if expr="l.settings:category_listing:products_on_page_count GT 1">
                              <form class="nm" method="get" action="&mvte:urls:_self:auto_noparams;">
                                  <mvt:if expr="tolower( l.settings:category_listing:mode ) EQ 'ctgy' AND toupper( g.Screen ) NE 'CTGY'">
                                      <input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
                                  <mvt:elseif expr="tolower( l.settings:category_listing:mode ) EQ 'relp' AND toupper( g.Screen ) NE 'PROD'">
                                      <input type="hidden" name="Product_Code" value="&mvte:global:Product_Code;">
                                  </mvt:if>
                                  <mvt:item name="urls" param="hidden_params:_self:auto"/>
                                  <input type="hidden" name="Search" value="&mvte:global:Search;"/>
                                  <input type="hidden" name="Per_Page" value="&mvte:global:Per_Page;"/>
                                  <mvt:foreach iterator="facet" array="facets:facets">
                                      <mvt:foreach iterator="facet_value" array="facet:values">
                                          <mvt:if expr="l.settings:facet_value:selected">
                                              <input type="hidden" name="&mvte:facet:code;" value="&mvte:facet_value:value;">
                                          </mvt:if>
                                      </mvt:foreach>
                                  </mvt:foreach>
                                  <label for="l-sort_by" class="medium uppercase hide">Sort By</label>
                                  <select id="l-sort_by" class="input-medium" name="Sort_By" onchange="MMProdList_UpdateQuery( this ); return true;">
                                      <mvt:if expr="ISNULL g.Sort_By">
                                          <option value="disp_order" selected>Sort By&hellip;</option>
                                      <mvt:else>
                                          <option value="disp_order">Sort By&hellip;</option>
                                      </mvt:if>
                                      <mvt:if expr="g.Sort_By EQ 'bestsellers'">
                                          <option value="bestsellers" selected>Best Selling</option>
                                      <mvt:else>
                                          <option value="bestsellers">Best Selling</option>
                                      </mvt:if>
                                      <mvt:if expr="g.Sort_By EQ 'price_asc'">
                                          <option value="price_asc" selected>Price (Low to High)</option>
                                      <mvt:else>
                                          <option value="price_asc">Price (Low to High)</option>
                                      </mvt:if>
                                      <mvt:if expr="g.Sort_By EQ 'price_desc'">
                                          <option value="price_desc" selected>Price (High to Low)</option>
                                      <mvt:else>
                                          <option value="price_desc">Price (High to Low)</option>
                                      </mvt:if>
                                      <mvt:if expr="g.Sort_By EQ 'newest'">
                                          <option value="newest" selected>Newest Items</option>
                                      <mvt:else>
                                          <option value="newest">Newest Items</option>
                                      </mvt:if>
                                  </select>
                                  <noscript><button>Go</button></noscript>
                              </form>
                              <!-- end sorting -->
                          </mvt:if>
                      </div>
                  
                      <div class="column hide medium-show medium-three-fifths large-three-fifths align-right page-links">
                          <mvt:if expr="l.settings:category_listing:page_links:last_page GT 1">
                              <span class="page-links-container top-page-links">
                                  <mvt:if expr="l.settings:category_listing:page_links:current_page NE 1">
                                      <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:prev_link_params;" class="page-links-previous"><span data-icon="&#x34;"></span> Prev</a>
                                  <mvt:else>
                                      <span class="page-links-previous page-links-deactivated"><span data-icon="&#x34;"></span> Prev</span>
                                  </mvt:if>
                                  <mvt:if expr="NOT l.settings:category_listing:page_links:contains_first">
                                      <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:first_link_params;" class="page-links-inactive">1</a><a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:first_link_params;" class="page-links-inactive hellip">&hellip;</a>
                                  </mvt:if>
                                  <mvt:foreach iterator="pages" array="category_listing:page_links:pages">
                                      <mvt:if expr="l.settings:category_listing:page_links:current_page EQ l.settings:pages:page_num">
                                          <span class="page-links-active">&mvte:pages:page_num;</span>
                                      <mvt:else>
                                          <a href="&mvte:urls:_self:auto_sep;&mvte:pages:link_params;" class="page-links-inactive">&mvte:pages:page_num;</a>
                                      </mvt:if>
                                  </mvt:foreach>
                                  <mvt:if expr="NOT l.settings:category_listing:page_links:contains_last">
                                      <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:last_link_params;" class="page-links-inactive hellip">&hellip;</a><a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:last_link_params;" class="page-links-inactive">&mvte:category_listing:page_links:last_page;</a>
                                  </mvt:if>
                                  <mvt:if expr="l.settings:category_listing:page_links:current_page NE l.settings:category_listing:page_links:last_page">
                                      <a href="&mvte:urls:_self:auto_sep;&mvte:category_listing:page_links:next_link_params;" class="page-links-next">Next <span data-icon="&#x35;"></span></a>
                                  <mvt:else>
                                      <span class="page-links-next page-links-deactivated">Next <span data-icon="&#x35;"></span></span>
                                  </mvt:if>
                              </span>
                              <!-- end page-links -->
                          </mvt:if>
                      </div>
                  </div>
                  <!-- end filter-items-container -->
                  Matt Zimmermann
                  Director of UI/UX Standards and Theme Development
                  / Miva, Inc.

                  Comment


                  • Thank you Matt! That fixed it.
                    Leslie Kirk
                    Miva Merchant 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

                    This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

                    This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

                    Accept