WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Featured Product Images In RSS Feed (1 post)

  1. syrus33
    Member
    Posted 1 year ago #

    As the topic suggests it appears that woocommerce lacks this feature (unless im missing something) - and images help sell products.

    Does anyone know of a way to insert the products image into the rss feed?

    Below is the code from woocommerce-functions.php

    /**
     * Products RSS Feed.
     *
     * @access public
     * @return void
     */
    function woocommerce_products_rss_feed() {
        // Product RSS
        if ( is_post_type_archive( 'product' ) || is_singular( 'product' ) ) :
    
            $feed = get_post_type_archive_feed_link( 'product' );
    
            echo '<link rel="alternate" type="application/rss+xml"  title="' . __('New products', 'woocommerce') . '" href="' . $feed . '" />';
    
        elseif ( is_tax( 'product_cat' ) ) :
    
            $term = get_term_by('slug', get_query_var('product_cat'), 'product_cat');
    
            $feed = add_query_arg('product_cat', $term->slug, get_post_type_archive_feed_link( 'product' ));
    
            echo '<link rel="alternate" type="application/rss+xml"  title="' . sprintf(__('New products added to %s', 'woocommerce'), urlencode($term->name)) . '" href="' . $feed . '" />';
    
        elseif ( is_tax( 'product_tag' ) ) :
    
            $term = get_term_by('slug', get_query_var('product_tag'), 'product_tag');
    
            $feed = add_query_arg('product_tag', $term->slug, get_post_type_archive_feed_link( 'product' ));
    
            echo '<link rel="alternate" type="application/rss+xml"  title="' . sprintf(__('New products tagged %s', 'woocommerce'), urlencode($term->name)) . '" href="' . $feed . '" />';
    
        endif;
    }

    http://wordpress.org/extend/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic