E
E
Eduard Valeev2019-09-09 15:54:21
RSS
Eduard Valeev, 2019-09-09 15:54:21

How to set Woocommerce to include products in RSS when the price changes?

I set up RSS on the site in such a way that, in addition to content, images are also fasted. I share the code with a respected community (suddenly someone will come in handy):

function thumbs_in_rss($content) {
  global $post;
  if(has_post_thumbnail($post->ID)){
    $thumb = get_the_post_thumbnail( $post->ID, 'full' );
    $content = preg_replace("/<img[^>]+\>/i", "", $content);
    $content = $thumb . $content;
  }
  //return $content;
  return mb_convert_encoding($content, 'utf-8', mb_detect_encoding($content));
}
 
add_filter('the_excerpt_rss', 'thumbs_in_rss');
add_filter('the_content_feed', 'thumbs_in_rss');

Thus, we broadcast goods on vk, fb and ok social networks.
Now a question has arisen.
Some products may undergo changes - for example, the description, picture, or, importantly, the price of the product has changed.
There was a need to put this product in the RSS queue as a new item in order for this product to be republished in social networks.
How to do this, tell me, please.
Nobody canceled the donation system;)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question