Build sets of products to import into your website.
NOTE: The Datafeedr Product Sets plugin requires the Datafeedr API plugin.
What is a Product Set?
A Product Set is a collection of related products. Once you create a Product Set, the products in that set will be imported into your website (via an importer plugin). The Product Set is also responsible for updating those imported products with the newest information at an interval you choose.
The Datafeedr Product Sets plugin currently integrates with the following plugins:
How does it work?
Create a new Product Set by performing a product search for specific keywords. In this example lets use “rock climbing shoes” as our keywords.
The Datafeedr Product Sets plugin connects to the Datafeedr API and makes an API request querying 250 million affiliate products in the Datafeedr database for the keywords “rock climbing shoes”.
The Datafeedr API returns the products in the database that match your search keywords.
At this point, you have 2 choices: You can “save” your search (so that all products returned are added to your Product Set) or you can pick and choose specific products to add to your Product Set.
After your Product Set has some products in it, you choose what WordPress Post Type and Category to import the Product Set into. For example, you could import all of the rock climbing shoes into your WooCommerce store in the “Climbing Shoes” product category.
Within a few seconds the Product Set will attempt to import those products into your WooCommerce product category. It will do so by getting all of the products in the Product Set and passing them to an importer plugin (in this case the Datafeedr WooCommerce Importer plugin).
After a few minutes (depending on how many products are in your set and your update settings) your “Climbing Shoes” product category will be filled with products from your Product Set.
Lastly, at an interval you configure, the Product Set will trigger a product update. At this time, products no longer available via the Datafeedr API will be removed from your WooCommerce store, all product information will be updated and any new products that match your “saved search” will be added to your store.
The Datafeedr Product Sets plugin requires at least one importer plugin to import products from a Product Set into your blog.
We currently have one importer which imports products from your Product Sets into your WooCommerce store: Datafeedr WooCommerce Importer plugin. Additional importers will be developed over the coming months. Custom importers may also be written. Product Sets can be imported into one or more WordPress Post Types.
Requirements
CURL
enabledThis section describes how to install and configure the plugin:
datafeedr-product-sets
folder to the /wp-content/plugins/
directory.Our support area can be found here: https://datafeedrapi.helpscoutdocs.com/. This support area is open to everyone.
dfrps_bypass_premature_delete_check
filter hook and returning true
.direct_url
field.image
field from expanding beyond the width of the browser.require_once()
calls differently.dfrps_get_default_update_time()
function.dfrps_get_next_update_time()
register_activation_hook
register_activation_hook
to ensure that plugin can only be activated at Site-Level, not Network-LevelDfrapi_Env::api_keys_exist()
with dfrapi_datafeedr_api_keys_exist()
if ( $thumbnail_id > 0 )
check for image importing.dfrps_do_import_product_thumbnail()
function.dfrapi_schedule_single_action()
instead of dfrapi_schedule_async_action()
so that the “Scheduled Date” column is set to something more meaningful than “0000-00-00 00:00:00”dfrps_do_import_product_thumbnail()
function.dfrps_error_log
function and added conditional check of dfrps_log_errors
filter before logging.dfrps_get_product_field()
helper function.dfrps
as the meta_value to the new _owner_datafeedr
meta_key for images imported by the Datafeedr Product Sets plugin.Datafeedr_Plugin_Dependency
class.dfrps_import_post_thumbnail()
.dfrps_ajax_batch_import_images()
more verbose.dfrps_product()
helper function.dfrps_do_import_product_thumbnail()
helper function.dfrps_featured_image_url()
helper function.dfrps_import_post_thumbnail()
helper function.dfrps_import_post_thumbnail()
function to import images if user is using newest version of Datafeedr API plugin.dfrps_ajax_test_loopbacks()
function.dfrps_image_imported_successfully
action which gets called when and image is imported successfully.has_post_thumbnail
check to dfrps_import_image()
function before initializing Dfrps_Image_Importer
.show_in_nav_menus
to false for Product Set custom post type.convert_mime_to_ext()
function.preg_match()
from the media_sideload_image()
method to force the importer script to rely solely on a wp_remote_get()
call to get the image ‘content-type’.'image/webp' => 'webp'
to the convert_mime_to_ext()
to support the .webp extension. Still requires this plugin to work: https://wordpress.org/plugins/wp-webp/DISABLE_WP_CRON
is set to anything other than false
in the wp-config.php file.dfrps_import_image()
function to prevent it from trying to import images for post types not supported by the Product Set plugin.wp_defer_term_counting(true/false)
before and after wp_set_object_terms()
in the dfrps_add_term_ids_to_post()
function. This speeds up phase1 of the Product Set updater by about 4x.dfrps_get_existing_post()
function to help offset any duplicate products being imported.dfrps_doing_update
filter to dfrps_get_product_set_to_update()
to bypass the “doing update” check to speed up Product Set updates.$image_url
from the set_image_url()
function.image
field.dfrps_get_post_obj_by_postmeta()
function for things to come. 😉