For Developers
Filters
Section titled “Filters”wpify_woo_xml_feed_heureka_item_data
Section titled “wpify_woo_xml_feed_heureka_item_data”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 );| Parameter | Type | Description |
|---|---|---|
$data | array | Product data for XML |
$product | WC_Product | Product (variant if exists) |
$parent_product | WC_Product | Parent product |
Returns: array
Usage Examples
Section titled “Usage Examples”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 );wpify_woo_xml_heureka_skip_product
Section titled “wpify_woo_xml_heureka_skip_product”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 );| Parameter | Type | Description |
|---|---|---|
$skip | bool | false default (do not exclude) |
$product | WC_Product | Product |
Returns: bool - true to exclude
Usage Examples
Section titled “Usage Examples”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 );wpify_woo_feed_products_per_page
Section titled “wpify_woo_feed_products_per_page”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} );| Parameter | Type | Description |
|---|---|---|
$count | int | Number of products (default 100) |
Returns: int
wpify_woo_feed_heureka_categories_lang
Section titled “wpify_woo_feed_heureka_categories_lang”Adjusts the language for loading Heureka categories.
add_filter( 'wpify_woo_feed_heureka_categories_lang', function( $lang ) { return 'sk'; // Default is 'cz'} );wpify_heureka_categories_assignment
Section titled “wpify_heureka_categories_assignment”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;} );Product Meta Keys
Section titled “Product Meta Keys”| Field | Meta Key |
|---|---|
| Heureka Product Name | _wpify_woo_heureka_product_name |
| Heureka Product | _wpify_woo_heureka_product |
| Heureka Category | _wpify_woo_heureka_category |
XML Feed Specification
Section titled “XML Feed Specification”You can find the complete list of supported tags in the Heureka XML file specification.