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_price_column_hidden', '__return_true' ); |
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 = [ | |
'[email protected]', | |
]; | |
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 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 | |
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; | |
} ); |
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: WooCommerce Product Feeds : Mark fields as pre-populatable. | |
* Plugin URI: https://www.ademti-software.co.uk/ | |
* Description: Marks fields in the Google Product Feed as pre-populatable. | |
* Author: Ademti Software | |
* Version: 1.0.0 | |
* Author URI: https://www.ademti-software.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 | |
add_filter( 'woocommerce_gpf_feed_item_google', function ( $feed_item, $wc_product ) { | |
$feed_item->additional_elements['custom_label_4'] = [ | |
$wc_product->is_on_sale() ? 'On Sale' : '' | |
]; | |
return $feed_item; | |
}, 10, 2 ); |
NewerOlder