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

Thread: Image using SKU or ProducID?

  1. #1
    gmaniac is offline Member
    Join Date
    Jul 2010
    Location
    Missouri
    Posts
    59

    Default Image using SKU or ProducID?

    I have it to where when we do large product uploads through XML or Excel then it uses the SKU to find the image name. Here is the trouble if we manually upload a product individually along with manually upload an image then it uses the productid. How do I go about finding out when it is going to chose between those two?

    For instance I was using something like this:
    Code:
    		<xsl:param name="site">http://www.archerycenter.com/images/product/icon/</xsl:param>
    		<xsl:param name="jpg">.jpg</xsl:param>
    		<xsl:param name="image">
    			<xsl:choose>
    				<xsl:when test="sku!=''">
    					<xsl:value-of select="$site" /><xsl:value-of select="/root/FPProducts/FrontPageProducts/sku" /><xsl:value-of select="$jpg" />
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="$site" /><xsl:value-of select="/root/FPProducts/FrontPageProducts/productid" /><xsl:value-of select="$jpg" />
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:param>
    Now this doesn't take into account if there is a SKU, but still using the ProductID because it was manually entered and we uploaded the image.

    I would figure there was a place in the database that quickly distinguishes this, but I couldn't find it. For instance 1 for if it is using SKU or 0 if it is using ProductID.

  2. #2
    chrismartz is offline Senior Member
    Join Date
    Apr 2010
    Posts
    339

    Default

    Have you tried using the LookupProductImage function? Here is how the manual describes it:

    "Description: Returns an <img> tag specifically for a product. The ImageFileNameOverride or SKU parameter will allow this method to perform much faster than the standard LookupImage function if you use ImageFileNameOverride or UseSKUForProductImageName on your product's images. Either parameter can be an empty string if not used."

    The same thing is available with VariantImages if you use them "LookupVariantImage".

    Code:
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFileNameOverride, SKU, DesiredSize, IncliudeATag)" disable-output-escaping="yes"/>
    http://manual.aspdotnetstorefront.co...-packages.aspx