Last active
June 4, 2020 14:51
-
-
Save leewillis77/8e299bf840bbdef2aad8aca51fda3a9d to your computer and use it in GitHub Desktop.
Example of adding fixed g:shipping tag to Google Product Feed
This file contains 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['shipping'] = [ | |
[ | |
'country' => 'GB', | |
'region' => 'Cumbria', | |
'service' => 'Royal Mail', | |
'price' => '1.99 GBP', | |
] | |
]; | |
return $feed_item; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment