Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Kerboute committed Nov 20, 2020
1 parent 28599bf commit d2cc248
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,27 @@ add_filter( 'wc_tracking_url', 'your_custom_tracking_url_function' );
function your_custom_tracking_url_function() {
return ‘your_custom_order_meta_key’
}
`

### Extra Fields
If you want to add add extra fields to your XML Feed, you can use the following snippet
`
add_filter( 'shopping_feed_extra_fields', 'your_custom_fields_function', 10, 2 );
/** @return array */
function your_custom_tracking_url_function($fields, $wc_product) {
$fields[] = array('name'=>'my_field', 'value'=>'my_value');
return $fields;
}
`

### Variation Images
By default, we don’t support any custom plugin for adding images to WC Product Variation, with this filter you can set the desired images to each variation, you can use the following snippet
`
add_filter( 'shopping_feed_variation_images', 'your_custom_variation_images_function', 10, 2 );
/** @return array */
function your_custom_tracking_url_function($images, $wc_product) {
$images[] = 'https://domain.com/image1.jpg';
$images[] = 'https://domain.com/image2.jpg';
return $images;
}
`

0 comments on commit d2cc248

Please sign in to comment.