WooCommerce Products XML Feeds
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.
If you need to use CDATA in feed, you may need to replace symbols with HTML codes, e.g.:
<title>wcjproducttitlebefore“<![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:
<item id="wcjproductidquot</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:
ltitemdate“44-08:00pm11><44-08:00pm11>44-08:00pm11><44-08:00pm11>44-08:00pm11><44-08:00pm11>44-08:00pm11><44-08:00pm11>44-08:00pm11><44-08:00pm11>44-08:00pm11><44-08:00pm11>“gt |
will be outputted in your feed as:
<item date="2018-09-04 12:42:57">
If you have some specific requirements, you can also create your custom shortcodes to be used in feeds. For example try putting this to your (child)
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>
Accessible through:
- WooCommerce > Settings > Booster > Products > Products XML Feeds
Tested on WooCommerce 4.0.0 and WordPress 5.3.2Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.