Created
June 9, 2020 12:14
-
-
Save leewillis77/38d14852cd3c8ab8c488b19af61da5dc to your computer and use it in GitHub Desktop.
Add product ID to custom label in Google Product Feed
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 | |
add_filter( 'woocommerce_gpf_feed_item_google', function ( $feed_item, $wc_product ) { | |
$feed_item->additional_elements['custom_label_4'] = [ $wc_product->get_id() ]; | |
return $feed_item; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment