$_GET['product_id'] ); } elseif (isset($_GET['category_id']) && (is_numeric($_GET['category_id']))) { $args[] = array ( 'cat' => $_GET['category_id'] ); } $args['post_type'] = 'wpsc-product'; $args['posts_per_page'] = 9999; $products = query_posts ($args); $self = get_option('siteurl')."/index.php?rss=true&action=product_list$selected_category$selected_product"; header("Content-Type: application/xml; charset=UTF-8"); header('Content-Disposition: inline; filename="E-Commerce_Product_List.rss"'); $output = "\n\r"; $output .= "\n\r"; $output .= " ".get_option('siteurl')."/wp-admin/admin.php?page=".WPSC_DIR_NAME."/display-log.php\n\r"; $output .= " This is the WP e-Commerce Product List RSS feed\n\r"; $output .= " WP e-Commerce Plugin\n\r"; $output .= " \n\r"; foreach ($products as $post) { setup_postdata($post); $purchase_link = wpsc_product_url($post->ID); $output .= " \n\r"; if ($google_checkout_note) { $output .= " Google Checkout\n\r"; } $output .= " <![CDATA[".get_the_title()."]]>\n\r"; $output .= " $purchase_link\n\r"; $output .= " \n\r"; $output .= " ".$post->post_modified_gmt."\n\r"; $output .= " $purchase_link\n\r"; $image_link = wpsc_the_product_thumbnail() ; if ($image_link !== FALSE) { if ($_GET['xmlformat'] == 'google') { $output .= " $image_link\n\r"; } else { $output .= " \n\r"; } } $price = wpsc_calculate_price($post->ID); $args = array( 'display_currency_symbol' => false, 'display_decimal_point' => true, 'display_currency_code' => false, 'display_as_html' => false ); $price = wpsc_currency_display($price, $args); $children = get_children(array('post_parent'=> $post->ID, 'post_type'=>'wpsc-product')); foreach ($children as $child) { $child_price = wpsc_calculate_price($child->ID); if (($price == 0) && ($child_price > 0)) { $price = $child_price; } else if ( ($child_price > 0) && ($child_price < $price) ) { $price = $child_price; } } if ($_GET['xmlformat'] == 'google') { $output .= " ".$price."\n\r"; $google_elements = Array (); $product_meta = get_post_custom ( $post->ID ); foreach ( $product_meta as $meta_key => $meta_value ) { if ( stripos($meta_key,'g:') === 0 ) $google_elements[$meta_key] = $meta_value; } $google_elements = apply_filters( 'wpsc_google_elements', array ( 'product_id' => $post->ID, 'elements' => $google_elements ) ); $google_elements = $google_elements['elements']; $done_condition = FALSE; $done_availability = FALSE; $done_weight = FALSE; if ( count ( $google_elements ) ) { foreach ( $google_elements as $element_name => $element_values ) { foreach ( $element_values as $element_value ) { $output .= " <".$element_name.">"; $output .= ""; $output .= "\n\r"; } if ($element_name == 'g:shipping_weight') $done_weight = TRUE; if ($element_name == 'g:condition') $done_condition = TRUE; if ($element_name == 'g:availability') $done_availability = true; } } if (!$done_condition) $output .= " new\n\r"; if (!$done_availability) { if(wpsc_product_has_stock()) : $product_availability = "in stock"; else : $product_availability = "out of stock"; endif ; $output .= " $product_availability"; } if ( ! $done_weight ) { $wpsc_product_meta = get_product_meta( $post->ID, 'product_metadata',true ); $weight = apply_filters ( 'wpsc_google_shipping_weight', $wpsc_product_meta['weight'], $post->ID ); if ( $weight && is_numeric ( $weight ) && $weight > 0 ) { $output .= "$weight pounds"; } } } else { $output .= " ".$price."\n\r"; } $output .= " \n\r"; } $output .= " \n\r"; $output .= ""; echo $output; exit(); } ?>