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->additional_elements['product_type'] here, e.g. | |
$feed_item->additional_elements['product_type'] = [ | |
'Product ID ' . $product->get_id(), | |
]; | |
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 | |
add_filter( 'crfwp_discount_code_expiry_options', function( $options ) { | |
$options['864000'] = array( | |
'value' => '864000', // Length discount code is valid for (in seconds) | |
'selected' => '', // Leave blank | |
'description' => __( 'Ten days', 'crfwp' ), // Description of discount edpiry period | |
); | |
return $options; | |
} ); |
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) { | |
// Modify the query args here. | |
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 | |
add_filter( 'woocommerce_gpf_include_variations', function ($include_variations, $wc_product) { | |
// Return true if you want to include variations for this $wc_product | |
// Return false if you do not want to include variations for this $wc_product | |
// Return $include_variations to honour the standard behaviour according to the extension settings. | |
return $include_variations; | |
}, 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 | |
add_filter( 'woocommerce_gpf_store_info', function ( $store_info ) { | |
// Modify store info properties here. | |
return $store_info; | |
} ); |
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_elements_google', function ( $elements, $general_id, $specific_id ) { | |
// Customise/add $elements['google_product_category'] here. e.g. | |
// $elements['google_product_category'] = [ 'My actual category' ]; | |
return $elements; | |
}, 10, 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: Language-specific replacements for Say What? Pro | |
* Plugin URI: https://plugins.leewillis.co.uk/ | |
* Description: Enables language-specific replacements in the Say What? Pro plugin | |
* Version: 1.0 | |
* Author: Ademti Software Ltd | |
* 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_action( 'init', function () { | |
global $woocommerce_msrp_frontend; | |
remove_action( | |
'woocommerce_single_product_summary', | |
[ $woocommerce_msrp_frontend, 'show_msrp' ], | |
7 | |
); | |
add_action( |
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: Mark GPF fields as pre-populatable | |
* Plugin URI: http://docs.woothemes.com/document/google-product-feed/ | |
* Description: Example of how to mark a field as pre-populatable in the Google Product Feed plugin. | |
* Version: 1.0 | |
* Author: Ademti Software | |
* Author URI: https://www.ademti-software.co.uk/ | |
*/ |