jaimex8
3/1/2016 - 12:19 AM

Dynamic product count pagination

Dynamic product count pagination

(CTGY)
<span class="count-label">
<!-- Offset: &mvt:global:catlistingoffset;, Current Page: &mvt:category_listing:page_links:current_page;, Count: &mvt:category_product_count;-->      
<mvt:if expr="l.settings:category_listing:page_links:current_page EQ 1">
Showing 1-&mvt:category_product_count; of &mvt:category_listing:total_prod_count;
<mvt:else>
Showing <mvt:eval expr="(g.catlistingoffset * (l.settings:category_listing:page_links:current_page - 1)) + 1" />-<mvt:eval expr="(g.catlistingoffset * (l.settings:category_listing:page_links:current_page - 1))+l.settings:category_product_count" /> of &mvt:category_listing:total_prod_count;
</mvt:if>
</span>


(Search)
<mvt:if expr="g.searchoffset">
    <mvt:assign name="beginingNum" value="(g.searchoffset + g.ProductsPerPage) - g.ProductsPerPage + 1" />
    <mvt:assign name="lastNum" value="g.beginingNum + g.ProductsPerPage" />
    <mvt:if expr="g.lastNum GT l.settings:search_product_count">
        Showing &mvt:global:beginingNum; - &mvte:search_product_count; of &mvte:search_product_count;
    <mvt:else>
        <mvt:assign name="lastNum" value="(g.beginingNum + g.ProductsPerPage) - 1" />
        Showing &mvt:global:beginingNum; - &mvt:global:lastNum; of &mvte:search_product_count;
    </mvt:if>
<mvt:else>
    Showing 1 - &mvt:global:ProductsPerPage; of &mvte:search_product_count;
</mvt:if>