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 10 of 10

Thread: Products on front page

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

    Question Products on front page

    I'm using featured products to display items on my front page. I'm noticing that every time I refresh the page the display order of the items changes randomly. I'm not sure if this is the way it works out of box or if some of my changes caused this to start happening.

    My question is how do I (or where in the XML package do I ) set the display order for the featured products?

    ML 8.0.1.2/8.0.1.2
    Last edited by donttryathome; 03-22-2011 at 03:46 PM.
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    They are sorted according to "newid()" function. You can open the aspdnsf_GetFeaturedProducts stored proc, and change that to something else (i.e. order by name).

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

    Default

    Can changes to the XML package affect the way this sorts?

    As of right now, every time I refresh the page, the items appear randomly. There doesn't seem to be any sorting being done.
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

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

    Default

    I hate to bump a thread this old but I'm still stumped, having spent a fair amount of time trying to figure this out, and about to give up.

    There is no sorting being done on our side. Even using the original, unaltered, featuredproducts.xml.config package, every page reload shows the featured products in random order. You noted that it's sorted using the "newid()" function, but still there is NO sorting what so ever. How can this happen?

    Ideally I would love to be able to sort these products however they're configured in the display order of the admin site.

    Is there any method available to sort the products from within the XML package itself? I don't have access to our database so I can't edit the stored procedure.

    Please help before I go crazy!
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  5. #5
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    newid() will give a random order each time.
    You could modify the xmlpackage to pull the relevant products just as in a category/entity xmlpackage.


    TTFN

    BFG

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

    Default

    Thanks BFG, I understand where you're going with this. What is the easiest (or proper) way to narrow down the display to only show products from a single category?

    I've tooled around a bit with our entity.gridwithprices.xml.config package but so far I've been unable to figure out to tell it to only display products from a single category. I'm an xslt newbie, for the most part, and I understand your train of thought, I'm just not very familiar where in the XML package it's being told to pull from the current category or where it should be told to only pull from a certain category.

    Thanks Again!
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  7. #7
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    At the top of the xmlpackage - there'll be something like this :-

    Code:
                    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 = null,
                        @StatsFirst = 0,
                        @publishedonly = 1,
                        @ExcludePacks = 0,
                        @ExcludeKits = 0,
                        @ExcludeSysProds = 0,
                        @InventoryFilter = @InvFilter,
                        @sortEntityName = @entityname
    If you change it to something like this :-

    Code:
                    exec aspdnsf_GetProducts 
                        @categoryID = 123,
                        @localeName = @locale,
                        @CustomerLevelID = @CustLevelID,
                        @affiliateID = @AffID,
                        @ProductTypeID = @ProdTypeID, 
                        @ViewType = 1,
                        @pagenum = @pgnum,
                        @pagesize = null,
                        @StatsFirst = 0,
                        @publishedonly = 1,
                        @ExcludePacks = 0,
                        @ExcludeKits = 0,
                        @ExcludeSysProds = 0,
                        @InventoryFilter = @InvFilter,
                        @sortEntityName = Category
    It should pull products from category 123.



    TTFN

    BFG

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

    Default

    I actually did try that before hand but I get the error "Error Calling XSLTExtension Function EntityPageHeaderDescription: Invalid value specified for EntityID ()" and I can't seem to find the cause/resolution for this anywhere on the forum.

    Thanks!
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  9. #9
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    I'm guessing you don't actually need the EntityPageHeaderDescription on your homepage - so, you can simply delete that node from the xmlpackage.


    Alternatively (& this is probably a 'better' way to do it) you could find these 2 lines :-

    Code:
                <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>
    & replace with these :-

    Code:
                <xsl:param name="EntityName">Category</xsl:param>
                <xsl:param name="EntityID">123</xsl:param>

    TTFN

    BFG

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

    Default

    Still no go. I did everything you suggested and now I'm receiving an error associated with this line:
    Code:
    <xsl:value-of select="aspdnsf:EntityPageFilterOptions($EntityName, $EntityID, /root/Runtime/SecID, /root/Runtime/CatID, /root/Runtime/ManID, /root/Runtime/ProductTypeFilterID)" disable-output-escaping="yes" />
    Results in the error "Error Calling XSLTExtension Function EntityPageFilterOptions: Invalid value specified for SectionFilterID ()".

    Commenting out that line in the XML package doesn't produce any errors, but it doesn't return any products at all.

    Any Ideas?
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2