Thanks everyone, I got the answer. Instead of using Rules, I created a "custom feeds module."
Steps:
Create a folder named "custom_feeds"
Create two files, one is "custom_feeds.info", another is "custom_feeds.module"
Create a folder named "custom_feeds"Add following information in the .info file:
Create two files, one is "custom_feeds.info", another is "custom_feeds.module"; $Id: $ name = custom feeds module description =custom feeds module core = 7.x package = Feeds dependencies[] = feeds
Add following code in the .module file inside '<'?php?>':
Add following information in the .info file:function custom_feeds_feeds_presave(FeedsSource $source, $entity, $item) { // check that this is fired only for the importer being used if($source->importer->id=='recommended_product_import'){ // "equivalent" is the column name in excel sheet if(!strcmp($item['equivalent'],"")){ $entity->feeds_item->skip = TRUE; } } }
name = custom feeds module
description =custom feeds module
core = 7.x
package = Feeds
dependencies[] = feeds</code>
- Add following code in the .module file inside
<?php ?>
:
function custom_feeds_feeds_presave(FeedsSource $source, $entity, $item) {
// check that this is fired only for the importer being used
if($source->importer->id=='recommended_product_import'){
// "equivalent" is the column name in excel sheet
if(!strcmp($item['equivalent'],"")){
$entity->feeds_item->skip = TRUE;
}
}
}