
WooCommerce Products XML Feeds
Description
WooCommerce Products XML Feeds lets you create all your shop’s products XML file.
XML is fully customizable, with options to set XML header, item and footer templates.
When creating item template, we advise to use Booster’s products shortcodes.
You can set result XML file path and name.
File can be created manually, or automatically by selected update rate (every minute, hourly, twice daily, daily and weekly).
Additionally you can create multiple XML files with different templates, path, name and update rate.
1 |
<title>[wcj_product_title before="<![CDATA[" after="]]>"]</title> |
This will be outputted in your feed something like:
<![CDATA[Some Product Title]]>
If you need to include shortcode in tags double quotes, use:
1 |
<item id="[wcj_product_id]"></item> |
This will be outputted in your feed something like:
<item id="123"></item>
HTML entities are replaced in all (header, footer, item) fields, so:
1 |
<item date="[wcj_current_datetime datetime_format="Y-m-d H:i:s"]"> |
will be outputted in your feed as:
<item date="2018-09-04 12:42:57">
theme’s functions.php file:
add_shortcode( 'alg_product_price_multiplied_by_stock', 'alg_product_price_multiplied_by_stock' ); if ( ! function_exists( 'alg_product_price_multiplied_by_stock' ) ) { function alg_product_price_multiplied_by_stock( $atts ) { $product_id = get_the_ID(); $product = wc_get_product( $product_id ); return ( ! $product->is_in_stock() ? 0 : $product->get_price() * $product->get_stock_quantity() ); } }
Now you can use it in your feed like:
<stock_price>[alg_product_price_multiplied_by_stock]</stock_price>
- WooCommerce > Settings > Booster > Products > Products XML Feeds
Hi. The XML file is void. Can you help me? Thanks
Hi,
Could you explain what do you mean by saying it’s void? Is it empty? Could you send your module settings to our email support@booster.io?
Best regards,
Rokas – Support Team
Hello,
can I set 2 names in the feed and only display one? For example, [wcj_product_title] [wcj_product_list_attribute name = "example"]
If [wcj_product_list_attribute name = "example"] has a paramater set, display it and ignore [wcj_product_title].
If [wcj_product_list_attribute name = "example"] does not exist, display only [wcj_product_title]. (this method already works)
Use is common, for example, for comparators that accept their names. So I will send the name they want but I will have a different name on my site.
I believe this is a very useful thing. Especially if the product names include the “luxury”, “elegant” and the like, which do not directly represent the product name.
Many thanks
BR
Hi,
is it possible to set a shipping price based on product price in the feed? I would like to set a fixed amount of shipping for products with a price up to a certain amount. For example, for products up to € 80, shipping costs € 3, and for products over € 80, display 0 as free.
BR
Tom
Hi Tom,
Unfortunately that is not possible yet but we have added it to our todo list.
Best regards,
Rokas – Support Team
Hello.
Consider adding in file
includes/class-wcj-products-xml.php
line 191
‘meta_key’ => ‘_stock_status’,
‘meta_value’ => ‘instock’,
but in a variable format like the rest options you have so the user can select to filter only products that are in stock or not or both.
Thank you.
Is there a way to skip an empty tag to be printed if there is no value.
I have following snippet, but i need to skip the whole tag if is empty.
photo
[wcj_product_gallery_image_url image_nr="1" strip_tags="yes" before="<![CDATA[" after="]]>"]
Hi Tarmo,
Unfortunately this is not possible at the moment but we have added it to our todo list.
Best regards,
Rokas – Support Team
Hi,
you have a great plugin!
But how i achieve, in the xml feeds for product,
1. description in another language with wpml?
2. Price in another currency?
[wcj_wpml lang="en"][wcj_product_description strip_tags="yes"][/wcj_wpml]
Don’t work.
Thank you
Hi
Would like to create an XML file to have only the last 30 (or whatever period) products listed based on post_modified date. As this is for a Mailchimp campaign I don’t want all 5000 products being sent to them in an email.
By being able to list by modified date this will enable me to narrow to the more recent active products for WooCommerce.
Any help appreciated
Hi,
Wasn’t possible, but I’ve just made the required changes to the plugin. I found your Booster Plus order, so I’ve just sent you newest Plus dev version in another email. You will need to uninstall the old plugin version first (don’t worry your saved settings won’t disappear).
Now in “WooCommerce > Settings > Booster > Products > Products XML Feeds” you will find new “Sort Products by”, “Sorting Order” and “Max Products” options for each XML file.
Please let me know if that was what you needed. And if you like Booster, please leave us a rating, would really appreciate that.
Best regards,
Tom
Hi,
What are the settings for google feed/
We submitted this feed and google rejected
Hi there, awesome plugin.
How can i set a google friendly xml?
Because i set some fields and shortcodes, but the google shopping has output errors…
Thank you in advance.
Hi Diego,
Thanks.
Could you please send me the exact format (i.e. shortcodes) that you are using, so I could check it on my test server (if you wish, you can send it to me privately to tom@booster.io).
Best regards,
Tom
Hi there, i set this, but the output still wrong…
Hi there, i set this, but the output still wrong…
<g:title>[wcj_product_title]</g:title>
<g:link>[wcj_product_url]</g:link>
<g:id>[wcj_product_id]</g:id>
<g:condition>new</g:condition>
<g:availability>in stock</g:availability>
<g:brand>bichobichejo</g:brand>
<g:price>[wcj_product_regular_price]</g:price>
<g:description>[wcj_product_excerpt]</g:description>
<g:google_product_category>
<![CDATA[
Apparel & Accessories > Handbags, Wallets & Cases > Handbags
]]>
</g:google_product_category>
<g:product_type>1604</g:product_type>
<g:image_link>[wcj_product_image_url image_size="full"]</g:image_link>
<category_full>[wcj_product_categories_names]</category_full>
<category_link>[wcj_product_categories_urls]</category_link>
<g:material>Algodón Orgánico</g:material>
<g:identifier_exists>true</g:identifier_exists>
<g:shipping>5</g:shipping>
Hi Diego,
I’ve tried your code on my server, and I’m getting “Namespace prefix g on title is not defined” errors. To solve this, you need to add
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
to the “XML Header” option (in “WooCommerce > Settings > Booster > Products > Products XML Feeds”). Also you need to add</rss>
to the “XML Footer”.So your header option should look something like that:
and footer something like that:
One more note – you are using
[wcj_product_regular_price]
shortcode. I would suggest addingstrip_tags
attribute, so it would be outputted without the WooCommerce tags, i.e.:[wcj_product_regular_price strip_tags="yes"]
,and maybe also add
hide_currency
attribute, to show only the number, i.e.:[wcj_product_regular_price strip_tags="yes" hide_currency="yes"]
,Hope that helps.
Best regards,
Tom
Is there a way to parse out details from the description [wcj_product_description] using keywords? I have year and manufacturer information inside a table in the product description and want to pull them into individual elements in my XML feed. Examle:
YEAR
2007
MANUFACTURER
BARKO
MODEL
595ML
CONDITION
USED
STOCK NUMBER
F000450
HOURS
14585
LOCATION
SC
I am adding an image link using [wcj_product_image_url]. This only adds one image. What should I do to add other images of my product?
Hi,
I’ve replied to you privately, but in case you didn’t receive it:
I’ve made some changes to the plugin, please download the development version here – http://booster.io/dev/. You will need to uninstall the old plugin version first (don’t worry your saved settings won’t disappear).
Now I’ve added
[wcj_product_gallery_image_url]
shortcode, which you can use in XML module, something like this:You should add maximum number of images possible (in
image_nr
) – if some product won’t have so many images, shortcode will just return empty result.Please let me know if it works as expected or if you have any questions.
Best regards,
Tom
I did the experiment, but there were some problems. Each line of products has a first picture, does not bring different pictures. Also, in products that only have one image, each split takes the same image.