Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Danzig 32 posts 52 karma points
    May 09, 2011 @ 02:29
    Danzig
    0

    Image not displaying for products

    Hi

    I'm working on my first uCommerce project.  I've created some products, all of the same type, each of which has a few variants - so far so good.  

    I've specified a thumbnail and primary image for each product but I can't get either to display.  The html output for the thumbnail image is <img src="" alt="Image"> so it looks like no image is being found for any of the products.

    Here's the child products xslt for the category listings page where I am displaying the products.  (The images also don't display on the individual product pages.)

    ======================================

    <!-- Display child products -->

      <xsl:template match="childProducts">

        <xsl:for-each select="product">

    <xsl:variable name="productSku" select="@sku"></xsl:variable>

    <xsl:variable name="product" select="CommerceLibrary:GetProduct($catalogName, $productSku)"></xsl:variable>

          <div style="clear: both">

            <h4>

              <a>

                <xsl:attribute name="href">

                  product.aspx?catalog=<xsl:value-of select="$catalogName"/>&amp;product=<xsl:value-of select="@sku"/>

                </xsl:attribute>

                <xsl:value-of select="@displayName"/>

              </a>

            </h4>

            <div style="float: left; width: 100px;">

              <img alt="Image">

                <xsl:attribute name="src">

                  <xsl:value-of select="umbraco.library:GetMedia(@thumbnailImage, true())/data[@alias = 'umbracoFile']"/>

                </xsl:attribute>

              </img>          

            </div>

     

     

    <xsl:choose>

              <xsl:when test="$product/product/@allowOrdering">

                <form method="post">

                  <input type="hidden" name="sku">

                    <xsl:attribute name="value">

                      <xsl:value-of select="$product/product/@sku"/>

                    </xsl:attribute>

                  </input>

                  Quantity: <input type="text" name="quantityInput" value="1" style="width:30px"></input>&nbsp;

                  <xsl:if test="$product/product/@hasVariants = 'True'">

                    <select name="variantSku">

                      <option>Please select</option>

                      <xsl:for-each select="$product/product/variants/product">

                        <option>

                          <xsl:attribute name="value">

                            <xsl:value-of select="@variantSku"/>

                          </xsl:attribute>

                          <xsl:value-of select="@displayName"/>

                        </option>

                      </xsl:for-each>

                    </select>&nbsp;

                  </xsl:if>

                  <input type="submit" value="Add To Bag"></input>

                </form>

              </xsl:when>

              <xsl:otherwise>

                <p style="color: red;">

                  <xsl:value-of select="$product/product/@displayName"/> is temporarily unavailable.

                </p>

              </xsl:otherwise>

            </xsl:choose>

      <div style="margin-left: 150px">

              <xsl:value-of select="@shortDescription" disable-output-escaping="yes" />

              <xsl:choose>

                <xsl:when test="@allowOrdering">

                  <!-- Order now! -->

                </xsl:when>

                <xsl:otherwise>

                  Not available right now.

                </xsl:otherwise>

              </xsl:choose>

            </div>

          </div>

        </xsl:for-each>

        <div style="clear: both"></div>

      </xsl:template>

    ======================================

    Can anyone tell me how to get the images to display?  

    Many thanks in advance!

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 09, 2011 @ 10:53
    Søren Spelling Lund
    0

    Are the imageids outputted with the XML? Which version of uCommerce are you running?

  • Danzig 32 posts 52 karma points
    May 09, 2011 @ 11:04
    Danzig
    0

    Hi Soren

    The uCommerce version is 1.3.0.3. 

    RE the image id's, are you asking if the image tags have id's when the page is rendered?  If so, no.  The rendered image tags are just <img src="" alt="Image">

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 09, 2011 @ 12:58
    Søren Spelling Lund
    0

    Could you try and output the product XML to a textarea and see if imageid is set in the XML structure?

    <textarea><xsl:copy-of select="$product"/></textarea>
  • Danzig 32 posts 52 karma points
    May 10, 2011 @ 00:13
    Danzig
    0

    Here's the textarea contents for one of the products:

    <product index="0" sku="Mawhero" displayName="Mawhero" shortDescription="" longDescription="" thumbnailImage="1101" primaryImage="1101" allowOrdering="True" isVariant="False" displayOnSite="True" hasVariants="True" price="139.0000" currency="NZD"><variants><product index="0" sku="Mawhero" displayName="Size 00  (2-9 months)" shortDescription="" longDescription="" thumbnailImage="0" primaryImage="0" allowOrdering="False" isVariant="True" displayOnSite="False" hasVariants="False" variantSku="Mawhero00" price="139.0000" currency="NZD" Size="Size 00 (2-9 months)" /><product index="1" sku="Mawhero" displayName="Size 0 (9-18 months)" shortDescription="" longDescription="" thumbnailImage="0" primaryImage="0" allowOrdering="False" isVariant="True" displayOnSite="False" hasVariants="False" variantSku="Mawhero0" price="149.0000" currency="NZD" Size="Size 0  (9-18 months)" /></variants></product>

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 10, 2011 @ 09:17
    Søren Spelling Lund
    0

    Are you running Umbraco 4.0 or 4.5 (and up). I suspect it's probably the difference in schema tripping you up.

    I would advise upgrade to 1.5.1 and store version 1.1.0.0. They support the new Umbraco schema in 4.5.

  • Danzig 32 posts 52 karma points
    May 10, 2011 @ 11:08
    Danzig
    0

    Thanks Soren, I'll try the upgrades.  Umbraco version is v 4.6.1.

Please Sign in or register to post replies

Write your reply to:

Draft