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 | |
function lw_woocommerce_gpf_feed_item_google( $feed_item, $product ) { | |
// Modify $feed_item->description here. | |
return $feed_item; | |
} | |
add_filter( 'woocommerce_gpf_feed_item_google', 'lw_woocommerce_gpf_feed_item_google', 10, 2 ); |
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 | |
function lw_gpf_exclude_product( $excluded, $product_id, $feed_format ) { | |
// return TRUE to exclude this product | |
// return FALSE to include this product | |
// return $excluded to keep the standard behaviour for this product. | |
return $excluded; | |
} |
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_max_variations_for_structured_data', function ($qty) { | |
// Modify '100' below to suit. | |
return 100; | |
}); |
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_msrp_show_msrp_pricing', function( $show_msrp, $current_product_price, $msrp, $current_product ) { | |
// Modify $show_msrp here | |
return $show_msrp; | |
}, 10, 4 ); |
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( 'crfw_should_record_cart', function ( $record_cart, $email, $cart_details ) { | |
$blocked_emails = [ | |
'foo@example.com', | |
]; | |
if ( in_array( $email, $blocked_emails, true ) ) { | |
return false; | |
} |
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 | |
function lw_gpf_exclude_product($excluded, $product_id, $feed_format) { | |
// Return TRUE to specifically exclude a product | |
// Return FALSE to specifically include it | |
// Return $excluded to use the default behaviour as calculated by the extension | |
return $excluded; | |
} | |
add_filter( 'woocommerce_gpf_exclude_product', 'lw_gpf_exclude_product', 11, 3); |
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 | |
/* | |
Plugin Name: Enable WooCommerce GPF feed item cache. | |
Plugin URI: http://docs.woothemes.com/document/google-product-feed/ | |
Description: Enables feed item caching in the Google Product Feed extension. | |
Version: 1.0 | |
Author: Lee Willis | |
Author URI: https://plugins.leewillis.co.uk/ | |
*/ |
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 | |
function lw_gpf_exclude_product($excluded, $product_id, $feed_format) { | |
// Return TRUE to exclude a product, FALSE to include it, $excluded to use the default behaviour. | |
$cats = wp_get_post_terms( $product_id, 'product_cat', array( 'fields' => 'ids' ) ); | |
// Exclude products in category ID 21 | |
if ( in_array( 21, $cats ) ) { | |
return TRUE; | |
} | |
// Exclude products in category ID 22 |
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 | |
function lw_gpf_exclude_product($excluded, $product_id, $feed_format) { | |
// Do not exclude any of the specified product IDs. | |
if ( in_array( $product_id, [ 28 ] ) ) { | |
return false; | |
} | |
// Standard behaviour for all other products. | |
return $excluded; | |
} |
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_wc_get_products_args', function ( $args ) { | |
$args['type'][] = 'yith_bundle'; | |
return $args; | |
} ); |
NewerOlder