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: Adding Product Inventory Amount To product.VariantsInRightBar.xml.config

  1. #1
    td_sas is offline Member
    Join Date
    Jan 2009
    Posts
    42

    Question Adding Product Inventory Amount To product.VariantsInRightBar.xml.config

    Hi:

    How can I add/access the current product inventory amount to these pages:

    product.VariantsInRightBar.xml.config
    entity.grid.xml.config

    I need to get the inventory amount for each product to test whether the item is in stock, and display a customized message when it is not in stock - the app config HideProductsWithLessThanThisInventoryLevel is set to 0 to keep all products visible on our site - but we need to designate a product in red color, message "out of stock", etc... on the entity.

    Thanks!

  2. #2
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Sure, simply insert this line and feed it with the appropriate parameter:

    Code:
    <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
    As far as I know, this is already built-in on the product.VariantsInRightBar.xml.config, simply set the AppConfig: ShowInventoryTable to true to turn on its display...

  3. #3
    td_sas is offline Member
    Join Date
    Jan 2009
    Posts
    42

    Question

    I know the code you are referring to, I saw it in the product.VariantsInRightBar.xml.config file. But all that does is to show whether the product is in stock or not by displaying "In Stock: Yes" or "In Stock: No" according to what I read in the code.

    What I need is a way to read the inventory amount as a number and not the inventory table - I need the actual remaining inventory quantity. Can you please tell me how to add code to reference that in both pages that I mentioned?

    Thanks

  4. #4
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Nope, as you can see on that XML package, specifically these lines:
    Code:
    <xsl:choose>
    <xsl:when test="aspdnsf:AppConfigBool('ShowInventoryTable')='true'">
    <tr>
    <td align="left" colspan="2" width="100%">
    <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
    </td>
    </tr>
    </xsl:when>
    <xsl:otherwise>
    <xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProducts') = 'true'">
    <tr>
    <td align="left" colspan="2" width="100%">
    <xsl:value-of select="aspdnsf:DisplayProductStockHint(ProductID, VariantID, 'Product')" disable-output-escaping="yes" />
    </td>
    </tr>
    </xsl:if>
    </xsl:otherwise>
    </xsl:choose>
    The stock status message will only show if the aspdnsf:AppConfigBool('ShowInventoryTable')='true' isn't met, other than that. It should display. See attachment.
    Attached Images Attached Images