Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 18 of 18

Thread: How to make "View All" Pagination for Manufacturers and section pages?

  1. #1
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default How to make "View All" Pagination for Manufacturers and section pages?

    Hi everybody, I want to be able to code my manufacturer and category pages to have the View All to just show all the products listed. Right now I have the pagination broken down the standard way, all I want to do is to add a "View All" right next to the last page number. Any tips ???

  2. #2
    ROBB is offline Senior Member
    Join Date
    Jun 2011
    Location
    United States
    Posts
    107

    Default View All Pages

    Note: I haven't tried this, per se, but it should work

    Do a search for "@pagesize = null," (without the quotes) in your entity xml package. Right above it, you should see "@pagenum = @pgnum,". What you want to do, is change the @pagesize parameter to behave like the pagenum parameter, by retrieving the page size from a querystring.

    In other words, you will want to do the following:
    1) Change "@pagesize = null," to something like "@pagesize = @pgsize,"
    2) Look for the following:
    Code:
            <queryparam paramname="@pgnum"          paramtype="request"   requestparamname="pagenum"                                       sqlDataType="int"     defvalue="1"      validationpattern="" />
    2) Copy and paste that line of code (below or above, doesnt matter)
    3) Modify it:
    Code:
            <queryparam paramname="@pgsize"          paramtype="request"   requestparamname="pagesize"                                       sqlDataType="int"     defvalue="1"      validationpattern="" />
    4) Create a link inside the paging control div. This will be your "View All" link. Getting it to flow with the other links may be a little tricky, and will most likely require CSS mods to get it right. Format the link by using the BaseURL parameter, and then adding the querystring pagenum, and finally adding your pagesize parameter with a value of 999999.

    Hopefully you have a staging site to test these changes beforehand.

  3. #3
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default

    I'm still not doing it right ... is there anyway you can show me what files I need to edit ? Here is my site ..


    http://www.farralane.com/store/m-3-e...-lighting.aspx

    Example of one of the pages I want a View All for ...

    Thanks !

  4. #4
    ROBB is offline Senior Member
    Join Date
    Jun 2011
    Location
    United States
    Posts
    107

    Default Xml Package Changes

    It appears the changes should be made to your "entity.gridwithprices.xml.config" xml package.

    If you would like, I can quickly mod the xml package for you. Just email it over to me.

  5. #5
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default

    Emailed it to you !! :-)

  6. #6
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default

    Did you receieve it ? I sent to the email listed on your bio

  7. #7
    ROBB is offline Senior Member
    Join Date
    Jun 2011
    Location
    United States
    Posts
    107

    Default Received

    Yes, and I replied to your email.

  8. #8
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default

    my outlook sucks!!! can you email it to joecalardo@yahoo.com ? Thanks again I'm going to look over it

  9. #9
    ROBB is offline Senior Member
    Join Date
    Jun 2011
    Location
    United States
    Posts
    107

    Default Email

    NP, I'll send it over once I'm done implementing the changes.

  10. #10
    joecalardo is offline Member
    Join Date
    May 2011
    Posts
    61

    Default

    Thankss again

  11. #11
    zariaruiz is offline Member
    Join Date
    May 2011
    Posts
    31

    Default

    Hello,

    Can you post how yo get the View All functionality finally working?

    I was trying to follow the instructions, but I created a problem with the pagination control. After I added the pagesize parameter the control only shows one product per page. How can I enter the parameter pagesize for the control use.

    Thank you

  12. #12
    zariaruiz is offline Member
    Join Date
    May 2011
    Posts
    31

    Default

    No problem I found it. Was the defvalue="1". I updated to 20.

    Thanks

  13. #13
    andrewo@postalproducts.co is offline Junior Member
    Join Date
    Feb 2010
    Posts
    3

    Default Helping implementing view all

    Hey Robb, Can you send me a copy of the code of such implementation to andrewo@postalproducts.com. Thanks.

  14. #14
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    Hey ROBB,

    Any possibility you could post up an example of how you built the link in step 4 of your procedure?

    I'm having difficulty figuring out exactly how it should be formatted.
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  15. #15
    ROBB is offline Senior Member
    Join Date
    Jun 2011
    Location
    United States
    Posts
    107

    Default Paging with View All

    Sure, here is the markup for the entity.gridwithprices.xml.config file. I believe all of the modifications are enclosed in comment tags (EditHere). The only areas I did not comment are in the query.

    Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="Entity Grid with Prices" debug="false" includeentityhelper="true">
    
      <!-- ###################################################################################################### -->
      <!-- Copyright AspDotNetStorefront.com, 1995-2007.  All Rights Reserved.					                -->
      <!-- http://www.aspdotnetstorefront.com														                -->
      <!-- For details on this license please visit  the product homepage at the URL above.		                -->
      <!-- THE ABOVE NOTICE MUST REMAIN INTACT.                                                                   -->
      <!--                                                                                                        -->
      <!-- ###################################################################################################### -->
    
    
      <query name="Products" rowElementName="Product">
        <sql>
          <![CDATA[
                    exec aspdnsf_GetProducts 
                        @categoryID = @CatID,
                        @sectionID = @SecID,
                        @manufacturerID = @ManID,
                        @distributorID = @DistID,
                        @genreID = @GenreID,
                        @vectorID = @VectorID,
                        @localeName = @locale,
                        @CustomerLevelID = @CustLevelID,
                        @affiliateID = @AffID,
                        @ProductTypeID = @ProdTypeID, 
                        @ViewType = 1,
                        @pagenum = @pgnum,
                        @pagesize = @pgsize,
                        @StatsFirst = 0,
                        @publishedonly = 1,
                        @ExcludePacks = 0,
                        @ExcludeKits = 0,
                        @ExcludeSysProds = 0,
                        @InventoryFilter = @InvFilter,
                        @sortEntityName = @entityname
                ]]>
        </sql>
        <queryparam paramname="@CatID" paramtype="runtime" requestparamname="CatID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@SecID" paramtype="runtime" requestparamname="SecID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@ManID" paramtype="runtime" requestparamname="ManID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@DistID" paramtype="runtime" requestparamname="DistID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@GenreID" paramtype="runtime" requestparamname="GenreID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@VectorID" paramtype="runtime" requestparamname="VectorID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@locale" paramtype="runtime" requestparamname="LocaleSetting" sqlDataType="varchar" defvalue="en-US"  validationpattern="" />
        <queryparam paramname="@CustLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@AffID" paramtype="runtime" requestparamname="AffiliateID" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@ProdTypeID" paramtype="runtime" requestparamname="ProductTypeFilterID" sqlDataType="int" defvalue="1"  validationpattern="" />
        <queryparam paramname="@pgnum" paramtype="request" requestparamname="pagenum" sqlDataType="int" defvalue="1"  validationpattern="" />
        <queryparam paramname="@pgsize" paramtype="request" requestparamname="pagesize" sqlDataType="int" defvalue="20"  validationpattern="" />
        <queryparam paramname="@InvFilter" paramtype="appconfig" requestparamname="HideProductsWithLessThanThisInventoryLevel" sqlDataType="int" defvalue="0"  validationpattern="" />
        <queryparam paramname="@entityname" paramtype="runtime" requestparamname="EntityName" sqlDataType="varchar" defvalue=""  validationpattern="" />
      </query>
    
    
      <PackageTransform>
    
        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
          <xsl:output method="html" omit-xml-declaration="yes" />
    
          <xsl:param name="LocaleSetting" select="/root/Runtime/LocaleSetting" />
          <xsl:param name="WebConfigLocaleSetting" select="/root/Runtime/WebConfigLocaleSetting" />
          <xsl:param name="ShowSubcatsInGrid">
            <xsl:value-of select="aspdnsf:AppConfig('ShowSubcatsInGrid')" />
          </xsl:param>
          <xsl:param name="SubcatGridCols">
            <xsl:value-of select="/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/ColWidth" />
          </xsl:param>
          <xsl:param name="EntityName">
            <xsl:value-of select="/root/Runtime/EntityName" />
          </xsl:param>
          <xsl:param name="EntityID">
            <xsl:value-of select="/root/Runtime/EntityID" />
          </xsl:param>
          <xsl:param name="WholesaleOnlySite">
            <xsl:value-of select="aspdnsf:AppConfigBool('WholesaleOnlySite')"/>
          </xsl:param>
    
          <xsl:param name="BaseURL">
            <xsl:choose>
              <xsl:when test="aspdnsf:StrToLower(/root/Runtime/EntityName) = 'category'">
                c-<xsl:value-of select="/root/Runtime/EntityID" />-<xsl:value-of select="/root/QueryString/sename" />.aspx
              </xsl:when>
              <xsl:when test="aspdnsf:StrToLower(/root/Runtime/EntityName) = 'section'">
                s-<xsl:value-of select="/root/Runtime/EntityID" />-<xsl:value-of select="/root/QueryString/sename" />.aspx
              </xsl:when>
              <xsl:when test="aspdnsf:StrToLower(/root/Runtime/EntityName) = 'manufacturer'">
                m-<xsl:value-of select="/root/Runtime/EntityID" />-<xsl:value-of select="/root/QueryString/sename" />.aspx
              </xsl:when>
              <xsl:when test="aspdnsf:StrToLower(/root/Runtime/EntityName) = 'library'">
                l-<xsl:value-of select="/root/Runtime/EntityID" />-<xsl:value-of select="/root/QueryString/sename" />.aspx
              </xsl:when>
            </xsl:choose>
          </xsl:param>
    
          <xsl:param name="CurrentPage">
            <xsl:choose>
              <xsl:when test="/root/QueryString/pagenum">
                <xsl:value-of select="/root/QueryString/pagenum" />
              </xsl:when>
              <xsl:otherwise>1</xsl:otherwise>
            </xsl:choose>
          </xsl:param>
    
          <!--EditHere-->
          <xsl:param name="PageSize">
            <xsl:choose>
              <xsl:when test="/root/QueryString/pagesize">
                <xsl:value-of select="/root/QueryString/pagesize" />
              </xsl:when>
              <xsl:otherwise>20</xsl:otherwise>
            </xsl:choose>
          </xsl:param>
          <!--End EditHere-->
    
          <xsl:template match="/">
    
            <!--EditHere-->
            <xsl:param name="QueryStringChar">
              <xsl:choose>
                <xsl:when test="contains($BaseURL,'?')">&amp;</xsl:when>
                <xsl:otherwise>?</xsl:otherwise>
              </xsl:choose>
            </xsl:param>
    
            <xsl:param name="BaseURLNoSpace">
              <xsl:value-of select="aspdnsf:StrReplace($BaseURL,' ','')"/>
            </xsl:param>
    
            <xsl:param name="BaseURLNoBreak">
              <xsl:value-of select="aspdnsf:StrReplace($BaseURLNoSpace,'
    ','')"/>
            </xsl:param>
    
    
            <xsl:param name="PagingControl">
              <xsl:choose>
                <xsl:when test="/root/QueryString/pagesize">
                  <xsl:value-of select="aspdnsf:PagingControl(concat($BaseURLNoBreak, $QueryStringChar,'pagesize=',$PageSize), $CurrentPage, /root/Products2/Product/pages)" disable-output-escaping="yes" />
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="aspdnsf:PagingControl($BaseURLNoBreak, $CurrentPage, /root/Products2/Product/pages)" disable-output-escaping="yes" />
                </xsl:otherwise>
              </xsl:choose>
            </xsl:param>
            <!--End EditHere-->
    
            <div>
              <xsl:value-of select="aspdnsf:EntityPageHeaderDescription($EntityName, $EntityID)" disable-output-escaping="yes" />
            </div>
            <xsl:value-of select="aspdnsf:EntityPageFilterOptions($EntityName, $EntityID, /root/Runtime/SecID, /root/Runtime/CatID, /root/Runtime/ManID, /root/Runtime/ProductTypeFilterID)" disable-output-escaping="yes" />
            <xsl:call-template name="SubEntity" />
            <xsl:choose>
              <xsl:when test="count(/root/Products/Product) = 0 and count(/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/Entity) = 0">
                <xsl:value-of select="aspdnsf:Topic(concat('empty', /root/Runtime/EntityName, 'text'))" disable-output-escaping="yes" />
              </xsl:when>
              <xsl:otherwise>
                <div style="text-align:right;">
                  <!--EditHere-->
                  <xsl:value-of select="$PagingControl" disable-output-escaping="yes"/>
                  <xsl:if test="number(/root/Products2/Product/pages) &gt; 1">
                    &#160;<a href="{concat($BaseURLNoBreak,$QueryStringChar,'pagesize=999999999')}">View All</a>
                  </xsl:if>
                  <!--<xsl:value-of select="aspdnsf:PagingControl($BaseURL, $CurrentPage, /root/Products2/Product/pages)" disable-output-escaping="yes" />-->
                  <!--End EditHere-->
                </div>
                <table border="0" cellpadding="0" cellspacing="4" width="100%" class="spespacer">
                  <xsl:apply-templates select="/root/Products/Product" />
                </table>
                <div style="text-align:right;">
                  <!--EditHere-->
                  <xsl:value-of select="$PagingControl" disable-output-escaping="yes"/>
                  <xsl:if test="number(/root/Products2/Product/pages) &gt; 1">
                    &#160;<a href="{concat($BaseURLNoBreak,$QueryStringChar,'pagesize=999999999')}">View All</a>
                  </xsl:if>
                  <!--<xsl:value-of select="aspdnsf:PagingControl($BaseURL, $CurrentPage, /root/Products2/Product/pages)" disable-output-escaping="yes" />-->
                  <!--End EditHere-->
                </div>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:template>
    
    
          <xsl:template name="SubEntity">
            <xsl:variable name="delta">
              <xsl:choose>
                <xsl:when test="(count(/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/Entity) mod number($SubcatGridCols)) = 0">0</xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="number($SubcatGridCols)-(count(/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/Entity) mod number($SubcatGridCols))"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="rows" select="ceiling(count(/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/Entity) div number($SubcatGridCols))" />
    
            <xsl:for-each select="/root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[ParentEntityID=/root/Runtime/EntityID]">
    
              <xsl:variable name="entityposition" select="position()" />
    
              <xsl:choose>
                <xsl:when test="$ShowSubcatsInGrid = 'true'">
                  <table border="0" cellpadding="0" cellspacing="4" width="100%">
                    <xsl:if test="position() mod $SubcatGridCols = 1 or ($SubcatGridCols = 1)">
                      <tr>
                        <xsl:for-each select=". | following-sibling::*[position() &lt; $SubcatGridCols]">
                          <xsl:variable name="scName" select="aspdnsf:GetMLValue(Name)"></xsl:variable>
    
                          <xsl:call-template name="SubCatCell">
                            <xsl:with-param name="scName" select="$scName" />
                          </xsl:call-template>
    
                          <xsl:if test="ceiling($entityposition div  number($SubcatGridCols)) = $rows and $delta &gt; 0">
                            <xsl:call-template name="FillerCells">
                              <xsl:with-param name="cellCount" select="$delta" />
                            </xsl:call-template>
                          </xsl:if>
    
                        </xsl:for-each>
                      </tr>
                      <tr>
                        <td height="10" colspan="{$SubcatGridCols}">&#0160;</td>
                      </tr>
                    </xsl:if>
                  </table>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:variable name="scName" select="aspdnsf:GetMLValue(Name)"></xsl:variable>
    
                  <p align="left">
                    &#0160;<img border="0" src="{concat('skins/skin_', aspdnsf:SkinID(), '/images/redarrow.gif')}"></img>&#0160;
                    <a href="{aspdnsf:EntityLink(EntityID, SEName, $EntityName, 0, '')}">
                      <xsl:value-of select="$scName" disable-output-escaping="yes"/>
                    </a>
                  </p>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:for-each>
          </xsl:template>
    
    
          <xsl:template name="SubCatCell">
            <xsl:param name="scName"></xsl:param>
    
    
            <xsl:param name="URL">
              <xsl:value-of select="aspdnsf:EntityLink(EntityID, SEName, $EntityName, 0, '')" />
            </xsl:param>
    
            <td align="center">
              <a href="{$URL}">
                <xsl:value-of select="aspdnsf:LookupEntityImage(EntityID, $EntityName, 'icon', 0)" disable-output-escaping="yes" />
              </a>
              <br/>
              <a href="{$URL}">
                <xsl:value-of select="$scName" disable-output-escaping="yes"/>
              </a>
            </td>
    
          </xsl:template>
    
    
          <xsl:template match="Product">
    
            <xsl:variable name="delta">
              <xsl:choose>
                <xsl:when test="(count(/root/Products/Product) mod number($SubcatGridCols)) = 0">0</xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="number($SubcatGridCols)-(count(/root/Products/Product) mod number($SubcatGridCols))"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="rows" select="ceiling(count(/root/Products/Product) div number($SubcatGridCols))" />
    
    
            <xsl:if test="$SubcatGridCols = 1">
              <tr>
                <xsl:call-template name="ProductCell"></xsl:call-template>
              </tr>
            </xsl:if>
    
    
            <xsl:if test="position() mod $SubcatGridCols = 1 and $SubcatGridCols &gt; 1">
              <tr>
                <xsl:for-each select=". | following-sibling::*[position() &lt; $SubcatGridCols]">
                  <xsl:call-template name="ProductCell"></xsl:call-template>
                </xsl:for-each>
                <xsl:if test="ceiling(position() div  number($SubcatGridCols)) = $rows and $delta &gt; 0">
                  <xsl:call-template name="FillerCells">
                    <xsl:with-param name="cellCount" select="$delta" />
                  </xsl:call-template>
                </xsl:if>
              </tr>
            </xsl:if>
    
          </xsl:template>
    
    
          <xsl:template name="ProductCell">
    
            <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
            <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"></xsl:param>
    
            <td align="center" valign="top">
              <a href="{aspdnsf:ProductandEntityLink(ProductID, SEName, $EntityID, $EntityName, 0)}">
                <xsl:value-of select="aspdnsf:LookupImage(ProductID, 'product', 'icon', 1)" disable-output-escaping="yes"/>
              </a>
              <br/>
              <a href="{aspdnsf:ProductandEntityLink(ProductID, SEName, $EntityID, $EntityName, 0)}">
                <xsl:value-of select="$pName" disable-output-escaping="yes"/>
              </a>
              <br/>
              <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
            </td>
    
          </xsl:template>
    
          <xsl:template name="FillerCells">
            <xsl:param name="cellCount"/>
            <xsl:param name="CellWidth" select="100 div $SubcatGridCols" />
            <td width="{$CellWidth}%">&#160;</td>
            <xsl:if test="$cellCount > 1">
              <xsl:call-template name="FillerCells">
                <xsl:with-param name="cellCount" select="$cellCount - 1"/>
              </xsl:call-template>
            </xsl:if>
          </xsl:template>
    
    
    
        </xsl:stylesheet>
      </PackageTransform>
    </package>

    The following are the lines I did not comment in the query area:
    Original line:
    HTML Code:
    @pagesize = null,
    Modified to:
    HTML Code:
    @pagesize = @pgsize,
    Insert the following line along with the other queryparam's:
    HTML Code:
    <queryparam paramname="@pgsize" paramtype="request" requestparamname="pagesize" sqlDataType="int" defvalue="20"  validationpattern="" />
    Let me know if you have any questions
    Last edited by ROBB; 05-28-2012 at 09:44 PM.

  16. #16
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    ROBB you are the man! I wasn't even headed close to the right direction but got it working perfectly using your xml package as a base.

    Thanks!
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  17. #17
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    Actually, after a little more testing I seem to have run into a problem. It was working fine for a few minutes, now whenever I click the View All link, it returns a 404 file not found, and the url looks like this:
    Code:
    https://domain.com/{concat($BaseURLNoBreak,$QueryStringChar,'pagesize=999999999')}
    EDIT: Sorry, my mistake. For some reason the editor I am using likes to change the way special characters are used. It was replacing ')} with "%27%29%7D" after saving changes to the file.
    Last edited by donttryathome; 01-11-2012 at 03:15 PM.
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  18. #18
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Quote Originally Posted by donttryathome View Post
    Actually, after a little more testing I seem to have run into a problem. It was working fine for a few minutes, now whenever I click the View All link, it returns a 404 file not found, and the url looks like this:
    Code:
    https://domain.com/{concat($BaseURLNoBreak,$QueryStringChar,'pagesize=999999999')}
    EDIT: Sorry, my mistake. For some reason the editor I am using likes to change the way special characters are used. It was replacing ')} with "%27%29%7D" after saving changes to the file.
    I have this same issue in Firefox (weird). I have to use IE in order for it to save/update properly...