Make additional product attributes available over REST-API

To do this you only have to add a api2.xml in your modules etc folder that puts the necessary product tags into the node /config/api2/resources/product/attributes (xPath):

<config>
    <api2>
        <resources>            
            <product>
                <attributes>
                    <sheldon_ean>EAN</sheldon_ean>
                    <sheldon_articlenbr>Articlenumber (Model)</sheldon_articlenbr>
                    <sheldon_stylenbr>Stylenumber</sheldon_stylenbr>
                    <sheldon_color>Color</sheldon_color>
                    <sheldon_size>Size</sheldon_size>
                    <sheldon_material_description>Material Description</sheldon_material_description>
                    <sheldon_supplement>Supplement</sheldon_supplement>
                    <sheldon_carehints>Carehints</sheldon_carehints>
                    <sheldon_is_aboable>Is aboable product</sheldon_is_aboable>
                    <sheldon_is_sale_product>Is sale product</sheldon_is_sale_product>
                    <sheldon_is_new_product>Is new product</sheldon_is_new_product>
                    <sheldon_is_reddot_product>Is reddot Product</sheldon_is_reddot_product>
                    <sheldon_reddot_years>Product Reddotyears</sheldon_reddot_years>
                    <sheldon_is_airberlin_reduceable>Airberlin discoutable</sheldon_is_airberlin_reduceable>
                    <sheldon_color_filter>Color Filter</sheldon_color_filter>
                    <sheldon_denier_filter>Denier</sheldon_denier_filter>
                    <sheldon_shape_filter>Shape</sheldon_shape_filter>
                    <sheldon_function_filter>Function</sheldon_function_filter>
                    <sheldon_gloss_filter>Gloss</sheldon_gloss_filter>
                    <sheldon_material_filter>Material</sheldon_material_filter>
                    <sheldon_pattern_motif_filter>Pattern / Motif</sheldon_pattern_motif_filter>
                    <sheldon_structure_filter>Structure</sheldon_structure_filter>
                    <sheldon_structure_pattern_filter>Structure / Pattern</sheldon_structure_pattern_filter>
                    <sheldon_transparency_gloss_filter>Transparency / Gloss</sheldon_transparency_gloss_filter>
                    <sheldon_season_filter>Season</sheldon_season_filter>
                    <description>Description</description>
                    <short_description>Short-Description</short_description>
                </attributes>
            </product>
        </resources>
    </api2>
</config>

After that you can edit your REST-Attribute permissions, where you’ll find the newly defined attributes.

Then a call to die products -API will show you the new Attributes.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.