Edit code in magento plug-in for magmi

The plugin below will disable product not listed in Magmi's csv file catalog-wide, I want to limit it to only category-wide, that means, if im loading category 1, all other categories wont be affected (disabled). Modify code below to only disable products in categories on csv file


class Magmi_ItemdisablerPlugin extends Magmi_ItemProcessor


protected $datasource_skus = array();

public function getPluginInfo()


return array("name"=>"Magmi Magento Item Disabler",

"author"=>"Axel Norvell ([url removed, login to view])",



public function afterImport()


$this->log("Running Item Disabler Plugin","info");


return true;


public function getPluginParams($params)


return array();


public function isRunnable()


return array(true,"");


public function initialize($params)



public function processItemAfterId(&$item,$params=null)




$this->datasource_skus[] = $item['sku'];



public function disableItems()


if(count($this->datasource_skus) <= 0)


$this->log('No items were found in datasource. Item Disabler will not run.', "info");

return false; /* Nothing to disable */


//Setup tables

$ea = $prefix!=""?$prefix."eav_attribute":"eav_attribute";

$eet = $prefix!=""?$prefix."eav_entity_type":"eav_entity_type";

$cpe = $prefix!=""?$prefix."catalog_product_entity":"catalog_product_entity";

$cpei = $prefix!=""?$prefix."catalog_product_entity_int":"catalog_product_entity_int";

//Get "status" attribute_id

$status_attr_id = "

SELECT ea.attribute_id FROM $ea ea

LEFT JOIN $eet eet ON ea.entity_type_id = eet.entity_type_id

WHERE ea.attribute_code = 'status'

AND eet.entity_type_code = 'catalog_product'";

$result = $this->selectAll($status_attr_id);

if (count($result) == 1) {

$attribute_id = $result[0]['attribute_id'];



//Get all active items

$sql = "SELECT [url removed, login to view], e.entity_id FROM $cpei i


e.entity_id = i.entity_id

WHERE attribute_id=?

AND [url removed, login to view] = 1";

$all_magento_items = $this->selectAll($sql, array($attribute_id));

//Setup the magento_skus array for easy processing.

$magento_skus = array();

foreach($all_magento_items as $item)


$this->log("{$item['sku']} found in Mage", "info");

$magento_skus[$item['sku']] = $item['entity_id'];


//process the array, move anything thats in the datasource.

foreach($this->datasource_skus as $sku)









foreach($magento_skus as $sku => $id)


$this->log("Disabling Item Id $id with SKU: $sku", "info");


UPDATE $cpei i


e.entity_id = i.entity_id


WHERE attribute_id = ?

AND [url removed, login to view] = 1

AND e.sku=?", array($attribute_id, $sku));





//If the Datasource contains all Magento's items.

$this->log('All items present in datasource. No items to disable.', "info");




Skills: Magento, PHP, SQL

See more: magento plug, prefix function, loading function in php, setup product catalog with, modify code, mage processing, axel, status code, update status code, magento extends, edit magento products, plugin catalog, php class found, update code sql, cpe, magento update product php, magento catalog items, csv magmi, class log found, magento status, magento category name category, update csv file products, code status, name category magento, magmi csv file

About the Employer:
( 9 reviews ) Monterrey, Mexico

Project ID: #6090568

12 freelancers are bidding on average $124 for this job


Hello, We read your project, we can do it. We are a web design, web development company. We are developing outsourcing market and we always try to continue widening the ArrowHiTech reputation on this market and we have More

$206 USD in 2 days
(397 Reviews)

Hello, Here are Magento Experts , please check Our Latest Magento work In PMB For Our Experience and skills Regarding Magento projects and Let me start your work , 1. Easy access on IMs like Gtalk, Skype, Yahoo a More

$105 USD in 1 day
(137 Reviews)

Hello There Greetings of the Day! We have reviewed your requirement and understood it very well. we would like to quote down some sample of our work so that you can have an idea about working proficiency. http: More

$54 USD in 2 days
(109 Reviews)

Hi slgarza. I worked with Magmi and understand your requirement.

$44 USD in 3 days
(193 Reviews)

Dear Sir, We claim to get it done perfectly for you EXACTLY in the way you want it - Kindly give we a chance and we will prove myself - Ready to prove our words, let's get it done right away and I mean RIGHT AWAY !! More

$126 USD in 3 days
(81 Reviews)

Hi sir, Thank you for giving opportunity for biding... we have gone through your requirements and we can Edit code in magento plug-in for magmi according to your exact requirements. Please Before Awarding this p More

$315 USD in 6 days
(45 Reviews)

Dear Project Owner, Hope you are doing great!! First & foremost, Thanks for submitted this job :) I am ready to start working on this project right away. Please ping at freelancer messenger, ready to help you i More

$54 USD in 0 days
(45 Reviews)

Greetings Employer, We could easily able to develop your Extension similar to your needs, we are already expert in that and done with many similar customized Extensions, please check out some of our already devel More

$421 USD in 5 days
(5 Reviews)

Hi! My name is Olga I'm project coordinator at 4 DCode- 5 years experienced team which specialised in Magento solutions. We also develop and customized Magento modules and CMS based web-resources. We can disable pr More

$54 USD in 1 day
(2 Reviews)

Hi. I'm professional web developer. I have been developing web applications for almost 10 years. I have experiences in developing several web applications in several languages. I'm new here, so I don't want hig More

$30 USD in 1 day
(1 Review)

We are '3stechmind' team of dedicated software professionals developing the web projects for our [login to view URL] area of expertise is design the web site and implement the functional aspects in software technolgies like ph More

$24 USD in 1 day
(2 Reviews)

this is my first project i will do this project like professional work that will make my reputation. i have talent in this field but i want to prove [login to view URL] way good luck.

$50 USD in 8 days
(0 Reviews)