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

Thread: How are products hidden if inventory threshold is flagged?

  1. #1
    DENT is offline Member
    Join Date
    Mar 2010
    Posts
    42

    Default How are products hidden if inventory threshold is flagged?

    From what I understand, you can hide products if they fall below a certain inventory level threshhold.

    What function is called to check this?

    I have a custom product feed that I built, and right now it isn't hiding those products since the logic isn't in place.

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    The product list is generated on each entity page by executing the dbo.aspdnsf_GetProducts stored procedure, with a bunch of parameters (categoryID, pagesize, InventoryFilter, etc). Check out how we do that in the entity.*.xml.config XML packages for an example.

  3. #3
    DENT is offline Member
    Join Date
    Mar 2010
    Posts
    42

    Default

    I'm running version 8 with no source code, it seems all the xml packages are using stored procedures which are locked?

    I need to know whether I can include a product in a feed, right now I am doing:

    C#/VB.NET Code:
     SELECT p.*,
           
    pv.*,
        
    FROM product p (NOLOCK)
            
    left outer join productVariant pv (NOLOCKon pv.productID p.productID
        WHERE 
            p
    .deleted AND pv.deleted 0            -- delete
            
    AND p.published AND pv.published 1    -- published 

    This is currently returning products that have their inventory threshold set, so they should be hidden if inventory reachs x.

  4. #4
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    That's going to return everything that is published and not deleted, which is not how the software handles inventory hiding. You would have to modify that SQL query to look at the related product variant and check that Inventory > whatever # you want.

    It'd probably be easier to use the same sproc we do in our XML packages, which'll return just what you're after. If you want to look at the 'innards' of those sprocs, you can unlock them with the directions here.