Quantcast
Channel: NBStore Discussions Rss Feed
Viewing all articles
Browse latest Browse all 4081

New Post: relatedproducts.xsl ... once again ... how to reference to custom fields of products

$
0
0

Dave - You are my hero of today - you saved me hours! thanks a lot!

I tried the substring method you pointed me to but at first it does not seem to change anything
Then I digged a little deeper into the "substring" xpath- functions because i wanted to understand what I am doing there.

I ended up with the following code (for the image part) that now works as I wanted it to (I already checked the display in the codesection and it does not translate the gt and lt items - so the code below should work for others too):

<img>
    <xsl:attribute name="alt">              
        <xsl:value-of select="./P/NB_Store_ProductsInfo/ProductName" />             
    </xsl:attribute>
    <xsl:attribute name="title">                
        <xsl:value-of select="./P/NB_Store_ProductsInfo/Summary" />             
    </xsl:attribute>
    <xsl:attribute name="src">              
        <xsl:value-of select="substring-after(substring-before(./P/NB_Store_ProductsInfo/XMLData,'&lt;/txtcolorimage&gt;'),'&lt;txtcolorimage&gt;')" />
        <xsl:text>_</xsl:text>
        <xsl:value-of select="substring-after(substring-before(./P/NB_Store_ProductsInfo/XMLData,'&lt;/txtcolordefault&gt;'),'&lt;txtcolordefault&gt;')"/>
        <xsl:text>.jpg</xsl:text>           
    </xsl:attribute>
</img>

Now the standard product Image for related Products is replaced by the one i define in the Product Details custom fields ...

regards and many thanks again for the fast and perfect support of dave and rob!
Gerald


Viewing all articles
Browse latest Browse all 4081

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>