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

Thread: Get Manufacturers Image and Name on Product Pg V9

  1. #1
    MSD is offline Member
    Join Date
    Sep 2009
    Location
    EST
    Posts
    57

    Default Get Manufacturers Image and Name on Product Pg V9

    Hey Guys,

    Trying to get the manufacturers name on the product page. Tried dozens of combination but nothing seems to work.

    Secondly... For the image, the below code resulted in "nopictureicon.gif" but not the logo image in the folder. The issue is it reads the image when it is set as 1.jpg but not when Filename Override is used pulling nike_logo.jpg. This is for the Product page .....Any ideas???

    <xsl:value-of select="aspdnsf:LookupImage('manufacturer',/root/Manufacturers/Manufacturer/ManufacturerID,'','', 'icon', '0')" disable-output-escaping="yes" />



    Thanks...

    MSD
    Started V8 switched half way to V9 /// I need a V9 Forum

    AspDotNetStorefrontML 9.0.1.3/9.0.1.3 AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  2. #2
    MSD is offline Member
    Join Date
    Sep 2009
    Location
    EST
    Posts
    57

    Default Image Name Solved

    Answering my own questions... here is the manufacturers name on the product page. Still not sure why the image wont take the file override part.

    <xsl:value-of select="/root/EntityHelpers/Manufacturer/Entity/Name" disable-output-escaping="yes" />

    MSD...
    Started V8 switched half way to V9 /// I need a V9 Forum

    AspDotNetStorefrontML 9.0.1.3/9.0.1.3 AspDotNetStorefront ML 8.0.1.2/8.0.1.2

  3. #3
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    Hi MSD,
    Where did you place this code for the manufacturer name to show up on the products page?
    Any help would be great.
    Thanks!

  4. #4
    sha87 is offline Member
    Join Date
    Oct 2010
    Posts
    31

    Default

    You will want to put that code into whatever XML package you are using for your product page. For example, product.SimpleProduct.xml. I usually look for the description and put it after that, but you can have it displayed anywhere in the file.

  5. #5
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    @ sha87 - thanks for the reply.
    I have tried placing the code everywhere in my product xml, I am using (product.tabbedUI.xml.config). Any idea what line I should place it in?
    And also do I have to make any changes to this or just paste as is?

    <xsl:value-of select="/root/EntityHelpers/Manufacturer/Entity/Name" disable-output-escaping="yes" />

    Thanks again!

  6. #6
    sha87 is offline Member
    Join Date
    Oct 2010
    Posts
    31

    Default

    Sure thing. I haven't worked with the Tabbed UI before, but it looks like it uses a table to display the information. I put this code below the weight section, which was line ~550 for me. I pasted this in after the closing </tr> for the weight section.

    This will cause "Manufacturer: [Manufacturer Name]" to display under the weight. You can move it around of course.

    Code:
    <tr>
        <td align="left">Manufacturer: 
        <xsl:value-of select="/root/EntityHelpers/Manufacturer/Entity/Name" disable-output-escaping="yes" />
        </td>
    </tr>

  7. #7
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    @ sha87 - that worked great, thanks again for your help!

  8. #8
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    I have a little issue that I need anyones help with...the code worked great in putting the manufacturer on the product page but the problem is that its only pulling the first manufacturer from my list of several hundred. It's not matching the product to the actual manufacturer.
    Can anyone help with this? Here is the code.
    Thanks.

    <tr>
    <td align="left">Manufacturer:
    <xsl:value-of select="/root/EntityHelpers/Manufacturer/Entity/Name" disable-output-escaping="yes" />
    </td>
    </tr>

  9. #9
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Sadly that code does not work on Product pages. On the bright side there is always a way.

    First we are going to add a query to the product XML. This snippet of code is to go before <PackageTransform> and after </query>.

    So once you have a nice space you want to paste in:
    Code:
    <!-- MANUFACTURER INFO -->
      <query name="Manufacturers" rowElementName="Manufacturer">
        <sql>
          <![CDATA[ 
                SELECT TOP 1 m.ManufacturerID, m.Name AS ManufacturerName,  m.SEName AS ManufacturerSEName 
                FROM dbo.Product p INNER JOIN 
                  dbo.ProductManufacturer pn ON @ProductID = pn.ProductID INNER JOIN 
                  dbo.Manufacturer m ON pn.ManufacturerID = m.ManufacturerID 
            ]]>
        </sql>
        <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="" />
      </query>
      <!-- END MANUFACTURER INFO -->
    A quick talk through this code, first it is a basic select call from the database, however we have defined we only want the first result returned back, this is just in case! We are calling the Manufacturer ID, the Manufacturer SEName (for building links) and the Manufacturer Name!

    We get this information by looking at what product is on the page and tracking back.

    Once this is done you have access to the building blocks for Manufacturer Images and Links.

    We use this to generate a link.

    First how to get just the Manufacturer Name to display on the page
    Code:
    <xsl:value-of select="/root/Manufacturers/Manufacturer/ManufacturerName" disable-output-escaping="yes" />
    That will display the Manufacturer's Name!

    For creating a link...
    Code:
    <a href="{aspdnsf:EntityLink(/root/Manufacturers/Manufacturer/ManufacturerID, /root/Manufacturers/Manufacturer/ManufacturerSEName, 'Manufacturer', 0)}" title="View All {/root/Manufacturers/Manufacturer/ManufacturerName} Products">
                <xsl:value-of select="/root/Manufacturers/Manufacturer/ManufacturerName" disable-output-escaping="yes" /> 
              </a>
    This code creates a link with the Manufacturer Name as what is displayed, also hovering over the link brings up "View All {ManufacturerName} Products".

    That is how you create a link.

    Now for getting an image
    Code:
    <xsl:value-of select="aspdnsf:LookupImage('Manufacturer',/root/Manufacturers/Manufacturer/ManufacturerID,'','', 'icon', '0')" disable-output-escaping="yes" />
    Perfect!

    Now you can do anything you need with a Manufacturer on any Product Page!
    If you need more information you can expand the query very easily. To access anything inside the query just use /root/Manufacturers/Manufacturer/FIELDNAME.

    Need any more help or advice just sent a message.

    EDIT:
    All of this code works on both Version 9 and Version 8.
    Last edited by DotNetDevelopments; 05-18-2011 at 03:49 AM. Reason: Extra Info
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  10. #10
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    Thank you for taking the time to write a detailed instruction but unfortunately I am getting the same result where it is pulling just the name of my first manufacturer which is set up in alphabetical order...I don't know if I was clear but I need it to match the item with the actual manufacturer, not the first name on my list.
    Here is my code based on your instructions which is applied to "product.tabbedUI.xml" file. Also a link to one of my product pages where I am trying to display the manufacturer.

    http://www.promax.com/aspdotnetstore...box-lh-5m.aspx

    <?xml version="1.0" encoding="utf-8" ?>
    <package version="2.1" displayname="Tabbed UI" debug="false" includeentityhelper="true">

    <!-- ################################################## ################################################## ## -->
    <!-- Copyright AspDotNetStorefront.com, 1995-2010. 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. -->
    <!-- -->
    <!-- ################################################## ################################################## ## -->


    <query name="Products" rowElementName="Product">
    <sql>
    <![CDATA[
    exec dbo.aspdnsf_ProductInfo @ProductID, @CustomerLevelID, 0, 0, @affiliateID
    ]]>
    </sql>
    <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
    <queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
    <queryparam paramname="@affiliateID" paramtype="system" requestparamname="AffiliateID" sqlDataType="int" defvalue="0" validationpattern="" />
    </query>

    <!-- MANUFACTURER INFO -->
    <query name="Manufacturers" rowElementName="Manufacturer">
    <sql>
    <![CDATA[
    SELECT TOP 1 m.ManufacturerID, m.Name AS ManufacturerName, m.SEName AS ManufacturerSEName
    FROM dbo.Product p INNER JOIN
    dbo.ProductManufacturer pn ON @ProductID = pn.ProductID INNER JOIN
    dbo.Manufacturer m ON pn.ManufacturerID = m.ManufacturerID
    ]]>
    </sql>
    <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="" />
    </query>
    <!-- END MANUFACTURER INFO -->[/COLOR]

    <PackageTransform>

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

    <xslaram name="LocaleSetting" select="/root/Runtime/LocaleSetting" />
    <xslaram name="WebConfigLocaleSetting" select="/root/Runtime/WebConfigLocaleSetting" />
    <xslaram name="XmlPackageName" select="/root/System/XmlPackageName" />


    <xslaram name="SecID">
    <xsl:choose>
    <xsl:when test="count(/root/QueryString/sectionid) &gt; 0">
    <xsl:value-of select="/root/QueryString/sectionid" />
    </xsl:when>
    <xsltherwise>0</xsltherwise>
    </xsl:choose>
    </xslaram>


    <xslaram name="CatID">
    <xsl:choose>
    <xsl:when test="count(/root/QueryString/categoryid) &gt; 0">
    <xsl:value-of select="/root/QueryString/categoryid" />
    </xsl:when>
    <xsltherwise>0</xsltherwise>
    </xsl:choose>
    </xslaram>

    <xslaram name="ManID">
    <xsl:choose>
    <xsl:when test="count(/root/QueryString/manufacturerid) &gt; 1">
    <xsl:value-of select="/root/QueryString/manufacturerid" />
    </xsl:when>
    <xsltherwise>1</xsltherwise>
    </xsl:choose>
    </xslaram>

    <xslaram name="isMultiVariant" select="count(root/Products/Product) &gt; 1" />

    <xsl:template match="/">
    <xsl:comment>Copyright 1995-2008 AspDotNetStorefront.com</xsl:comment>
    <xsl:for-each select="/root/Products/Product[1]">
    <xsl:call-template name="tabbedtemplate"/>
    </xsl:for-each>
    </xsl:template>


    <xsl:template name="tabbedtemplate">
    <xslaram name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xslaram>
    <xslaram name="AltText">
    <xsl:choose>
    <xsl:when test="$pSEAltText=''">
    <xsl:value-of select="aspdnsf:GetMLValue(Name)" />
    </xsl:when>
    <xsltherwise>
    <xsl:value-of select="$pSEAltText" />
    </xsltherwise>
    </xsl:choose>
    </xslaram>

    <xsl:choose>
    <xsl:when test="IsAKit=1">
    <div>
    <b>
    <font color="red">
    Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
    </font>
    </b>
    </div>
    </xsl:when>
    <xsl:when test="IsAPack=1">
    <div>
    <b>
    <font color="red">
    Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
    </font>
    </b>
    </div>
    </xsl:when>
    <xsltherwise>

    <div align="right" style="width: 100%; float: right; margin-bottom: -20px; position: relative;">
    <nobr>
    <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
    </nobr>
    </div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <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">
    <script type="text/javascript" src="jscripts/tabbedui.js"></script>
    <div>
    <div id="pagetabs">
    <a rel="overview">
    <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab1 ')" disable-output-escaping="yes" />
    </a>
    <a rel="images">
    <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab2 ')" disable-output-escaping="yes" />
    </a>
    <xsl:if test="aspdnsf:IsMLExpress() = 'false' and aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1, 0) !=''">
    <a rel="reviews">
    <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab3 ')" disable-output-escaping="yes" />
    </a>
    </xsl:if>
    <a rel="relatedproducts">
    <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab4 ')" disable-output-escaping="yes" />
    </a>
    <xsl:if test="aspdnsf:AppConfig('RecentlyViewedProducts.En abled') = 'true'">
    <a rel="recentlyviewedproducts">
    <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab5 ')" disable-output-escaping="yes" />
    </a>
    </xsl:if>
    </div>
    <div id="tabcontent">
    <div id="overview">
    <table>
    <tr>
    <td>
    <xsl:choose>
    <xsl:when test="$isMultiVariant = true()">
    <xsl:call-template name="OverviewMultiVariant"/>
    </xsl:when>
    <xsltherwise>
    <xsl:call-template name="OverviewSingleVariant"/>
    </xsltherwise>
    </xsl:choose>
    </td>
    </tr>
    </table>
    </div>

    <div id="images">
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
    </div>

    <xsl:if test="aspdnsf:IsMLExpress() = 'false'">
    <div id="reviews">
    <xsl:value-of select="aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1, 0)" disable-output-escaping="yes"/>
    </div>
    </xsl:if>

    <div id="relatedproducts">
    <xsl:value-of select="aspdnsf:RelatedProducts(ProductID, 0)" disable-output-escaping="yes"/>
    </div>


    <div id ="recentlyviewedproducts">
    <xsl:value-of select="aspdnsf:RecentlyViewed(ProductID, 0)" disable-output-escaping="yes"/>
    </div>

    </div>

    <script type="text/javascript" language="Javascript" >
    TabbedUI.prototype.initialize();
    </script>
    </div>
    </td>
    </tr>
    </table>
    </td>
    </tr>

    </table>

    <xsl:if test="$isMultiVariant = true()">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <!-- list variants now -->
    <xsl:for-each select="/root/Products/Product">
    <xsl:call-template name="Variant"/>
    </xsl:for-each>

    </td>
    </tr>
    </table>
    </xsl:if>

    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <tr>
    <td colspan="2">
    <xsl:value-of select="aspdnsf:ShowUpsellProducts(ProductID)" disable-output-escaping="yes"/>
    </td>
    </tr>
    </td>
    </tr>
    </table>

    <div style="width:100%; text-align: right;">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <xsl:value-of select="aspdnsf:ProductSpecs(ProductID, 1, SpecsInline, SpecCall, 400)" disable-output-escaping="yes"/>
    </td>
    </tr>
    </table>
    </div>
    </xsltherwise>
    </xsl:choose>

    </xsl:template>



    <xsl:template name="Variant">

    <xslaram name="pName" select="aspdnsf:GetMLValue(Name)"/>
    <xslaram name="vName" select="aspdnsf:GetMLValue(VariantName)"/>
    <xslaram name="vDescription" select="aspdnsf:GetMLValue(VariantDescription)"/>
    <xslaram name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"/>

    <table style="width:100%">
    <tr>
    <td style="padding-left: 20px">
    <div>
    <b>
    <xsl:value-of select="$vName" disable-output-escaping="yes" />
    </b>
    </div>
    <div>
    <br />
    </div>

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

    <table style="width:100%" border="0">
    <tr>
    <td>
    <table border="0" style="width:100%">
    <tr>
    <td align="left">
    <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.2 1')" disable-output-escaping="yes" />
    </td>
    <td align="left">
    <xsl:value-of select="SKU"/>
    <xsl:value-of select="SkuSuffix"/>
    </td>
    </tr>
    <xsl:choose>
    <xsl:when test="Dimensions!=''">
    <tr>
    <td align="left">
    <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.2 3')" disable-output-escaping="yes" />
    </td>
    <td align="left">
    <xsl:value-of select="Dimensions"/>
    </td>
    </tr>
    </xsl:when>
    </xsl:choose>
    <xsl:choose>
    <xsl:when test="Weight!=''">
    <tr>
    <td align="left">
    <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.2 4')" disable-output-escaping="yes" />
    </td>
    <td align="left">
    <xsl:value-of select="aspdnsf:FormatDecimal(Weight, 2)"/>
    </td>
    </tr>
    <tr>
    <td align="left">
    <xsl:value-of select="/root/Manufacturers/Manufacturer/ManufacturerName" disable-output-escaping="yes" />
    </td>
    </tr>
    </xsl:when>
    </xsl:choose>
    <xsl:choose>
    <!--
    Showing of inventory table also goes through the rules of DisplayOutOfStock appconfig if enabled..
    -->
    <xsl:when test="aspdnsf:AppConfigBool('ShowInventoryTable')= 'true'">
    <tr>
    <td align="left" colspan="2" width="100%">
    <table border="0" style="width: 110%">
    <tr>
    <td>
    <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </xsl:when>
    <xsltherwise>
    <xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProd ucts') = 'true'">
    <tr>
    <td align="left" colspan="2" width="100%">
    <xsl:value-of select="aspdnsfisplayProductStockHint(ProductID, VariantID, 'Product')" disable-output-escaping="yes" />
    </td>
    </tr>
    </xsl:if>
    </xsltherwise>
    </xsl:choose>

    <tr>
    <td colspan="2">
    <xsl:if test="number(CustomerEntersPrice)=0">
    <span>
    <xsl:attribute name="id">
    VariantPrice_<xsl:value-of select="VariantID"/>
    </xsl:attribute>
    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
    </span>
    </xsl:if>
    </td>
    </tr>
    </table>
    </td>
    <td style="width:70%" valign="bottom">
    <table border="0" style="width:100%; height: 100%">
    <tr>
    <td align="left" valign="bottom">
    <xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 0)" disable-output-escaping="yes"/>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>

    <div>
    <br />
    </div>
    <div>
    <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductI D)" disable-output-escaping="yes"/>
    <br/>
    </div>
    <div>
    <br />
    </div>

    <xsl:choose>
    <xsl:when test="position()!=last()">
    <hr size="1" color="#CCCCCC" />
    </xsl:when>
    </xsl:choose>
    </td>
    </tr>
    </table>
    </xsl:template>

    <xsl:template name="OverviewMultiVariant">
    <xslaram name="pName" select="aspdnsf:GetMLValue(Name)"/>
    <xslaram name="pDescription" select="aspdnsf:GetMLValue(Description)"/>
    <xslaram name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xslaram>
    <xslaram name="AltText">
    <xsl:choose>
    <xsl:when test="$pSEAltText=''">
    <xsl:value-of select="$pName" />
    </xsl:when>
    <xsltherwise>
    <xsl:value-of select="$pSEAltText" />
    </xsltherwise>
    </xsl:choose>
    </xslaram>

    <xsl:choose>
    <xsl:when test="IsAKit=1">
    <div>
    <b>
    <font color="red">
    Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
    </font>
    </b>
    </div>
    </xsl:when>
    <xsl:when test="IsAPack=1">
    <div>
    <b>
    <font color="red">
    Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
    </font>
    </b>
    </div>
    </xsl:when>
    <xsltherwise>
    <table border="0" width="100%" cellpadding="4" cellspacing="0">
    <tr>
    <td align="left" valign="top">
    <xsl:variable name="imageHTML" select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'icon', 1)" />
    <xsl:variable name="expectedID" select="concat('ProductPic', ProductID)" />
    <xsl:variable name="idInstead" select="concat('ProductPic_', ProductID, '_icon')" />
    <xsl:variable name="htmlInstead" select="concat(substring-before($imageHTML, $expectedID), $idInstead, substring-after($imageHTML, $expectedID))" />
    <xsl:variable name="finalImageHtml" select="concat(substring-before($htmlInstead, $expectedID), $idInstead, substring-after($htmlInstead, $expectedID))" />

    <xsl:value-of select="$finalImageHtml" disable-output-escaping="yes" />
    </td>
    <td align="left" valign="top" width="100%">
    <div>
    <table width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="left" valign="middle">
    <span class="ProductNameTextinTab">
    <xsl:value-of select="$pName" disable-output-escaping="yes" />
    </span>
    <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes" />
    <br/>
    <xsl:value-of select="aspdnsf:ProductSpecsLink(ProductID, SpecsInline, SpecTitle, SKU, SpecCall)" disable-output-escaping="yes" />
    </td>
    </tr>
    </table>
    </div>
    <div>
    <br />
    </div>
    <div>
    <xsl:value-of select="$pDescription" disable-output-escaping="yes" />
    </div>
    <div>
    <br />
    </div>
    <xsl:if test="aspdnsf:AppConfigBool('PayPal.Promo.Enabled' )='true'">
    <xsl:if test="Price &lt;= aspdnsf:AppConfig('PayPal.Promo.CartMaximum') and Price &gt;= aspdnsf:AppConfig('PayPal.Promo.CartMinimum')">
    <div style="width:100%; text-align: left;">
    <a target="_blank">
    <xsl:attribute name="href">
    <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.LearnMoreU RL')"/>
    </xsl:attribute>
    <img>
    <xsl:attribute name="src">
    <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.BannerURL' )"/>
    </xsl:attribute>
    </img>
    </a>
    </div>
    </xsl:if>
    </xsl:if>
    </td>
    </tr>
    </table>
    </xsltherwise>
    </xsl:choose>
    </xsl:template>

    <xsl:template name="OverviewSingleVariant">

    <xslaram name="pName" select="aspdnsf:GetMLValue(Name)"/>
    <xslaram name="pDescription" select="aspdnsf:GetMLValue(Description)"/>
    <xslaram name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"/>
    <xsl:choose>
    <xsl:when test="IsAKit=1">
    <div>
    <b>
    <font color="red">
    Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
    </font>
    </b>
    </div>
    </xsl:when>
    <xsl:when test="IsAPack=1">
    <div>
    <b>
    <font color="red">
    Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
    </font>
    </b>
    </div>
    </xsl:when>
    <xsltherwise>
    <table border="0" width="100%" cellpadding="4" cellspacing="0">
    <tr>
    <td align="left" valign="top">
    <xsl:variable name="imageHTML" select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'icon', 1)" />
    <xsl:variable name="expectedID" select="concat('ProductPic', ProductID)" />
    <xsl:variable name="idInstead" select="concat('ProductPic_', ProductID, '_icon')" />
    <xsl:variable name="htmlInstead" select="concat(substring-before($imageHTML, $expectedID), $idInstead, substring-after($imageHTML, $expectedID))" />
    <xsl:variable name="finalImageHtml" select="concat(substring-before($htmlInstead, $expectedID), $idInstead, substring-after($htmlInstead, $expectedID))" />

    <xsl:value-of select="$finalImageHtml" disable-output-escaping="yes" />
    </td>
    <td align="left" valign="top" width="100%">
    <div>
    <table width="100%" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%" align="left" valign="middle">
    <span class="ProductNameTextinTab">
    <xsl:value-of select="$pName" disable-output-escaping="yes" />
    </span>
    <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes" />
    <br/>
    <xsl:value-of select="aspdnsf:ProductSpecsLink(ProductID, SpecsInline, SpecTitle, SKU, SpecCall)" disable-output-escaping="yes" />
    </td>
    </tr>
    </table>
    </div>
    <div>
    <br />
    </div>
    <div>
    <xsl:value-of select="$pDescription" disable-output-escaping="yes"/>
    </div>
    <div>
    <br />
    </div>
    <table>
    <tr>
    <td align="left">
    <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.2 1')" disable-output-escaping="yes" />
    </td>
    <td align="left">
    <xsl:value-of select="SKU"/>
    <xsl:value-of select="SkuSuffix"/>
    </td>
    </tr>
    <xsl:choose>
    <xsl:when test="Dimensions!=''">
    <tr>
    <td align="left">
    <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.2 3')" disable-output-escaping="yes" />
    </td>
    <td align="left">
    <xsl:value-of select="Dimensions"/>
    </td>
    </tr>
    </xsl:when>
    </xsl:choose>
    <xsl:choose>
    <xsl:when test="Weight!=''">
    <tr>
    <td align="left">
    <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.2 4')" disable-output-escaping="yes" />
    </td>
    <td align="left">
    <xsl:value-of select="aspdnsf:FormatDecimal(Weight, 2)"/>
    </td>
    </tr>
    <tr>
    <td align="left">Manufacturer:
    <xsl:value-of select="/root/EntityHelpers/Manufacturer/Entity/Name" disable-output-escaping="yes" />
    </td>
    </tr>
    </xsl:when>
    </xsl:choose>

    </table>
    <table>
    <xsl:choose>
    <xsl:when test="aspdnsf:AppConfigBool('ShowInventoryTable')= 'true'">
    <tr>
    <td align="left" colspan="2" width="100%">
    <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
    </td>
    </tr>
    </xsl:when>
    <xsltherwise>
    <xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProd ucts') = 'true'">
    <tr>
    <td align="left" colspan="2" width="100%">
    <xsl:value-of select="aspdnsfisplayProductStockHint(ProductID, VariantID, 'Product')" disable-output-escaping="yes" />
    </td>
    </tr>
    </xsl:if>
    </xsltherwise>
    </xsl:choose>
    </table>
    <table>
    <tr>
    <td colspan="2">
    <span>
    <xsl:if test="number(CustomerEntersPrice)=0">
    <xsl:attribute name="id">
    VariantPrice_<xsl:value-of select="VariantID"/>
    </xsl:attribute>
    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
    </xsl:if>
    </span>
    </td>
    </tr>
    </table>
    <div>
    <br />
    </div>
    <xsl:if test="aspdnsf:AppConfigBool('PayPal.Promo.Enabled' )='true'">
    <xsl:if test="Price &lt;= aspdnsf:AppConfig('PayPal.Promo.CartMaximum') and Price &gt;= aspdnsf:AppConfig('PayPal.Promo.CartMinimum')">
    <div style="width:100%; text-align: left;">
    <a target="_blank">
    <xsl:attribute name="href">
    <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.LearnMoreU RL')"/>
    </xsl:attribute>
    <img>
    <xsl:attribute name="src">
    <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.BannerURL' )"/>
    </xsl:attribute>
    </img>
    </a>
    </div>
    </xsl:if>
    </xsl:if>
    <div>
    <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductI D)" disable-output-escaping="yes"/>
    <br/>
    <xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 1)" disable-output-escaping="yes"/>
    </div>
    </td>
    </tr>
    </table>
    </xsltherwise>
    </xsl:choose>

    </xsl:template>

    </xsl:stylesheet>
    </PackageTransform>
    </package>
    Last edited by aahmadi3; 05-18-2011 at 01:26 PM.

  11. #11
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Fixed!

    First ALWAYS post your code inside the CODE tags in the forums (when replying press the # button next to <> and PHP)

    I spent the largest amount of time getting your code to run because the forums make a real mess of it if you don't put it inside the code tags.

    On the bright side I fixed your code. You only used my code in multi variant display, if you only had one variant it calls a different template which you had still calling the manufacturer via the entity.

    When you call the manufacturer with entity on product pages it normally defaults to 1, or first result.

    Here is your fixed code.
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <package version="2.1" displayname="Tabbed UI" debug="false" includeentityhelper="true">
    
      <!-- ###################################################################################################### -->
      <!-- Copyright AspDotNetStorefront.com, 1995-2011.  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.                                                                   -->
      <!-- Edited By DotNetDevelopments                                                                           -->
      <!-- ###################################################################################################### -->
    
    
      <query name="Products" rowElementName="Product">
        <sql>
          <![CDATA[
    exec dbo.aspdnsf_ProductInfo @ProductID, @CustomerLevelID, 0, 0, @affiliateID
    ]]>
        </sql>
        <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$" />
        <queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0" validationpattern="" />
        <queryparam paramname="@affiliateID" paramtype="system" requestparamname="AffiliateID" sqlDataType="int" defvalue="0" validationpattern="" />
      </query>
    
      <!-- MANUFACTURER INFO -->
      <query name="Manufacturers" rowElementName="Manufacturer">
        <sql>
          <![CDATA[ 
    SELECT TOP 1 m.ManufacturerID, m.Name AS ManufacturerName, m.SEName AS ManufacturerSEName 
    FROM dbo.Product p INNER JOIN 
    dbo.ProductManufacturer pn ON @ProductID = pn.ProductID INNER JOIN 
    dbo.Manufacturer m ON pn.ManufacturerID = m.ManufacturerID 
    ]]>
        </sql>
        <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="" />
      </query>
      <!-- END MANUFACTURER INFO -->
    
      <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="LocaleSetting" select="/root/Runtime/LocaleSetting" />
          <xsl:param name="WebConfigLocaleSetting" select="/root/Runtime/WebConfigLocaleSetting" />
          <xsl:param name="XmlPackageName" select="/root/System/XmlPackageName" />
    
    
          <xsl:param name="SecID">
            <xsl:choose>
              <xsl:when test="count(/root/QueryString/sectionid) &gt; 0">
                <xsl:value-of select="/root/QueryString/sectionid" />
              </xsl:when>
              <xsl:otherwise>0</xsl:otherwise>
            </xsl:choose>
          </xsl:param>
    
    
          <xsl:param name="CatID">
            <xsl:choose>
              <xsl:when test="count(/root/QueryString/categoryid) &gt; 0">
                <xsl:value-of select="/root/QueryString/categoryid" />
              </xsl:when>
              <xsl:otherwise>0</xsl:otherwise>
            </xsl:choose>
          </xsl:param>
    
          <xsl:param name="ManID">
            <xsl:choose>
              <xsl:when test="count(/root/QueryString/manufacturerid) &gt; 1">
                <xsl:value-of select="/root/QueryString/manufacturerid" />
              </xsl:when>
              <xsl:otherwise>1</xsl:otherwise>
            </xsl:choose>
          </xsl:param>
    
          <xsl:param name="isMultiVariant" select="count(root/Products/Product) &gt; 1" />
    
          <xsl:template match="/">
            <xsl:comment>Copyright 1995-2008 AspDotNetStorefront.com</xsl:comment>
            <xsl:for-each select="/root/Products/Product[1]">
              <xsl:call-template name="tabbedtemplate"/>
            </xsl:for-each>
          </xsl:template>
    
    
          <xsl:template name="tabbedtemplate">
            <xsl:param name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xsl:param>
            <xsl:param name="AltText">
              <xsl:choose>
                <xsl:when test="$pSEAltText=''">
                  <xsl:value-of select="aspdnsf:GetMLValue(Name)" />
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$pSEAltText" />
                </xsl:otherwise>
              </xsl:choose>
            </xsl:param>
    
            <xsl:choose>
              <xsl:when test="IsAKit=1">
                <div>
                  <b>
                    <font color="red">
                      Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                    </font>
                  </b>
                </div>
              </xsl:when>
              <xsl:when test="IsAPack=1">
                <div>
                  <b>
                    <font color="red">
                      Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                    </font>
                  </b>
                </div>
              </xsl:when>
              <xsl:otherwise>
    
                <div align="right" style="width: 100%; float: right; margin-bottom: -20px; position: relative;">
                  <nobr>
                    <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                  </nobr>
                </div>
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>
                      <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">
                            <script type="text/javascript" src="jscripts/tabbedui.js"></script>
                            <div>
                              <div id="pagetabs">
                                <a rel="overview">
                                  <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab1')" disable-output-escaping="yes" />
                                </a>
                                <a rel="images">
                                  <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab2')" disable-output-escaping="yes" />
                                </a>
                                <xsl:if test="aspdnsf:IsMLExpress() = 'false' and aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1, 0) !=''">
                                  <a rel="reviews">
                                    <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab3')" disable-output-escaping="yes" />
                                  </a>
                                </xsl:if>
                                <a rel="relatedproducts">
                                  <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab4')" disable-output-escaping="yes" />
                                </a>
                                <xsl:if test="aspdnsf:AppConfig('RecentlyViewedProducts.Enabled') = 'true'">
                                  <a rel="recentlyviewedproducts">
                                    <xsl:value-of select="aspdnsf:StringResource('product.tabUI.tab5')" disable-output-escaping="yes" />
                                  </a>
                                </xsl:if>
                              </div>
                              <div id="tabcontent">
                                <div id="overview">
                                  <table>
                                    <tr>
                                      <td>
                                        <xsl:choose>
                                          <xsl:when test="$isMultiVariant = true()">
                                            <xsl:call-template name="OverviewMultiVariant"/>
                                          </xsl:when>
                                          <xsl:otherwise>
                                            <xsl:call-template name="OverviewSingleVariant"/>
                                          </xsl:otherwise>
                                        </xsl:choose>
                                      </td>
                                    </tr>
                                  </table>
                                </div>
    
                                <div id="images">
                                  <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                                </div>
    
                                <xsl:if test="aspdnsf:IsMLExpress() = 'false'">
                                  <div id="reviews">
                                    <xsl:value-of select="aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1, 0)" disable-output-escaping="yes"/>
                                  </div>
                                </xsl:if>
    
                                <div id="relatedproducts">
                                  <xsl:value-of select="aspdnsf:RelatedProducts(ProductID, 0)" disable-output-escaping="yes"/>
                                </div>
    
    
                                <div id ="recentlyviewedproducts">
                                  <xsl:value-of select="aspdnsf:RecentlyViewed(ProductID, 0)" disable-output-escaping="yes"/>
                                </div>
    
                              </div>
    
                              <script type="text/javascript" language="Javascript" >
                                TabbedUI.prototype.initialize();
                              </script>
                            </div>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
    
                </table>
    
                <xsl:if test="$isMultiVariant = true()">
                  <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                      <td>
                        <!-- list variants now -->
                        <xsl:for-each select="/root/Products/Product">
                          <xsl:call-template name="Variant"/>
                        </xsl:for-each>
    
                      </td>
                    </tr>
                  </table>
                </xsl:if>
    
                <table border="0" width="100%" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>
                      <tr>
                        <td colspan="2">
                          <xsl:value-of select="aspdnsf:ShowUpsellProducts(ProductID)" disable-output-escaping="yes"/>
                        </td>
                      </tr>
                    </td>
                  </tr>
                </table>
    
                <div style="width:100%; text-align: right;">
                  <table border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                      <td>
                        <xsl:value-of select="aspdnsf:ProductSpecs(ProductID, 1, SpecsInline, SpecCall, 400)" disable-output-escaping="yes"/>
                      </td>
                    </tr>
                  </table>
                </div>
              </xsl:otherwise>
            </xsl:choose>
    
          </xsl:template>
    
    
    
          <xsl:template name="Variant">
    
            <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"/>
            <xsl:param name="vName" select="aspdnsf:GetMLValue(VariantName)"/>
            <xsl:param name="vDescription" select="aspdnsf:GetMLValue(VariantDescription)"/>
            <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"/>
    
            <table style="width:100%">
              <tr>
                <td style="padding-left: 20px">
                  <div>
                    <b>
                      <xsl:value-of select="$vName" disable-output-escaping="yes" />
                    </b>
                  </div>
                  <div>
                    <br />
                  </div>
    
                  <div>
                    <xsl:value-of select="$vDescription" disable-output-escaping="yes"/>
                  </div>
                  <div>
                    <br />
                  </div>
    
                  <table style="width:100%" border="0">
                    <tr>
                      <td>
                        <table border="0" style="width:100%">
                          <tr>
                            <td align="left">
                              <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.21')" disable-output-escaping="yes" />
                            </td>
                            <td align="left">
                              <xsl:value-of select="SKU"/>
                              <xsl:value-of select="SkuSuffix"/>
                            </td>
                          </tr>
                          <xsl:choose>
                            <xsl:when test="Dimensions!=''">
                              <tr>
                                <td align="left">
                                  <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.23')" disable-output-escaping="yes" />
                                </td>
                                <td align="left">
                                  <xsl:value-of select="Dimensions"/>
                                </td>
                              </tr>
                            </xsl:when>
                          </xsl:choose>
                          <xsl:choose>
                            <xsl:when test="Weight!=''">
                              <tr>
                                <td align="left">
                                  <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.24')" disable-output-escaping="yes" />
                                </td>
                                <td align="left">
                                  <xsl:value-of select="aspdnsf:FormatDecimal(Weight, 2)"/>
                                </td>
                              </tr>
                              <tr>
                                <td align="left">
                                  <xsl:value-of select="/root/Manufacturers/Manufacturer/ManufacturerName" disable-output-escaping="yes" />
                                </td>
                              </tr>
                            </xsl:when>
                          </xsl:choose>
                          <xsl:choose>
                            <!-- 
    Showing of inventory table also goes through the rules of DisplayOutOfStock appconfig if enabled..
    -->
                            <xsl:when test="aspdnsf:AppConfigBool('ShowInventoryTable')= 'true'">
                              <tr>
                                <td align="left" colspan="2" width="100%">
                                  <table border="0" style="width: 110%">
                                    <tr>
                                      <td>
                                        <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
                                      </td>
                                    </tr>
                                  </table>
                                </td>
                              </tr>
                            </xsl:when>
                            <xsl:otherwise>
                              <xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProducts') = 'true'">
                                <tr>
                                  <td align="left" colspan="2" width="100%">
                                    <xsl:value-of select="aspdnsf:DisplayProductStockHint(ProductID, VariantID, 'Product')" disable-output-escaping="yes" />
                                  </td>
                                </tr>
                              </xsl:if>
                            </xsl:otherwise>
                          </xsl:choose>
    
                          <tr>
                            <td colspan="2">
                              <xsl:if test="number(CustomerEntersPrice)=0">
                                <span>
                                  <xsl:attribute name="id">
                                    VariantPrice_<xsl:value-of select="VariantID"/>
                                  </xsl:attribute>
                                  <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
                                </span>
                              </xsl:if>
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td style="width:70%" valign="bottom">
                        <table border="0" style="width:100%; height: 100%">
                          <tr>
                            <td align="left" valign="bottom">
                              <xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 0)" disable-output-escaping="yes"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
    
                  <div>
                    <br />
                  </div>
                  <div>
                    <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductID)" disable-output-escaping="yes"/>
                    <br/>
                  </div>
                  <div>
                    <br />
                  </div>
    
                  <xsl:choose>
                    <xsl:when test="position()!=last()">
                      <hr size="1" color="#CCCCCC" />
                    </xsl:when>
                  </xsl:choose>
                </td>
              </tr>
            </table>
          </xsl:template>
    
          <xsl:template name="OverviewMultiVariant">
            <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"/>
            <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"/>
            <xsl:param name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xsl:param>
            <xsl:param 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:param>
    
            <xsl:choose>
              <xsl:when test="IsAKit=1">
                <div>
                  <b>
                    <font color="red">
                      Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                    </font>
                  </b>
                </div>
              </xsl:when>
              <xsl:when test="IsAPack=1">
                <div>
                  <b>
                    <font color="red">
                      Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                    </font>
                  </b>
                </div>
              </xsl:when>
              <xsl:otherwise>
                <table border="0" width="100%" cellpadding="4" cellspacing="0">
                  <tr>
                    <td align="left" valign="top">
                      <xsl:variable name="imageHTML" select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'icon', 1)" />
                      <xsl:variable name="expectedID" select="concat('ProductPic', ProductID)" />
                      <xsl:variable name="idInstead" select="concat('ProductPic_', ProductID, '_icon')" />
                      <xsl:variable name="htmlInstead" select="concat(substring-before($imageHTML, $expectedID), $idInstead, substring-after($imageHTML, $expectedID))" />
                      <xsl:variable name="finalImageHtml" select="concat(substring-before($htmlInstead, $expectedID), $idInstead, substring-after($htmlInstead, $expectedID))" />
    
                      <xsl:value-of select="$finalImageHtml" disable-output-escaping="yes" />
                    </td>
                    <td align="left" valign="top" width="100%">
                      <div>
                        <table width="100%" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="100%" align="left" valign="middle">
                              <span class="ProductNameTextinTab">
                                <xsl:value-of select="$pName" disable-output-escaping="yes" />
                              </span>
                              <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes" />
                              <br/>
                              <xsl:value-of select="aspdnsf:ProductSpecsLink(ProductID, SpecsInline, SpecTitle, SKU, SpecCall)" disable-output-escaping="yes" />
                            </td>
                          </tr>
                        </table>
                      </div>
                      <div>
                        <br />
                      </div>
                      <div>
                        <xsl:value-of select="$pDescription" disable-output-escaping="yes" />
                      </div>
                      <div>
                        <br />
                      </div>
                      <xsl:if test="aspdnsf:AppConfigBool('PayPal.Promo.Enabled')='true'">
                        <xsl:if test="Price &lt;= aspdnsf:AppConfig('PayPal.Promo.CartMaximum') and Price &gt;= aspdnsf:AppConfig('PayPal.Promo.CartMinimum')">
                          <div style="width:100%; text-align: left;">
                            <a target="_blank">
                              <xsl:attribute name="href">
                                <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.LearnMoreURL')"/>
                              </xsl:attribute>
                              <img>
                                <xsl:attribute name="src">
                                  <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.BannerURL' )"/>
                                </xsl:attribute>
                              </img>
                            </a>
                          </div>
                        </xsl:if>
                      </xsl:if>
                    </td>
                  </tr>
                </table>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:template>
    
          <xsl:template name="OverviewSingleVariant">
    
            <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"/>
            <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"/>
            <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"/>
            <xsl:choose>
              <xsl:when test="IsAKit=1">
                <div>
                  <b>
                    <font color="red">
                      Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                    </font>
                  </b>
                </div>
              </xsl:when>
              <xsl:when test="IsAPack=1">
                <div>
                  <b>
                    <font color="red">
                      Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                    </font>
                  </b>
                </div>
              </xsl:when>
              <xsl:otherwise>
                <table border="0" width="100%" cellpadding="4" cellspacing="0">
                  <tr>
                    <td align="left" valign="top">
                      <xsl:variable name="imageHTML" select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'icon', 1)" />
                      <xsl:variable name="expectedID" select="concat('ProductPic', ProductID)" />
                      <xsl:variable name="idInstead" select="concat('ProductPic_', ProductID, '_icon')" />
                      <xsl:variable name="htmlInstead" select="concat(substring-before($imageHTML, $expectedID), $idInstead, substring-after($imageHTML, $expectedID))" />
                      <xsl:variable name="finalImageHtml" select="concat(substring-before($htmlInstead, $expectedID), $idInstead, substring-after($htmlInstead, $expectedID))" />
    
                      <xsl:value-of select="$finalImageHtml" disable-output-escaping="yes" />
                    </td>
                    <td align="left" valign="top" width="100%">
                      <div>
                        <table width="100%" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="100%" align="left" valign="middle">
                              <span class="ProductNameTextinTab">
                                <xsl:value-of select="$pName" disable-output-escaping="yes" />
                              </span>
                              <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes" />
                              <br/>
                              <xsl:value-of select="aspdnsf:ProductSpecsLink(ProductID, SpecsInline, SpecTitle, SKU, SpecCall)" disable-output-escaping="yes" />
                            </td>
                          </tr>
                        </table>
                      </div>
                      <div>
                        <br />
                      </div>
                      <div>
                        <xsl:value-of select="$pDescription" disable-output-escaping="yes"/>
                      </div>
                      <div>
                        <br />
                      </div>
                      <table>
                        <tr>
                          <td align="left">
                            <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.21')" disable-output-escaping="yes" />
                          </td>
                          <td align="left">
                            <xsl:value-of select="SKU"/>
                            <xsl:value-of select="SkuSuffix"/>
                          </td>
                        </tr>
                        <xsl:choose>
                          <xsl:when test="Dimensions!=''">
                            <tr>
                              <td align="left">
                                <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.23')" disable-output-escaping="yes" />
                              </td>
                              <td align="left">
                                <xsl:value-of select="Dimensions"/>
                              </td>
                            </tr>
                          </xsl:when>
                        </xsl:choose>
                        <xsl:choose>
                          <xsl:when test="Weight!=''">
                            <tr>
                              <td align="left">
                                <xsl:value-of select="aspdnsf:StringResource('showproduct.aspx.24')" disable-output-escaping="yes" />
                              </td>
                              <td align="left">
                                <xsl:value-of select="aspdnsf:FormatDecimal(Weight, 2)"/>
                              </td>
                            </tr>
                            <tr>
                              <td align="left">
                                Manufacturer:
                                <xsl:value-of select="/root/Manufacturers/Manufacturer/ManufacturerName" disable-output-escaping="yes" />
                              </td>
                            </tr>
                          </xsl:when>
                        </xsl:choose>
    
                      </table>
                      <table>
                        <xsl:choose>
                          <xsl:when test="aspdnsf:AppConfigBool('ShowInventoryTable')= 'true'">
                            <tr>
                              <td align="left" colspan="2" width="100%">
                                <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
                              </td>
                            </tr>
                          </xsl:when>
                          <xsl:otherwise>
                            <xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProducts') = 'true'">
                              <tr>
                                <td align="left" colspan="2" width="100%">
                                  <xsl:value-of select="aspdnsf:DisplayProductStockHint(ProductID, VariantID, 'Product')" disable-output-escaping="yes" />
                                </td>
                              </tr>
                            </xsl:if>
                          </xsl:otherwise>
                        </xsl:choose>
                      </table>
                      <table>
                        <tr>
                          <td colspan="2">
                            <span>
                              <xsl:if test="number(CustomerEntersPrice)=0">
                                <xsl:attribute name="id">
                                  VariantPrice_<xsl:value-of select="VariantID"/>
                                </xsl:attribute>
                                <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
                              </xsl:if>
                            </span>
                          </td>
                        </tr>
                      </table>
                      <div>
                        <br />
                      </div>
                      <xsl:if test="aspdnsf:AppConfigBool('PayPal.Promo.Enabled' )='true'">
                        <xsl:if test="Price &lt;= aspdnsf:AppConfig('PayPal.Promo.CartMaximum') and Price &gt;= aspdnsf:AppConfig('PayPal.Promo.CartMinimum')">
                          <div style="width:100%; text-align: left;">
                            <a target="_blank">
                              <xsl:attribute name="href">
                                <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.LearnMoreURL')"/>
                              </xsl:attribute>
                              <img>
                                <xsl:attribute name="src">
                                  <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.BannerURL' )"/>
                                </xsl:attribute>
                              </img>
                            </a>
                          </div>
                        </xsl:if>
                      </xsl:if>
                      <div>
                        <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductID)" disable-output-escaping="yes"/>
                        <br/>
                        <xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 1)" disable-output-escaping="yes"/>
                      </div>
                    </td>
                  </tr>
                </table>
              </xsl:otherwise>
            </xsl:choose>
    
          </xsl:template>
    
        </xsl:stylesheet>
      </PackageTransform>
    </package>
    I added our name in the top comments, the only change was in the single variant template.

    Any changes you make in this code you need to do for single and multi variant. May I suggest you make different XML packages for single and multi variant products? That way you can reduce your code and remove un-required code.

    Any issues or if you need help with any XML packages just get in contact with us!
    Last edited by DotNetDevelopments; 05-19-2011 at 02:13 AM. Reason: Fixed spacing issues the forum made
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  12. #12
    aahmadi3 is offline Member
    Join Date
    Nov 2010
    Posts
    64

    Default

    I dont know how to thank you...this is working perfectly.
    I will also make a note on the instructions for posting code in the future.
    Thanks again!

  13. #13
    ebijs is offline Junior Member
    Join Date
    May 2010
    Posts
    26

    Thumbs up

    Very nice code. Was helpful to me. Thanks.

    Other question:

    How to make the manufacturer logo clickable (border=0) + Alt text to the correspondending manufacturer entity page?

    Ebijs.
    Last edited by ebijs; 05-24-2011 at 03:51 AM.

  14. #14
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Quote Originally Posted by ebijs View Post
    Very nice code. Was helpful to me. Thanks.
    How to make the manufacturer logo clickable (border=0) + Alt text to the correspondending manufacturer entity page?
    You will need to combine two parts of the code I posted. Now as long as you have the query I posted on page one you can do this!

    Code:
    <xsl:variable name="ManufacturerName" select="/root/Manufacturers/Manufacturer/ManufacturerName" />
            <a href="{aspdnsf:EntityLink(/root/Manufacturers/Manufacturer/ManufacturerID, /root/Manufacturers/Manufacturer/ManufacturerSEName, 'Manufacturer', 0)}" title="View All {$ManufacturerName} Products" class="ManufacturerLink">
              <xsl:value-of select="aspdnsf:LookupImage('Manufacturer',/root/Manufacturers/Manufacturer/ManufacturerID,'','', 'icon', $ManufacturerName)" disable-output-escaping="yes" />
            </a>
    I warn you this is not perfect. To remove the border in your css add
    Code:
    .ManufacturerLink img {border:0;}
    If the manufacturer has more than one word it splits it up.
    Hopefully this is a good start for you!
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  15. #15
    ebijs is offline Junior Member
    Join Date
    May 2010
    Posts
    26

    Default

    Thanks! Fast anwser

    When try to run this new code, the system log reported this error:

    Page URL:/_shop/p-10227-behringer-eurolive-epx-speakerset-met-versterkers.aspx
    Source:System.Xml
    Message:The variable or parameter 'ManufacturerName' is either not defined or it is out of scope.
    Stack Trace:
    at System.Xml.Xsl.XslCompiledTransform.LoadInternal(O bject stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at System.Xml.Xsl.XslCompiledTransform.Load(IXPathNav igable stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
    at AspDotNetStorefrontCore.XmlPackage2..ctor(String PackageName, Customer cust, Int32 SkinID, String UserQuery, String AdditionalRuntimeParms, String OnlyRunNamedQuery, Boolean UseExtensions)
    at AspDotNetStorefront.showproduct.Page_Load(Object sender, EventArgs e)
    at System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e)
    at System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e)
    at System.Web.UI.Control.OnLoad(EventArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

  16. #16
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Sounds like you are missing
    Code:
    <xsl:variable name="ManufacturerName" select="/root/Manufacturers/Manufacturer/ManufacturerName" />
    before the A tag, or replace
    Code:
    ManufacturerName
    with
    /root/Manufacturers/Manufacturer/ManufacturerName
    in the code.

    If this still doesn't work make sure you have the query I said in page one inside the xml, if that fails I will look at your xml for you.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  17. #17
    ebijs is offline Junior Member
    Join Date
    May 2010
    Posts
    26

    Default

    Up and running..

    Indeed, I forgot something to copy/paste.

    Code:
    <xsl:variable name="ManufacturerName" select="/root/Manufacturers/Manufacturer/ManufacturerName" />
    Thank you my friend!

    Ebijs