Announcement

Collapse
No announcement yet.

Category Sorting/Pagination

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

    Category Sorting/Pagination

    Hi,

    I have truly looked all over the place trying to figure this out and am so frustrated I'm finally going to ask here and hope someone understands this stuff better than I. My category pages have two major problems. At the top where there's a dropdown to sort the products, it doesn't seem to function. Show all does nothing and the various sorts also don't seem to work right.

    And at the bottom, the pagination doesn't work at all (i.e. you can't choose to see 24 products at a time. It will show 24 but then the next page just reverts back to 12). Here's my template code (I am using Sebenza's Category Template Manger):



    <mvt:item name="html_profile" />
    <head>
    <title>&mvt:store:name;: &mvt:category:name;</title>
    <base href="&mvt:global:basehref;" />
    <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
    <mvt:item name="head" param="css_list" />
    <mvt:item name="head" param="head_tag" />
    </head>
    <body class="CTGY">
    <div id="site-container">
    <div id="global-header"><mvt:item name="hdft" param="global_header" /></div>
    <div id="navigation-bar"><mvt:item name="navbar" /></div>
    <table id="content-container">
    <tr>
    <td id="left-navigation"><mvt:item name="cattree" /></td>
    <td id="main-content">

    <div>

    <mvt:if expr="NOT ISNULL l.settings:category_title:image">
    <img src="&mvte:category_title:image;" alt="&mvte:category:name;" border="0">
    </mvt:if>

    <table width=720px>
    <tr>
    <td align="left">

    <!--BEGIN BREADCRUMBS-->
    <form>
    <a href="&mvt:global:sessionurl;">&#72;&#111;&#109;&# 101;</a>

    <mvt:foreach iterator="crumb" array="breadcrumb">
    &#062; <a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvte:store:code;&Category_Code=&mvt:crumb:code; ">&mvt:crumb:name;</a>
    </mvt:foreach>

    &#062; &mvt:category:name;
    <mvt:if expr="l.settings:sub_cats">
    &#062;
    <select onChange="location.href='&mvt:global:sessionurl;Sc reen=CTGY&Store_Code=&mvte:store:code;&Category_Co de='+this.value;">
    <option value="">select one</option>
    <mvt:foreach iterator="subcat" array="sub_cats">
    <option value="&mvt:subcat:code;">&mvt:subcat:name;</option>
    </mvt:foreach>
    </select>
    </mvt:if>
    </form>
    <!--END BREADCRUMBS-->
    </td>

    <td align="right">

    <!--SORTING DROPDOWN-->
    <form method="post" action="&mvt:global:sessionurl;">
    <input type="hidden" name="Screen" value="&mvte:global:Screen;">
    <input type="hidden" name="Store_Code" value="&mvte:store:code;">
    <input type="hidden" name="Offset" value="&mvte:global:Offset;">
    <input type="hidden" name="show" value="&mvt:global:show;">
    <input type="hidden" name="SortBy" value="&mvte:global:SortBy;">
    <input type="hidden" name="Category_Code" value="&mvte:global:Category_Code;">
    Sort By:
    <select onchange="submit();" name="SortBy">
    <option value="name-asc">Please Select....</option>

    <mvt:if expr="g.SortBy EQ 'ps.counter DESC'">
    <option value="best-desc" SELECTED>Best Selling</option>
    <mvt:else>
    <option value="best-desc">Best Selling</option>
    </mvt:if>

    <mvt:if expr="g.SortBy EQ 'prod.id DESC'">
    <option value="id-desc" SELECTED>Newest</option>
    <mvt:else>
    <option value="id-desc">Newest</option>
    </mvt:if>

    <option value="name-asc">Name Ascending</option>
    <option value="name-desc">Name Descending</option>
    <option value="code-asc">Code Ascending</option>
    <option value="code-desc">Code Descending</option>
    <option value="price-asc">Price Ascending</option>
    <option value="price-desc">Price Descending</option>
    <option value="showall">Show All</option>
    </select>
    </form>
    <!--END SORTING DROPDOWN-->

    </td>
    </tr>
    </table>
    <br>
    <hr>
    <mvt:item name="bestsell" param="horizontal" />
    <hr>

    <div id="category-listing"><mvt:item name="category_listing" /></div>
    <div id="category-footer"><mvt:item name="prod_ctgy_hdft" param="ctgy_footer" />

    <!--BEGIN NUMBER OF PRODUCTS/HOW MANY PER PAGE-->
    <mvt:if expr="l.settings:sub_cats">

    <div align="left"><font face="Helvetica, Arial, sans-serif" size="2" color="#CC0000"><strong>Sub-Categories</strong></font></div>

    <table border="0" cellpadding="10" cellspacing="0">
    <tr>

    <mvt:foreach iterator="subcat" array="sub_cats">
    <td width="23%" align="left">
    <font size="2" face="Helvetica, Arial, Verdana, sans-serif"><strong><a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvta:store:code;&Category_Code=&mvt:subcat:code ;">&mvt:subcat:name;</a></strong></font>
    </td>
    <mvt:if expr = "(pos1 MOD 3 ) EQ 0">
    </tr><tr>
    </mvt:if>
    </mvt:foreach>

    </tr>
    </table>
    <br><br>
    </mvt:if>

    <mvt:if expr="l.settings:products">

    <table width="90%"><tr><td>
    Products found in this category: <b>&mvt:global:Ttl_Products;</b><br />
    View
    <mvt:if expr="l.settings:product_list:per_page EQ 12">
    12
    <mvt:else>
    <a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvte:store:code;&Category_Code=&mvt:category:co de;&SortBy=&mvte:global:SortBy;&show=12">12</a>
    </mvt:if>

    <mvt:if expr="l.settings:product_list:per_page EQ 24">
    24
    <mvt:else>
    <a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvte:store:code;&Category_Code=&mvt:category:co de;&SortBy=&mvte:global:SortBy;&show=24">24</a>
    </mvt:if>

    <mvt:if expr="l.settings:product_list:per_page EQ 36">
    36
    <mvt:else>
    <a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvte:store:code;&Category_Code=&mvt:category:co de;&SortBy=&mvte:global:SortBy;&show=36">36</a>
    </mvt:if>
    Products per page
    </td><td align="right">

    <mvt:if expr="g.Ttl_Pages GT 5">
    <mvt:if expr="g.curr_page GT 3 and g.curr_page LT g.Ttl_Pages -3">...
    <mvt:foreach iterator="page" array="pages">
    <mvt:if expr="l.settings:page:number LT g.curr_page +3 and l.settings:page:number GT g.curr_page -3">
    <mvt:if expr="l.settings:page:number EQ g.curr_page">
    <font color="#FF0000">[</font>&mvt:page:number;]&nbsp;
    <mvt:else>
    <font color="#FF0000">[</font><a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvta:store:code;&CatListingOffset=&mvta:page:of fset;&Category_Code=&mvta:category:code;" >&mvt:page:number;</a><font color="#FF0000">]</font>&nbsp;
    </mvt:if>
    </mvt:if>
    </mvt:foreach>...
    <mvt:else>
    <mvt:if expr="g.curr_page LT 4">
    <mvt:foreach iterator="page" array="pages">
    <mvt:if expr="l.settings:page:number LT 6">
    <mvt:if expr="l.settings:page:number EQ g.curr_page">
    <font color="#FF0000">[</font>&mvt:page:number;<font color="#FF0000">]</font>&nbsp;
    <mvt:else>
    <font color="#FF0000">[</font><a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvta:store:code;&CatListingOffset=&mvta:page:of fset;&Sortby=&mvte:global:SortBy;&Category_Code=&m vta:category:code;">&mvt:page:number;</a>]&nbsp;
    </mvt:if>
    </mvt:if>
    </mvt:foreach>...
    <mvt:else>...
    <mvt:foreach iterator="page" array="pages">
    <mvt:if expr="l.settings:page:number GT g.Ttl_Pages -5">
    <mvt:if expr="l.settings:page:number EQ g.curr_page">
    <font color="#FF0000">[</font>&mvt:page:number;<font color="#FF0000">]</font>&nbsp;
    <mvt:else>
    <font color="#FF0000">[</font><a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvta:store:code;&CatListingOffset=&mvta:page:of fset;&SortBy=&mvte:global:SortBy;&Category_Code=&m vta:category:code;">&mvt:page:number;</a><font color="#FF0000">]</font>&nbsp;
    </mvt:if>
    </mvt:if>
    </mvt:foreach>
    </mvt:if>
    </mvt:if>
    <mvt:else>
    <mvt:foreach iterator="page" array="pages">
    <mvt:if expr="l.settings:page:number EQ g.curr_page">
    <font color="#FF0000">[</font>&mvt:page:number;<font color="#FF0000">]</font>&nbsp;
    <mvt:else>
    <font color="#FF0000">[</font><a href="&mvt:global:sessionurl;Screen=CTGY&Store_Cod e=&mvta:store:code;&CatListingOffset=&mvta:page:of fset;&SortBy=&mvte:global:SortBy;&Category_Code=&m vta:category:code;">&mvt:page:number;</a><font color="#FF0000">]</font>&nbsp;
    </mvt:if>
    </mvt:foreach>
    </mvt:if>

    &nbsp;&nbsp;&nbsp;Page &mvt:global:curr_page; of &mvt:global:Ttl_Pages;
    </mvt:if>
    </td></tr>
    </table>
    <br>
    <!--END NUMBER OF PRODUCTS/HOW MANY PER PAGE-->

    </div>
    <div id="page-footer"><mvt:item name="hdft" param="footer" /></div>
    </td>
    </tr>
    </table>

    <div id="bottom-wrap"></div>
    <div id="global-footer"><mvt:item name="hdft" param="global_footer" /></div>
    </div>
    </body>
    </html>

    My site is www.iostamps.com

    Thanks in advance,

    Mitra Friant

    #2
    Re: Category Sorting/Pagination

    The best thing you can do is try and contact the developer directly. I don't know how many people on this forum are using that Sebenza module, so you MIGHT be in for a bit of a wait.

    I hope this helps.
    Mark Romero
    ~~~~~~~~

    Comment


      #3
      Re: Category Sorting/Pagination

      These features are built into PR8 Update 4 and higher, so you could choose to stop using the module and do it the built in way.
      Thanks,

      Rick Wilson
      CEO
      Miva, Inc.
      [email protected]
      https://www.miva.com

      Comment


        #4
        Re: Category Sorting/Pagination

        Sorry, I thought a lot of people used Sebenza's Category Template Manager as when I first upgraded I was told over and over that it was a "must-have" module. I was trying to avoid Sebenza's support because it can take an eternity to hear back and I've spent hours and hours trying to solve this on my own. My patience is wearing thin.

        And thanks Rick, I didn't know that it was now a built-in feature (love that!)...I'll go check it out and hopefully this will end up being an irrelevant question.

        Mitra Friant

        Comment


          #5
          Re: Category Sorting/Pagination

          The issue with the Category Template Manager's sort features are that parts of the URL structure changed. Meaning the URL's you see in the old template code provided by Sebenza doesn't work. You need to change the elements in page numbers, next & previous, as well as the sort URL's so they work, but I can't remember what to. Almost every element was changed at one point due to updates to Miva's system and you now have to update the template code to match. Sebenza support isn't that bad. They're busy, but they will get back to you if you wait. Have you heard back at this point? If not let me know and I'll dig up the code we use on another site to see how they differ from yours.
          Ted Hust
          AarcMediaGroup.com

          Celebrating 13 Years of Outstanding Service & Support
          Miva Merchant Design

          Comment


            #6
            Re: Category Sorting/Pagination

            Is it possible to have several categories paginated with different numbers of products per page using the same page template?

            I have a fairly heavily customized category template layout (using MIVA's built in alternate templates) and want to use it for several different categories. The default number of products per page is 30, however I have one category that has 31 products in it. I would like to have that one category display all 31 products on one page, since it is kind of silly to have a second page with just one product on it.

            I thought I might be able to write in a conditional into the Category Product List Layout based on the category ID and set a different products-per-page there, but as far as I can tell, the only place to change it is in the "Pagination" options.

            I'd rather not make another Category template for this one minor difference since there is a lot of cusomization on my template, and trying to keep any changes consistent between the two will get messy really fast.

            Comment


              #7
              Re: Category Sorting/Pagination

              Is it possible to have several categories paginated with different numbers of products per page using the same page template?
              I hate to bump threads, but I feel that this is really important. There should be a tab on the edit category screen that allows you to set a default sorting and pagination, especially now that miva natively supports this. I really need the ability to set certain categories to sort by newest by default, and certain other categories to not paginate (or display a non-standard number of products).

              Comment


                #8
                Re: Category Sorting/Pagination

                Is it possible to have several categories paginated with different numbers of products per page using the same page template?
                It might be better to start a whole separate new thread with this question. I think you would get more responses and better answers if you did.

                Hope this helps.
                Mark Romero
                ~~~~~~~~

                Comment


                  #9
                  Re: Category Sorting/Pagination

                  Originally posted by Siamese-Dream.Com View Post
                  It might be better to start a whole separate new thread with this question. I think you would get more responses and better answers if you did.

                  Hope this helps.
                  Hrm, maybe not. I started a new thread about a month ago, which has gotten no replies.

                  http://extranet.mivamerchant.com/for...ducts-per-page
                  Last edited by emdub; 06-28-12, 10:06 AM.

                  Comment


                    #10
                    Re: Category Sorting/Pagination

                    ...then one could assume that this of importance only to you? As for setting category pagination to 30 and one category with 31...i'd go and set pagination to 32 (or 33 if in rows of 3).
                    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

                    Working...
                    X