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
function wppfm_shortcoder_support( $attributes, $feed_id, $product_id ) { | |
if ( has_custom_field( $attributes['description'] ) ) { | |
$description = $attributes['description']; | |
$attr = [ 'name' => get_shortcode_name_from_description( $description ) ]; | |
//parse shortcodes do_shortcode | |
$attributes['description'] = process_product_shortcode( $attr, $description, $product_id ); | |
} |
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 wppfm_product_category_string_gets_full_category_path( $data, $feed_id, $product_id ) { | |
$data['product_type'] = WPPFM_Taxonomies::get_shop_categories( $product_id, ' > ' ); | |
// Always return data! | |
return $data; | |
} | |
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 alter_feed_item( $attributes, $feed_id, $product_id ) { | |
// Strip from description attributes | |
$attributes['description'] = str_replace(' ', ' ', $attributes['description']); | |
// IMPORTANT! Always return the $attributes | |
return $attributes; | |
} |
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
/** | |
* | |
*/ | |
function wppfm_add_taxonomy_data_to_feed( $data, $feed_id, $product_id ) { | |
// Get the product_badges taxonomy data. | |
$taxonomyName = 'product_taxonomy_data'; // use the name of your own taxonomy | |
$taxonomyData = wp_get_post_terms( $product_id, $taxonomyName ); | |
if ( $taxonomyData ) { |
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 string_uppercase_title( $attributes, $feed_id, $product_id ) { | |
// this line changes the title data and removes the " <prompt> " string | |
$attributes['title'] = ucwords(strtolower($attributes['title'])); | |
// IMPORTANT! Always return the $attributes | |
return $attributes; | |
} |
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 | |
// change the separator in the custom CSV builder from wpmarketingrobot | |
function change_csv_separator() { | |
return ';'; //return the separator you want. | |
} | |
add_filter( 'wppfm_csv_separator', 'change_csv_separator' ); |
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 remove_some_products_from_the_queue( $products, $feed_id ) { | |
// Products to remove from the feed | |
$products_to_remove = array( | |
'20890', | |
'20891', | |
'20972', | |
); |
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 | |
// Price including or excluding tax | |
function tax_price( $data, $feed_id, $product_id ) { | |
global $product, $woocommerce; | |
// Only add this to the feed with id 58 | |
// change the number to the feed you want to affect the prices. | |
// OR remove the if statement if you want to affect all feeds | |
if($feed_id == 1){ |
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 exclude_list_from_feed( $attributes, $feed_id, $product_id ) { | |
//Array with the numbers from products we want te exclude | |
$exclude_array = array(13608, 13632, 16123, 16405); | |
if (in_array($attributes['id'], $exclude_array,) == false ) | |
{ | |
// Return the $attributes from products not in the exclude list |
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 | |
// MPN shortcode function | |
function wppfm_brand_shortcode() { | |
// get MPN value. | |
//$r = get_post_meta( $post->ID, 'wppfm_product_brand', true ); | |
$r = get_post_meta( get_the_ID(), 'wppfm_product_brand', true ); | |
// return MPN | |
return $r; |