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

Thread: Completely Stumped... Summary with Related Products

  1. #1
    heykate is offline Member
    Join Date
    Oct 2008
    Location
    North Carolina
    Posts
    61

    Default Completely Stumped... Summary with Related Products

    Sometimes we look at the same code sometimes and we tend to go crazy. I am stuck and was wondering if anyone could point me in the right direction...Iv used multiple examples from this forum to try and get the Related Products to work the way I want them to. Basically what I want to happen is that I can put some text in the "summary" area in the backend, and that would that text would show up along side the product image of a Related Product that is listed on a product page.

    Any insight would be appreciated,

    Kate

  2. #2
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    It should be a simple modification to your relatedproducts.xml.config xmlpackage.


    The piece of code that outputs the image looks like this :-
    C#/VB.NET Code:
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFileNameOverride, SKU, 'icon', 0)" disable-output-escaping="yes"/> 
    & you need to add something like this to get the product summary :-
    C#/VB.NET Code:
    <xsl:value-of select="aspdnsf:GetMLValue(Summary)" disable-output-escaping="yes" /> 


    TTFN

    BFG

  3. #3
    heykate is offline Member
    Join Date
    Oct 2008
    Location
    North Carolina
    Posts
    61

    Exclamation

    I did try adding that, and variations. I also tried adding the <xslaram name thinking it needed a call there as well, but still no luck...

    Kate

  4. #4
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Can you post the xmlpackage - & a URL?



    TTFN

    BFG

  5. #5
    heykate is offline Member
    Join Date
    Oct 2008
    Location
    North Carolina
    Posts
    61

    Default

    Hey BFG

    Thanks for helping me - I needed a break from looking at this before I was down a computer... Oh and I am on version 9.3.1.

    You can view what I am trying to do at this link:

    https://aspdotnetstorefront.backtohe...d-strains.aspx

    And Below is the XML for Related Products (/XmlPackages/relatedproducts.xml.config)

    <?xml version="1.0" standalone="yes" ?>
    <!-- ################################################## ################################ -->
    <!-- Copyright AspDotNetStorefront.com. All Rights Reserved. -->
    <!-- http://www.aspdotnetstorefront.com -->
    <!-- For details on this license please visit the product homepage at the URL above. -->
    <!-- THE ABOVE NOTICE MUST REMAIN INTACT. -->
    <!-- ################################################## ################################ -->
    <package version="2.1" displayname="Related Products" debug="false" includeentityhelper="false">
    <query name="RelatedItems" rowElementName="Item">
    <sql>
    <![CDATA[
    EXEC aspdnsf_GetCustomersRelatedProducts
    @CustomerGUID,
    @ProductID,
    @CustomerLevelID,
    @InvFilter,
    @affiliateID,
    @storeID,
    @FilterProduct
    ]]>
    </sql>
    <queryparam paramname="@ProductID" paramtype="runtime" requestparamname="productid" sqlDataType="int" defvalue="0" validationpattern="" />
    <queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
    <queryparam paramname="@InvFilter" paramtype="appconfig" requestparamname="HideProductsWithLessThanThisInve ntoryLevel" sqlDataType="int" defvalue="0" validationpattern="" />
    <queryparam paramname="@CustomerGUID" paramtype="runtime" requestparamname="customerGuid" sqlDataType="nvarchar" defvalue="" validationpattern="" />
    <queryparam paramname="@affiliateID" paramtype="system" requestparamname="AffiliateID" sqlDataType="int" defvalue="0" validationpattern="" />
    <queryparam paramname="@StoreID" paramtype="runtime" requestparamname="StoreID" sqlDataType="int" defvalue="1" validationpattern="" />
    <queryparam paramname="@FilterProduct" paramtype="runtime" requestparamname="FilterProduct" sqlDataType="bit" defvalue="0" validationpattern="" />
    </query>


    <PackageTransform>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
    <xsl:output method="html" omit-xml-declaration="yes" />

    <xsl:param name="RelatedProductsGridColWidth" select="aspdnsf:AppConfig('RelatedProductsGridColW idth')"></xsl:param>

    <xsl:variable name="ProductIdsOnPage">
    <xsl:for-each select="/root/RelatedItems/Item/ProductID">
    <xsl:value-of select="." />
    <xsl:if test="position() != last()">
    <xsl:text>,</xsl:text>
    </xsl:if>
    </xsl:for-each>
    </xsl:variable>
    <xsl:variable name="AvailablePromotions" select="aspdnsf:XmlPackageAsXml('availablePromotio ns.xml.config', concat('productIdList=', $ProductIdsOnPage))/root/Promotions" />

    <xsl:template match="/">
    <xsl:variable name="encloseInTab" select="aspdnsf:EvalBool(/root/Runtime/EncloseInTab)" />
    <xsl:choose>
    <xsl:when test="count(/root/RelatedItems/Item) &gt; 0">
    <table width="100%" cellpadding="2" cellspacing="0" border="0" style="border-style: solid; border-width: 0px; border-color: #{aspdnsf:AppConfig('HeaderBGColor')};" >
    <tr>
    <td align="left" valign="top">
    <table width="100%" cellpadding="4" cellspacing="0" border="0" >
    <tr>
    <td align="left" valign="top" >
    <xsl:choose>
    <xsl:when test="aspdnsf:StrToLower(aspdnsf:AppConfig('Relate dProductsFormat')) = 'grid'">
    <xsl:apply-templates select="/root/RelatedItems/Item" />
    </xsl:when>
    <xsl:otherwise>
    <table width="100%">
    <xsl:for-each select="/root/RelatedItems/Item">
    <xsl:variable name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:variable>
    <xsl:variable name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xsl:variable>

    <xsl:variable name="AltText">
    <xsl:choose>
    <xsl:when test="$pSEAltText=''"><xsl:value-of select="$pName" /></xsl:when>
    <xsl:otherwise><xsl:value-of select="$pSEAltText" /></xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <tr>
    <td width="100%">
    <table width="100%">
    <tr>
    <td valign="center">
    <a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}">
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'icon', 0, $AltText)" disable-output-escaping="yes"/>
    </a>
    </td>
    <td width="100%">
    <table width="100%">
    <tr>
    <td>
    <a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}">
    <xsl:value-of select="$pName" disable-output-escaping="yes" />
    </a>
    </td>
    </tr>
    <tr>
    <td>
    <xsl:variable name="productId" select="ProductID" />
    <span class="a2">
    <xsl:value-of select="aspdnsf:GetMLValue(Description)" disable-output-escaping="yes" />
    </span>
    <xsl:if test="string-length($AvailablePromotions) &gt; 0">
    <xsl:apply-templates select="$AvailablePromotions/Promotion[ProductId=$productId]" />
    </xsl:if>
    </td>
    </tr>
    <tr>
    <td>
    <div class="a1" style="PADDING-BOTTOM: 10px; PADDING-TOP: 10px;">
    <a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}">
    <xsl:value-of select="aspdnsf:StringResource('common.cs.33')" disable-output-escaping="yes" />
    </a>
    </div>
    <xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProd ucts') = 'true'">
    <xsl:value-of select="aspdnsf:DisplayProductStockHint(ProductID, 'Product')" disable-output-escaping="yes" />
    </xsl:if>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    <xsl:if test="position() != last()">
    <hr size="1" class="LightCellText"/>
    </xsl:if>
    </td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:otherwise>
    </xsl:choose>

    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </xsl:when>
    <xsl:otherwise>
    <xsl:if test="$encloseInTab != true()">
    <div style="height : 200px; padding-top: 20px; padding-left: 20px">
    <!--No Related Products(this should be in string resources)-->
    <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.4 1')" disable-output-escaping="yes" />
    </div>
    </xsl:if>
    </xsl:otherwise>

    </xsl:choose>

    </xsl:template>

    <xsl:template match="Item">
    <xsl:variable name="delta">
    <xsl:choose>
    <xsl:when test="(count(/root/RelatedItems/Item) mod number($RelatedProductsGridColWidth)) = 0">0</xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="number($RelatedProductsGridColWidth)-(count(/root/RelatedItems/Item) mod number($RelatedProductsGridColWidth))"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="rows" select="ceiling(count(/root/RelatedItems/Item) div number($RelatedProductsGridColWidth))" />

    <xsl:if test="$RelatedProductsGridColWidth = 1">
    <tr>
    <xsl:call-template name="ProductCell"></xsl:call-template>
    <xsl:if test="ceiling(position() div number($RelatedProductsGridColWidth)) = $rows and $delta &gt; 0">
    <xsl:call-template name="FillerCells">
    <xsl:with-param name="cellCount" select="$delta" />
    </xsl:call-template>
    </xsl:if>
    </tr>
    </xsl:if>

    <xsl:if test="position() mod $RelatedProductsGridColWidth = 1">
    <xsl:if test="string-length($AvailablePromotions) &gt; 0">
    <tr>
    <xsl:for-each select=". | following-sibling::*[position() &lt; $RelatedProductsGridColWidth]">
    <td>
    <xsl:variable name="productId" select="ProductID" />
    <xsl:apply-templates select="$AvailablePromotions/Promotion[ProductId=$productId]" />
    </td>
    </xsl:for-each>
    <xsl:if test="ceiling(position() div number($RelatedProductsGridColWidth)) = $rows and $delta &gt; 0">
    <xsl:call-template name="FillerCells">
    <xsl:with-param name="cellCount" select="$delta" />
    </xsl:call-template>
    </xsl:if>
    </tr>
    </xsl:if>
    </xsl:if>

    <xsl:if test="position() mod $RelatedProductsGridColWidth = 1">
    <tr>
    <xsl:for-each select=". | following-sibling::*[position() &lt; $RelatedProductsGridColWidth]">
    <xsl:call-template name="ProductCell"></xsl:call-template>
    </xsl:for-each>
    <xsl:if test="ceiling(position() div number($RelatedProductsGridColWidth)) = $rows and $delta &gt; 0">
    <xsl:call-template name="FillerCells">
    <xsl:with-param name="cellCount" select="$delta" />
    </xsl:call-template>
    </xsl:if>
    </tr>
    </xsl:if>
    </xsl:template>

    <xsl:template name="ProductCell">
    <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
    <xsl:param name="AltText">

    <xsl:choose>
    <xsl:when test="aspdnsf:GetMLValue(SEAltText)=''">
    <xsl:value-of select="aspdnsf:GetMLValue(Name)" />
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="aspdnsf:GetMLValue(SEAltText)" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:param>

    <td align="left" valign="top">
    <div class="productTITLE">
    <a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}">
    <xsl:value-of select="$pName" disable-output-escaping="yes"/>
    </a>
    </div>
    <div class="productWrap">
    <div class="colL">
    <a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}">
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'icon', 0, $AltText)" disable-output-escaping="yes"/>
    </a>
    </div>
    <div class="colR"><div class="productSum"><xsl:value-of select="aspdnsf:GetMLValue(Summary)" disable-output-escaping="yes" /> </div> <a href="{aspdnsf:ProductLink(ProductID, SEName, 0, '')}" class="moreprodINFO">More Info</a></div>
    </div>
    <br/>

    <xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProd ucts') = 'true'">
    <xsl:value-of select="aspdnsf:DisplayProductStockHint(ProductID, 'Product')" disable-output-escaping="yes" />
    </xsl:if>
    </td>
    </xsl:template>


    <xsl:template name="FillerCells">
    <xsl:param name="cellCount"/>
    <xsl:param name="CellWidth" select="100 div $RelatedProductsGridColWidth" />
    <td width="{$CellWidth}%">&#160;</td>
    <xsl:if test="$cellCount > 1">
    <xsl:call-template name="FillerCells">
    <xsl:with-param name="cellCount" select="$cellCount - 1"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>

    <xsl:template match="Promotion">
    <div class="promotionCallToAction">
    <xsl:value-of select="CallToAction" disable-output-escaping="yes" />
    </div>
    </xsl:template>

    </xsl:stylesheet>
    </PackageTransform>
    </package>

  6. #6
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    I'm not seeing any related products appear?

  7. #7
    heykate is offline Member
    Join Date
    Oct 2008
    Location
    North Carolina
    Posts
    61

    Default

    They are on the left hand side of the page, where it says "Products Related To This Article". Sorry about that, I was moving things around and accidently removed those products from that specific store..Your should see them now

    Kate

  8. #8
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    & those 2 related products definitely have something in the Summary field?

  9. #9
    heykate is offline Member
    Join Date
    Oct 2008
    Location
    North Carolina
    Posts
    61

    Default

    Yes sir! If you go to their product page (which is a cluster mess right now) that text above the options is pulled from the summary tab (which should be pulled in the right hand side for the summary on related fields...