Custom nested attributes | WordPress.org

[ad_1]

I am generating a product feed for Marktplaats (Example feed) in the product feed pro plugin for WooCommerce.

Product feed pro has a preset Marktplaats feed, but it misses some necessary attributes. This would normally not be an issue because you can easily add product attributes, however I need to add nested attributes.

Here is an example of one of the nested attributes I need to add:

<admarkt:shippingOptions>
            <admarkt:shippingOption>
                <admarkt:shippingType>PICKUP</admarkt:shippingType>
                <admarkt:location>1097DN</admarkt:location>
            </admarkt:shippingOption>
            <admarkt:shippingOption>
                <admarkt:shippingType>SHIP</admarkt:shippingType>
                <admarkt:cost>695</admarkt:cost>
                <admarkt:time>2d-5d</admarkt:time>
            </admarkt:shippingOption>
        </admarkt:shippingOptions>

I have added the custom attributes to the products with the advanced custom fields plugin. I have mapped the attribute field groups. Field groups are generated and work fine. The parent and child attributes show up in the Product Feed pro plugin. When I choose the parent attribute “shippingOption”, it just comes out blank.

The plugin has built in nested groups the look like this:

Plugin:

plugin shows the child fields entered, no parents need to be selected

The XML then looks like this (which is correct):

<admarkt:budget>
<admarkt:totalBudget>20</admarkt:totalBudget>
<admarkt:dailyBudget>5</admarkt:dailyBudget>
<admarkt:cpc>0.09</admarkt:cpc>
</admarkt:budget>

How can I make a nested group in my feed like show above, but custom? That’s all I need!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer