Skip to content

For Developers

The main filter for modifying or adding product data in the feed.

add_filter( 'wpify_woo_xml_feed_heureka_item_data', function( $data, $product, $parent_product ) {
// Modify data
return $data;
}, 10, 3 );
ParameterTypeDescription
$dataarrayProduct data for XML
$productWC_ProductProduct (variant if exists)
$parent_productWC_ProductParent product

Returns: array

Using short description:

add_filter( 'wpify_woo_xml_feed_heureka_item_data', function( $data, $product, $parent_product ) {
if ( $product->get_short_description() ) {
$data['DESCRIPTION'] = array( '_cdata' => $product->get_short_description() );
} elseif ( $parent_product->get_short_description() ) {
$data['DESCRIPTION'] = array( '_cdata' => $parent_product->get_short_description() );
}
return $data;
}, 10, 3 );

Adding MANUFACTURER:

add_filter( 'wpify_woo_xml_feed_heureka_item_data', function( $data, $product ) {
$manufacturer = $product->get_attribute( 'manufacturer' );
if ( $manufacturer ) {
$data['MANUFACTURER'] = array( '_cdata' => $manufacturer );
}
return $data;
}, 10, 2 );

Free shipping over 1500 CZK:

add_filter( 'wpify_woo_xml_feed_heureka_item_data', function( $data, $product ) {
if ( $product->get_price() > 1500 ) {
foreach ( $data as $key => $item ) {
if ( strpos( $key, '__custom:DELIVERY' ) !== false && $item['DELIVERY_ID'] === 'ZASILKOVNA' ) {
$data[$key]['DELIVERY_PRICE'] = 0;
$data[$key]['DELIVERY_PRICE_COD'] = 30;
}
}
}
return $data;
}, 10, 2 );

Adding alternative images:

add_filter( 'wpify_woo_xml_feed_heureka_item_data', function( $data, $product ) {
$gallery_ids = $product->get_gallery_image_ids();
foreach ( $gallery_ids as $id ) {
$data['__custom:IMGURL_ALTERNATIVE:' . $id] = array(
'_cdata' => wp_get_attachment_url( $id )
);
}
return $data;
}, 10, 2 );

Filter for excluding a product from the feed.

add_filter( 'wpify_woo_xml_heureka_skip_product', function( $skip, $product ) {
// Return true to exclude
return $skip;
}, 10, 2 );
ParameterTypeDescription
$skipboolfalse default (do not exclude)
$productWC_ProductProduct

Returns: bool - true to exclude

Exclude by ID:

add_filter( 'wpify_woo_xml_heureka_skip_product', function( $skip, $product ) {
return in_array( $product->get_id(), array( 19, 20, 21 ) );
}, 10, 2 );

Exclude by category:

add_filter( 'wpify_woo_xml_heureka_skip_product', function( $skip, $product ) {
$excluded = array( 15, 16 ); // Category IDs
return count( array_intersect( $excluded, $product->get_category_ids() ) ) > 0;
}, 10, 2 );

Filter by language (Polylang):

add_filter( 'wpify_woo_xml_heureka_skip_product', function( $skip, $product ) {
if ( ! function_exists( 'pll_get_post_language' ) ) {
return $skip;
}
$desired_lang = 'cs'; // Language for feed (cs, sk, en, ...)
$product_lang = pll_get_post_language( $product->get_id(), 'slug' );
// Exclude products in other languages
if ( $product_lang && $product_lang !== $desired_lang ) {
return true;
}
return $skip;
}, 10, 2 );

Filter by language (WPML):

add_filter( 'wpify_woo_xml_heureka_skip_product', function( $skip, $product ) {
$desired_lang = 'cs'; // Language for feed
$product_lang = apply_filters( 'wpml_post_language_details', null, $product->get_id() );
if ( $product_lang && isset( $product_lang['language_code'] ) && $product_lang['language_code'] !== $desired_lang ) {
return true;
}
return $skip;
}, 10, 2 );

Adjusts the number of products processed in one generation step.

add_filter( 'wpify_woo_feed_products_per_page', function( $count ) {
return 20; // Default is 100
} );
ParameterTypeDescription
$countintNumber of products (default 100)

Returns: int


Adjusts the language for loading Heureka categories.

add_filter( 'wpify_woo_feed_heureka_categories_lang', function( $lang ) {
return 'sk'; // Default is 'cz'
} );

Adjusts arguments for loading WooCommerce categories during mapping.

add_filter( 'wpify_heureka_categories_assignment', function( $args ) {
$args['hide_empty'] = true; // Hide empty categories
return $args;
} );
FieldMeta Key
Heureka Product Name_wpify_woo_heureka_product_name
Heureka Product_wpify_woo_heureka_product
Heureka Category_wpify_woo_heureka_category

You can find the complete list of supported tags in the Heureka XML file specification.