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

Thread: Display Variant extension Data

  1. #1
    medsupply is offline Senior Member
    Join Date
    Jul 2011
    Posts
    99

    Default Display Variant extension Data

    I would like to display the variant ext data info in the VariantsInRightBar XML package. I am able to display them at the product level but not at the variant level.

    Thsis is what I am doing:

    <xsl:template match="Variant">
    <xslaram name="vExtensionData" select="aspdnsf:GetMLValue(ExtensionData)"></xslaram>
    ...

    Then, where data is displayed:

    <xsl:value-of select="$vExtensionData" disable-output-escaping="yes" />

    I believe the SQL query at the top of the package pulls the info for the product but not the variants.

    Can somebody please help me with the missing query?

    Thanks!
    Last edited by medsupply; 09-19-2011 at 11:50 AM.

  2. #2
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi

    Yes, you're correct - the VariantsInRightBar XML uses the stored procedure 'aspdnsf_ProductInfo' to retrieve the product and variant fields. This stored procedure does retrieve all of the product fields but not all of the variant fields and the Variant's ExtensionData field is one that's missing.

    To fix this, you just need to edit the aspdnsf_ProductInfo procedure and get it to bring back pv.ExtensionData. Because there is already a product ExtensionData field, you'll need to give it a unique name, something like this:

    pv.name VariantName, pv.ExtensionData vXdata, pv.Price,

    Then use the same XML as you have already but change the name to vXdata (based on the above example) like this:

    Code:
    <xsl:param name="vExtensionData" select="aspdnsf:GetMLValue(vXData)"></xsl:param>

  3. #3
    medsupply is offline Senior Member
    Join Date
    Jul 2011
    Posts
    99

    Default

    Webopius, I appreciate your help but sorry, you are going to make it more "dummy proof" than that.

    I am a total newbie and a non-programmer trying to "hack" the XML package :-)

  4. #4
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Lol, I'm afraid I don't have the skills to strip down the steps much more than this.

    It might be better to contact an ASPDotNetStorefront developer to do this for you - it's only going to take about 15 mins to write assuming access to your database and web server.

    By all means get in touch!
    Adam

  5. #5
    btappan2 is offline Member
    Join Date
    Apr 2012
    Posts
    43

    Default

    I added the code in red below to product.variantsingrid template trying to display the data in extensiondata2, my label "Loc" for location shows, but no extensiondata next to it, if i query the db for that field "downstairs" is there, but it won't show in the product display, any ideas?

    Code:
    pv.Description as VariantDescription, pv.name VariantName, pv.ExtensionData2 vXdata, pv.skusuffix, pv.Price,

    Code:
                <xsl:template name="VariantCell">
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(/root/Products/Product/Name)"></xsl:param>
                    <xsl:param name="pSKU" select="/root/Products/Product/SKU"></xsl:param>
                    <xsl:param name="HidePriceUntilCart" select="/root/Products/Product/HidePriceUntilCart"></xsl:param>
    
                    <xsl:param name="vName" select="aspdnsf:GetMLValue(VariantName)"></xsl:param>
                    <xsl:param name="vDescription" select="aspdnsf:GetMLValue(VariantDescription)"></xsl:param>
                    <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(/root/Products/Product/SalesPromptName)"></xsl:param>
    
    		<xsl:param name="vExtensionData2" select="aspdnsf:GetMLValue(vXData)"></xsl:param>
    
                    <xsl:param name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xsl:param>
                    <xsl:param name="AltText">
                        <xsl:choose>
                            <xsl:when test="$pSEAltText='' and $vName!=''"><xsl:value-of select="$vName" /></xsl:when>
                            <xsl:otherwise><xsl:value-of select="$pSEAltText" /></xsl:otherwise>
                        </xsl:choose>
                    </xsl:param>
    Code:
    <tr><td><font class="SmallGridText"><xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.21', $LocaleSetting)" disable-output-escaping="yes" /><xsl:value-of select="concat($pSKU, skusuffix)" /></font></td></tr>
                            <xsl:if test="$vDescription!=''"><tr><td><xsl:value-of select="$vDescription" disable-output-escaping="yes" /></td></tr></xsl:if>
                            <xsl:if test="Weight!=''"><tr><td><font class="SmallGridText"><xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.24', $LocaleSetting)" disable-output-escaping="yes" /><xsl:value-of select="aspdnsf:FormatDecimal(Weight, 2)" /></font></td></tr></xsl:if>
                            <xsl:if test="Dimensions!=''"><tr><td><font class="SmallGridText"><xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.23', $LocaleSetting)" disable-output-escaping="yes" /><xsl:value-of select="Dimensions" /></font></td></tr></xsl:if>                        
    			<tr><td><font class="SmallGridText">Loc<xsl:value-of select="$vExtensionData2" disable-output-escaping="yes" /></font></td></tr>

  6. #6
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi

    The ExtensionData2 column is in the Product table isn't it?

    From your code, it looks like you are trying to retrieve it from the ProductVariant table:
    pv.ExtensionData2 vXdata

    If you change this from ProductVariant (pv) to Product (p), I think it will work...
    p.ExtensionData2 vXdata

    Adam

  7. #7
    btappan2 is offline Member
    Join Date
    Apr 2012
    Posts
    43

    Default

    Nope, extensiondata2 also exists in the Product.Variant table, so does 3,4, and 5. take a look at the attached screen shot and you'll see the extensiondata2 field is poplulated too. I used the following query to populate it:

    UPDATE productvariant set extensiondata2 = 'UPSTAIRS' where variantid = 1297

    and this to retrieve it:

    SELECT extensiondata2 FROM productvariant where variantid = 1297

    What I am trying to do here is store warehouse locations at the variant level, the same way inventory counts are stored at the variant level. Since some of our variants are stored in different locations i.e. "new" - here, "used" - over there, we must do this at the variant level. will the extensiondata2 field play okay with "-" and "," in it? some of our shelf #'s contain those characters. I also tried it with just extensiondata, without the 2, and it still won't display the field with my code above.
    Attached Images Attached Images  
    Last edited by btappan2; 08-30-2012 at 05:33 AM.

  8. #8
    btappan2 is offline Member
    Join Date
    Apr 2012
    Posts
    43

    Default

    Do i need a closing tag for the <xsl:value-of select="$vExtensionData2" disable-output-escaping="yes" /> ??

  9. #9
    GoVedia is offline Member
    Join Date
    Oct 2012
    Location
    Orange, CA
    Posts
    98

    Default Casing

    @btappan2,

    It appears that you are already closing off value-of element correctly. However, I do see a potential issue with your casing (vXdata vs vxData).

    Make sure you have the same casing for your column name here:
    pv.ExtensionData2 vXdata
    And here:
    <xslaram name="vExtensionData2" select="aspdnsf:GetMLValue(vXData)"></xslaram>

    Let me know if that does works out for you.

    Robert

  10. #10
    btappan2 is offline Member
    Join Date
    Apr 2012
    Posts
    43

    Default

    I found that pv.ExtensionData2 vXdata can't be added to successfully to the procedure, it returns nothing in debug for some reason. So I dropped the 2 everywhere.

    with debug on, I see the "UPSTAIRS" making it through:

    Code:
      <Variants>
        <Variant>
          <SEAltText>FACTORY NEW</SEAltText>
          <VariantID>1297</VariantID>
          <ProductID>433</ProductID>
          <VariantDescription />
          <VariantName>FACTORY NEW</VariantName>
          <vXdata>UPSTAIRS</vXdata>
          <skusuffix>-FNP</skusuffix>
          <Price>0.0000</Price>
          <SalePrice>0.0000</SalePric
    Here is what my code looks like:
    Code:
    pv.Description as VariantDescription, pv.name VariantName, pv.ExtensionData vXdata, pv.skusuffix, pv.Price,
    Code:
    <xsl:template name="VariantCell">
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(/root/Products/Product/Name)"></xsl:param>
                    <xsl:param name="pSKU" select="/root/Products/Product/SKU"></xsl:param>
                    <xsl:param name="HidePriceUntilCart" select="/root/Products/Product/HidePriceUntilCart"></xsl:param>
    
                    <xsl:param name="vName" select="aspdnsf:GetMLValue(VariantName)"></xsl:param>
                    <xsl:param name="vDescription" select="aspdnsf:GetMLValue(VariantDescription)"></xsl:param>
                    <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(/root/Products/Product/SalesPromptName)"></xsl:param>
    
    		<xsl:param name="vExtensionData" select="aspdnsf:GetMLValue(vXData)"></xsl:param>
    
                    <xsl:param name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xsl:param>
                    <xsl:param name="AltText">
                        <xsl:choose>
                            <xsl:when test="$pSEAltText='' and $vName!=''"><xsl:value-of select="$vName" /></xsl:when>
                            <xsl:otherwise><xsl:value-of select="$pSEAltText" /></xsl:otherwise>
                        </xsl:choose>
                    </xsl:param>
    Code:
    <tr><td><font class="SmallGridText"><xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.21', $LocaleSetting)" disable-output-escaping="yes" /><xsl:value-of select="concat($pSKU, skusuffix)" /></font></td></tr>
                            <xsl:if test="$vDescription!=''"><tr><td><xsl:value-of select="$vDescription" disable-output-escaping="yes" /></td></tr></xsl:if>
                            <xsl:if test="Weight!=''"><tr><td><font class="SmallGridText"><xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.24', $LocaleSetting)" disable-output-escaping="yes" /><xsl:value-of select="aspdnsf:FormatDecimal(Weight, 2)" /></font></td></tr></xsl:if>
                            <xsl:if test="Dimensions!=''"><tr><td><font class="SmallGridText"><xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.23', $LocaleSetting)" disable-output-escaping="yes" /><xsl:value-of select="Dimensions" /></font></td></tr></xsl:if>                        
    			<tr><td><font class="SmallGridText">Loc<xsl:value-of select="$vExtensionData" disable-output-escaping="yes" /></font></td></tr>
    I still don't get the "UPSTAIRS" returned on the product page. Anybody? is my syntax wrong?
    Last edited by btappan2; 10-02-2012 at 10:15 AM. Reason: highlight

  11. #11
    GoVedia is offline Member
    Join Date
    Oct 2012
    Location
    Orange, CA
    Posts
    98

    Default Casing

    Check your casing on vxdata. It is inconsistent.

    Change:
    Code:
    <xsl:param name="vExtensionData" select="aspdnsf:GetMLValue(vXData)"></xsl:param>
    To:
    Code:
    <xsl:param name="vExtensionData" select="aspdnsf:GetMLValue(vXdata)"></xsl:param>
    Robert
    Last edited by GoVedia; 10-02-2012 at 07:49 PM.

  12. #12
    btappan2 is offline Member
    Join Date
    Apr 2012
    Posts
    43

    Default

    Dang, so simple! Thanks so much for pointing that out, guess I needed another set of eyes.