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

Thread: Display Store Location for Product(s)

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

    Default Display Store Location for Product(s)

    Is there a place in the Product table - or any table that matter - that I can display the store locations where a product may be at for customers to view?

    Thank you in advance,

    ~D

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

    Default

    There's no field specifically for that 'out of the box', but each product record in the DB has extra 'ExtensionData' fields that we put in there exactly for this kind of need. You'd have to do a little XML package customization to have that info displayed on the front-end, but that's a pretty small mod. Then just store the information in that extra field.

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

    Default

    Quote Originally Posted by AspDotNetStorefront Staff - Scott View Post
    There's no field specifically for that 'out of the box', but each product record in the DB has extra 'ExtensionData' fields that we put in there exactly for this kind of need. You'd have to do a little XML package customization to have that info displayed on the front-end, but that's a pretty small mod. Then just store the information in that extra field.
    Thanks, Scott. . . So, say if we have obviously more than one location, I could enter each location, seperated by a comma and then display that in the XML package. I could then pass the SKU (or grab the SKU) and display each location that particular product is located?

  4. #4
    dayhawk is offline Member
    Join Date
    May 2009
    Posts
    76

    Default

    Donato,

    It sounds like it might be beneficial to store each location as an XML node in the Extension Data field. For example:

    Code:
    <locations>
    	<loc1>Paris</loc1>
    	<loc2>Rome</loc2>
    	<loc3>Westlake</loc3>
    </locations>
    That allows one to potentially treat each location as a separate variable.

    In the XML package, add the following query:

    Code:
          <query name="ExtensionData" rowElementName="Product" retType="xml">
            <sql>
                <![CDATA[
                    SELECT Product.ProductID,
                    CONVERT(xml, ExtensionData) MyExtensionData
                    FROM Product
                    WHERE Product.ProductID = @ProductID
                    FOR xml path('Product')
                ]]>
            </sql>
            <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="" />
        </query>
    In the product template <xsl:template match="Product"> parameters, one could use:

    Code:
    <xsl:param name="Loc1"><xsl:value-of select="/root/ExtensionData/Product/MyExtensionData/locations/loc1" disable-output-escaping="yes" /></xsl:param>
    <xsl:param name="Loc2"><xsl:value-of select="/root/ExtensionData/Product/MyExtensionData/locations/loc2" disable-output-escaping="yes" /></xsl:param>
    <xsl:param name="Loc3"><xsl:value-of select="/root/ExtensionData/Product/MyExtensionData/locations/loc3" disable-output-escaping="yes" /></xsl:param>
    After that, the variables can be referenced easily.

    Hope this helps.

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

    Default

    Quote Originally Posted by dayhawk View Post
    Donato,

    It sounds like it might be beneficial to store each location as an XML node in the Extension Data field. For example:

    Code:
    <locations>
    	<loc1>Paris</loc1>
    	<loc2>Rome</loc2>
    	<loc3>Westlake</loc3>
    </locations>
    That allows one to potentially treat each location as a separate variable.

    In the XML package, add the following query:

    Code:
          <query name="ExtensionData" rowElementName="Product" retType="xml">
            <sql>
                <![CDATA[
                    SELECT Product.ProductID,
                    CONVERT(xml, ExtensionData) MyExtensionData
                    FROM Product
                    WHERE Product.ProductID = @ProductID
                    FOR xml path('Product')
                ]]>
            </sql>
            <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="" />
        </query>
    In the product template <xsl:template match="Product"> parameters, one could use:

    Code:
    <xsl:param name="Loc1"><xsl:value-of select="/root/ExtensionData/Product/MyExtensionData/locations/loc1" disable-output-escaping="yes" /></xsl:param>
    <xsl:param name="Loc2"><xsl:value-of select="/root/ExtensionData/Product/MyExtensionData/locations/loc2" disable-output-escaping="yes" /></xsl:param>
    <xsl:param name="Loc3"><xsl:value-of select="/root/ExtensionData/Product/MyExtensionData/locations/loc3" disable-output-escaping="yes" /></xsl:param>
    After that, the variables can be referenced easily.

    Hope this helps.
    Thanks man! So, if I store our StoreID's in one of the fields, like ExtensionData or somehting, and seperate them by a comma, how would I go about matching those StoreIDs to a node? I thought about a case statement, but I am not sure if that will work in XML or if that is even the way to go. Sorry, but I am fairly new to XML.

    Thanks again!

    ~D