0

I have a magento feed output with filters setup as to which products to export but it still exports absolutely everything on my webshop.

I've included the xml code below, is there something wrong with it?

<?xml version="1.0"?>
<files> 
<file filename="namehidden.xml"> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" exclude-result-prefixes="php">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>

<xsl:template match="/">

<xsl:element name="products">
<xsl:for-each select="objects/object">
<xsl:element name="product">
<xsl:element name="code"><xsl:value-of select="sku"/></xsl:element>
<xsl:element name="tootja"><xsl:value-of select="tootja"/></xsl:element>
<xsl:element name="name"><xsl:value-of select="name"/></xsl:element>

<xsl:choose>
    <xsl:when test="special_price &gt; 0 or original_price &gt; special_price">
    <xsl:if test="not(special_price_active='0')">
        <xsl:element name="base_price_discount"><xsl:value-of select="php:functionString('number_format', special_price, 2, '.', '')"/></xsl:element>
    </xsl:if>
    <xsl:if test="not(special_to_date)">
        <xsl:element name="base_price_discount"><xsl:value-of select="php:functionString('number_format', special_price, 2, '.', '')"/></xsl:element>
    </xsl:if>
        <xsl:element name="base_price"><xsl:value-of select="php:functionString('number_format', original_price, 2, '.', '')"/></xsl:element>
    </xsl:when>
    <xsl:otherwise>
        <xsl:element name="base_price"><xsl:value-of select="php:functionString('number_format', original_price, 2, '.', '')"/></xsl:element>
    </xsl:otherwise>
</xsl:choose>

<xsl:choose>
    <xsl:when test="special_price &gt; 0 or original_price &gt; special_price">
    <xsl:if test="not(special_price_active='0')">
        <xsl:element name="wholesale_price"><xsl:value-of select="php:functionString('number_format', 0.85*special_price, 2, '.', '')"/></xsl:element>
    </xsl:if>
    <xsl:if test="not(string(special_to_date)) and not(special_price_active='1')">
        <xsl:element name="wholesale_price"><xsl:value-of select="php:functionString('number_format', 0.85*special_price, 2, '.', '')"/></xsl:element>
    </xsl:if>
    <xsl:if test="not(special_price_active='1') and special_to_date !=''">
        <xsl:element name="wholesale_price"><xsl:value-of select="php:functionString('number_format', 0.75*original_price, 2, '.', '')"/></xsl:element>
    </xsl:if>
    </xsl:when>
    <xsl:otherwise>
        <xsl:element name="wholesale_price"><xsl:value-of select="php:functionString('number_format', 0.75*original_price, 2, '.', '')"/></xsl:element>
    </xsl:otherwise>
</xsl:choose>

<xsl:element name="stock"><xsl:value-of select="qty"/></xsl:element>


<xsl:element name="tarneaeg">
<xsl:choose>
<xsl:when test="qty &lt; 0"><xsl:text>14</xsl:text></xsl:when>
<xsl:when test="qty=0"><xsl:text>14</xsl:text></xsl:when>
<xsl:otherwise>3</xsl:otherwise>
</xsl:choose>

</xsl:element>


<xsl:element name="weight"><xsl:value-of select="weight"/></xsl:element>
<xsl:element name="short_description"><xsl:value-of select="short_description"/></xsl:element>
<xsl:element name="description"><xsl:value-of select="description"/></xsl:element>
<xsl:element name="image"><xsl:value-of select="image"/> </xsl:element>
<xsl:element name="image">
<xsl:for-each select="images/image[2]">
    <xsl:value-of select="url"/>
</xsl:for-each> 
</xsl:element>
<xsl:element name="category_name">
<xsl:value-of select="cats/cat[level=2]/name" />
<xsl:if test="cats/cat[level=3]/name"><xsl:if test="string(cats/cat[level=2]/name)"> &#47; </xsl:if><xsl:value-of select="cats/cat[level=3]/name" /></xsl:if>
<xsl:if test="cats/cat[level=4]/name"> <xsl:if test="string(cats/cat[level=3]/name) or string(cats/cat[level=2]/name)"> &#47; </xsl:if><xsl:value-of select="cats/cat[level=4]/name" /></xsl:if>
<xsl:if test="cats/cat[level=5]/name"><xsl:if test="string(cats/cat[level=4]/name) or string(cats/cat[level=3]/name) or string(cats/cat[level=2]/name)"> &#47; </xsl:if> <xsl:value-of select="cats/cat[level=5]/name" />
</xsl:if>
</xsl:element>


 <xsl:element name="category_id"><xsl:value-of select="entity_id"/></xsl:element>


</xsl:element>
</xsl:for-each>
</xsl:element>

</xsl:template>
</xsl:stylesheet>
</file>
</files>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.