Last active
December 1, 2021 14:31
-
-
Save victormattosvm/33ddf57afc0f49c49236b31e196232ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This filter was added in file 'includes/tools/XML/XMLProductFeed.php' (LINE 298) | |
* It allows any user to add custom params to the feed generation. | |
*/ | |
add_filter('product_feed_params', function ( $params, $product, $parent_product ){ | |
if( $parent_product ){ | |
$product_id = $parent_product->get_id(); | |
}else{ | |
$product_id = $product->get_id(); | |
} | |
$vendor = \get_wcmp_product_vendors($product_id); | |
if( $vendor ){ | |
$params[] = array( | |
'name' => __( 'Seller' ), | |
'value' => $vendor->user_data->display_name | |
); | |
} | |
return $params; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment