Twilli Posted January 15, 2019 Share Posted January 15, 2019 Hallo, ich möchte aus der rss.php das zugehörige Produktbild anzeigen lassen: Code: <?php foreach ($products AS $product) { $image = Image::getImages((int)($cookie->id_lang), $product['id_product']); echo "\t\t<item>\n"; echo "\t\t\t<title><![CDATA[".$product['name']." ]]></title>\n"; echo "\t\t\t<description>"; $cdata = true; if (is_array($image) AND sizeof($image)) { $imageObj = new Image($image[0]['id_image']); echo "<![CDATA[<img src='".$link->getImageLink($product['link_rewrite'], $image[0]['id_image'], 'medium_default')."' title='".str_replace('&', '', $product['name'])."' alt='thumb' />"; $cdata = false; } if ($cdata) echo "<![CDATA["; echo $product['description_short']."]]>-</description>\n"; echo "\t\t\t<link><![CDATA[".str_replace('&', '&', htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang)))).$affiliate."]]></link>\n"; echo "\t\t</item>\n"; } ?> Dies wird über eine xsl realisiert. Der Titel und de Link funtkionieren, aber der obige Code für das Produktbild bzw. die komplette description funktioniert nicht. Zugehörige xsl: <xsl:for-each select="rss/channel/item"> <li class="episodes-list__item"> <h3 class="no-margin"> <a> <xsl:attribute name="href"> <xsl:value-of select="link"/> </xsl:attribute> <xsl:value-of select="title"/> </a> </h3> <p> <xsl:value-of select="description"/> </p> <p> <a> <xsl:attribute name="href"> <xsl:value-of select="link"/> </xsl:attribute> weiter zur Produktansicht >> </a> </p> </li> <hr /> </xsl:for-each> Hat jemand eine Idee/Lösungsansatz?? Danke!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now