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, $product ) { | |
// Modify $feed_item->item_group_id here | |
return $feed_item; | |
}, 10, 2 ); |
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, $product ) { | |
// Modify $feed_item->image_link and/or $feed_item->additional_images here. | |
return $feed_item; | |
}, 10, 2 ); |
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_title', function ( $title, $specific_id ) { | |
global $post, $gpf_original_post; | |
$gpf_original_post = $post; | |
$post = get_post( $specific_id ); | |
setup_postdata( $post ); | |
return $title; | |
}, 10, 2 ); |
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 | |
/** | |
* Registers a meta field with key _ts_gtin as a prepopulation option | |
*/ | |
function lw_woocommerce_gpf_custom_field_list( $list ) { | |
$list['meta:_ts_gtin'] = 'GTIN field from WooCommerce Germanized'; | |
return $list; | |
} | |
add_filter( 'woocommerce_gpf_custom_field_list', 'lw_woocommerce_gpf_custom_field_list' ); |
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 | |
/** | |
* Registers a meta field as a prepopulation option. | |
*/ | |
function lw_woocommerce_gpf_custom_field_list( $list ) { | |
$list['meta:_wpm_gtin_code'] = 'GTIN field from Product GTIN for WooCommerce plugin'; | |
return $list; | |
} |
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, $product ) { | |
// The regular price of the item. | |
$feed_item->regular_price_ex_tax = 1000; | |
$feed_item->regular_price_inc_tax = 1200; | |
// Set these to NULL if no sale price, or the sale price if required. | |
$feed_item->sale_price_ex_tax = null; | |
$feed_item->sale_price_inc_tax = null; | |
// Set these to the sale price if it exists, otherwise the regular price. |
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_shipping_weight_unit', function ( $unit ) { | |
return 'lbs'; | |
}); |
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_action( 'init', function() { | |
global $woocommerce_msrp_frontend; | |
remove_action( 'woocommerce_after_shop_loop_item_title', array( $woocommerce_msrp_frontend, 'show_msrp' ), 9 ); | |
}); |
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_exclude_product', function ($excluded, $id, $feed_format ) { | |
// Return $excluded to follow the calculated logic. | |
// Return TRUE to exclude a product | |
// Return FALSE to include it. | |
return $excluded; | |
},10, 3 ); |
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 | |
function lw_crfwp_timing_options( $options ) { | |
// 259200 is the number of seconds in 72 hours. | |
$options[259200] = '72 Hours'; | |
return $options; | |
} | |
add_filter( 'crfwp_timing_options', 'lw_crfwp_timing_options' ); |