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

Thread: Manufacturer's image on product page.

  1. #1
    osdude is offline Senior Member
    Join Date
    Nov 2007
    Location
    earth
    Posts
    202

    Default Manufacturer's image on product page.

    A while back, I had added manufacturer's image to the product page and there was a rather lengthy thread about it. Well, I am trying to do the same thing again, but that thread is gone and I can't seem to figure out how to do it again.


    From what I remember, there was a SQL query to find the manufacturer's image and then a call for that image, but for the life of me, I can't seem to figure this out again.

    Anyone know how? I did it before, but my notes are gone

  2. #2
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Nope, there's no need to run a SQL script or modify any code. On the XML package, you're using, for instance product.SimpleProduct.xml.config, locate the template Product, then add the following params:
    Code:
    <xsl:param name="ManufacturerID" select="/root/EntityHelpers/Manufacturer/Entity/EntityID"></xsl:param>
    <xsl:param name="ManufacturerAltText" select="/root/EntityHelpers/Manufacturer/Entity/SEAltText"></xsl:param>
    Then you put this line anywhere you want the manufacturer image to appear:
    Code:
    <xsl:value-of select="aspdnsf:LookupImage('manufacturer',$ManufacturerID,'','', 'icon', $ManufacturerAltText)" disable-output-escaping="yes" />
    and that's it...

  3. #3
    osdude is offline Senior Member
    Join Date
    Nov 2007
    Location
    earth
    Posts
    202

    Default

    hmmm...

    It does show a manufacturer's image, but not that of the item. It shows the first manufacturer's image by alphabetical order and not the manufacturer's image of the product on the page. This happens on every product page, even on stock product.xml packages.

    ML 8.0.0.0

    But there is an image, so it's something in the call I guess. I will keep trying on this and let you know if I find out anything

  4. #4
    Dbennett4995 is offline Member
    Join Date
    Oct 2008
    Location
    Metairie, LA
    Posts
    62

    Default

    I tried inserting this code and received the following errors:

    XmlPackage Exception: Exception=Last Trace Point=[]. Extension object 'urn:aspdnsf' does not contain a matching 'LookupImage' method that has 6 parameter(s).


    System.ArgumentException: Last Trace Point=[]. Extension object 'urn:aspdnsf' does not contain a matching 'LookupImage' method that has 6 parameter(s).

    at AspDotNetStorefrontCommon.XmlPackage2.TransformStr ing() at AspDotNetStorefrontCommon.AppLogic.RunXmlPackage(X mlPackage2 p, Parser UseParser, Customer ThisCustomer, Int32 SkinID, Boolean ReplaceTokens, Boolean WriteExceptionMessage)

  5. #5
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Could you tell us what version are you using?

  6. #6
    Dbennett4995 is offline Member
    Join Date
    Oct 2008
    Location
    Metairie, LA
    Posts
    62

    Default

    I am using v.7.1.0.0

  7. #7
    xplosiv1 is offline Junior Member
    Join Date
    Dec 2009
    Posts
    2

    Unhappy Same problem as osdude

    I'm having the same problem as osdude, but I'm trying to put the manufacturer's name on the page, not the image. Here is the code I'm using:

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

  8. #8
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Dbennett4995: The ML7100 doesn't have the AltText parameter added, unlike the latest ML8012. You could change that line above to:
    Code:
    <xsl:value-of select="aspdnsf:LookupImage('manufacturer',$ManufacturerID,'','', 'icon')" disable-output-escaping="yes" />

  9. #9
    Dbennett4995 is offline Member
    Join Date
    Oct 2008
    Location
    Metairie, LA
    Posts
    62

    Default Jao

    Luck with getting a logo to appear, however it is the same problem as these other two guys being that only the first logo alphabetically is being display for all products that have the same XML display package.

  10. #10
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    That code is pulling from the EntityHelper xml, so it's only going to return the ManufacturerID of the first manufacturer it finds in that XML (if you set debug="true" in the xmlpackage it will dump the xml returned for the package to the page so that you can review). Which xmlpackage are you using and where in the package are you trying to place the manufacturer image so I can explain the best way to achieve this?
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  11. #11
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    Here's an example of doing it in product.simpleproduct.xml.config. Add the following near the top with the rest of the queries
    Code:
    <query name="Manufacturers" rowElementName="Manufacturer" runif="showproduct">
      <sql>
        <![CDATA[
          select ManufacturerID from dbo.ProductManufacturer with(NOLOCK) where ProductID=@ProductID
        ]]>
      </sql>
      <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
    </query>
    Then you can get the manufacturer ID using
    Code:
    <xsl:value-of select="/root/Manufacturers/Manufacturer/ManufacturerID"/>
    or padd it directly into the extension function
    Code:
    <xsl:value-of select="aspdnsf:LookupImage('manufacturer',/root/Manufacturers/Manufacturer/ManufacturerID,'','', 'icon', '')" disable-output-escaping="yes" />
    If you're using a different package let me know...depending on the package the manufacturer id may already be returned in the existing queries or it may be easier to modify one of the existing queries to just return it.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  12. #12
    Dbennett4995 is offline Member
    Join Date
    Oct 2008
    Location
    Metairie, LA
    Posts
    62

    Default

    I am placing this within product.VariantsInRightBar.xml.config inside of the <xsl:template match="Product"> and I've tried placing the LookupImage code before and after the ProductNavLinks.

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

    Default

    This code has all been great.

    However we are trying to use this on the search page. How can we get this to work on the search page? It only loads the first image and uses it for all the others.

    Thanks in advance.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  14. #14
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Sure, simply add the highlighted part on the page.search.xml.config
    Code:
                  <xsl:if test="aspdnsf:AppConfigBool('Search_ShowManufacturersInResults')='true'">
                    <td align="center">
                      <xsl:if test="ManufacturerID!=''">
                        <xsl:value-of select="aspdnsf:ManufacturerLink(ManufacturerID, ManufacturerSEName, 1, ManufacturerName)" disable-output-escaping="yes" />
                        <xsl:value-of select="aspdnsf:LookupImage('manufacturer',ManufacturerID,'','', 'icon', '')" disable-output-escaping="yes" />                                                                
                      </xsl:if>
                    </td>
                  </xsl:if>

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

    Default

    Sadly that just throws an error for me.

    saying it can not pull the id

    At the moment I am using this code however it only shows the first image for all the manufacturer results.

    C#/VB.NET Code:
    <xsl:value-of select="aspdnsf:LookupImage('manufacturer',/root/Manufacturers/Manufacturer/ManufacturerID,'','', 'icon', '')" disable-output-escaping="yes" /><xsl:value-of select='Name' />" <xsl:text disable-output-escaping="yes"> / > </xsl:text> 
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

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

    Default

    Fixed that problem.

    C#/VB.NET Code:
                        <xsl:value-of select="aspdnsf:LookupImage('manufacturer',EntityID,'','', 'icon', 0)" disable-output-escaping="yes" /> 
    ManufacturerID needed to be replaced with EntityID. Working fine now.
    Thanks
    =====
    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
    MSD is offline Member
    Join Date
    Sep 2009
    Location
    EST
    Posts
    57

    Default Manufacturers Name

    My error SQL querry error typo

    Thanks,

    MSD
    Last edited by MSD; 02-17-2010 at 04:17 PM.
    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

  18. #18
    fsantos is offline Senior Member
    Join Date
    Feb 2007
    Posts
    244

    Default

    I'm trying to get the manufacturer's name to display on the product.SimpleProduct.xml.config package. Can someone help me out with that? Based on this thread I have the manufacturer ID showing, but I really need the name. This should be really easy but is beyond my knowledge.

    Thanks for your help!

  19. #19
    tonya is offline Junior Member
    Join Date
    Sep 2011
    Posts
    22

    Post Manufacturer's Name on Product Page

    Fsantos, I just came across this thread as I was looking to do the same thing that you mentioned - add the Manufacturer name to my product page, albeit I am using a different xml package. By now, I hope you have resolved the matter but I thought I would go ahead and post the solution that I found in case anyone else can use it.

    For reference, I am using v. 8.0.1.2 and only have access to my XML packages/skins.

    Code:
    <query name="prodManufacturers" rowElementName="prodManufacturer" runif="showproduct">
      <sql>
    SELECT Name prodManName 
    FROM dbo.Manufacturer 
    WHERE ManufacturerID IN 
    (SELECT ManufacturerID manufacturerID 
    FROM dbo.ProductManufacturer 
    WHERE ProductID = @ProductID);
      </sql>
    <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,10}$"/>
    </query>
    Then to display the Manufacturer's Name, use:
    Code:
    <xsl:value-of select="/root/prodManufacturers/prodManufacturer/prodManName" disable-output-escaping="yes"/>
    Cheers,
    ~Tonya

  20. #20
    fsantos is offline Senior Member
    Join Date
    Feb 2007
    Posts
    244

    Default

    Tonya,

    Thanks for sharing your solution. I found a different way to do it. I'm not sure which one is better - I will leave that to the experts on the forum to comment.

    Here is my solution:
    Code:
    <query name="Manufacturers" rowElementName="Manufacturer" runif="showproduct">
        <sql>
          <![CDATA[
          select ManufacturerID from dbo.ProductManufacturer with(NOLOCK) where ProductID=@ProductID
        ]]>
        </sql>
        <queryparam paramname="@ProductID" paramtype="request" requestparamname="ProductID" sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
    </query>
    To retrieve the Manufacturer's name I used:

    Code:
    <xsl:value-of select="/root/EntityHelpers/Manufacturer/Entity[EntityID=/root/Manufacturers/Manufacturer/ManufacturerID]/Name/ml/locale[@name=$LocaleSetting]" disable-output-escaping="yes"/>
    Thanks again!