Plugin Directory

Changeset 1148743


Ignore:
Timestamp:
04/29/2015 06:36:58 AM (11 years ago)
Author:
elsteno
Message:

some fixes

Location:
woocommerce-better-feeds/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-better-feeds/trunk/readme.txt

    r1148716 r1148743  
    44Requires at least: 4.0.
    55Tested up to: 4.2
    6 Stable tag: 1.0.0
     6Stable tag: 1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3636== Changelog ==
    3737
    38 = 1.0.0 =
     38= 1.1 =
     39* Some fixes
     40
     41= 1.0 =
    3942* First Release
     43
  • woocommerce-better-feeds/trunk/woocommerce-better-feeds.php

    r1148716 r1148743  
    44Plugin URI: http://www.limeframe.gr/wpplugins/woocommerce-better-feeds
    55Description: Add Featured Image and Price to woocommerce rss feeds
    6 Version: 1.0
     6Version: 1.1
    77Author: Giannopoulos Konstantinos
    88Author URI: http://www.limeframe.gr
     
    2727
    2828
     29function getRssProductPrice() {
     30    global $post;
     31    $product = new WC_Product( $post->ID );
     32    $theproductprice = $product->price;
     33    return $theproductprice;
     34}
    2935
    3036function wcbfeedAddImageToContent($content) {
    3137    $wcbfeed_rss_image_size = get_option('wcbfeed_rss_image_size');
    3238    global $post;
    33     if ( has_post_thumbnail( $post->ID ) ){
    34         $content = '' . get_the_post_thumbnail( $post->ID, $wcbfeed_rss_image_size, array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content;
     39    if(get_option('wcbfeed_rss_export_image')==1) {
     40        if ( has_post_thumbnail( $post->ID ) ){
     41            $content = '' . get_the_post_thumbnail( $post->ID, $wcbfeed_rss_image_size, array( 'style' => 'float:left; margin:0 15px 15px 0;' ) ) . '' . $content;
     42        }
     43    }
     44    if(get_option('wcbfeed_rss_export_price')==1) {
     45        $content = '<br>Price:' . getRssProductPrice() . '<br>' . $content;
    3546    }
    3647    return $content;
     
    4253
    4354
    44 function addImageUrlToCustom() {
     55function addImageUrlToCustomTag() {
    4556    global $post;
    4657    $theproductimage = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'medium' );
     
    4859}
    4960
    50 function getRssProductPrice() {
    51     global $post;
    52     $product = new WC_Product( $post->ID );
    53     $theproductprice = $product->price;
    54     return $theproductprice;
    55 }
     61
    5662
    5763add_action('rss_item','wcbfeedAddExtraItems');
     
    6672<?php } ?>
    6773<?php if(get_option('wcbfeed_rss_export_image')==1) { ?>
    68 <image><?php echo addImageUrlToCustom();?></image>
     74<image><?php echo addImageUrlToCustomTag();?></image>
    6975<?php } ?>
    7076</product>
Note: See TracChangeset for help on using the changeset viewer.