Magento - How to assign a product to a Category and It's parent categories

Posted by Damodar Bashyal on July 12, 2012

 

We not only created a lot of new categories, we deleted a lot of old categories and renamed some of them as well. Now the issue was to correctly assigning products to appropriate categories. We were provided product csv with three columns (category,sku,category-code). category-code was for SAP admins, so they can update their inventory according to code. But we need other two columns only. Here is the shell script I wrote which runs smoothly and does the work for me :-)

More»

Magento - How to assign simple products to configurable programmatically?

Posted by Damodar Bashyal on July 10, 2012

 

Some of our simple products were not correctly assigned to a configurable product. And, some of them were visible independently in the front end. My task was to assign simple products to correct configurable product and make associated products to not visible individually. It was easy to find configurable product and associated simple products because of the SKU they had. All simple products had sku configurableSKU__*.

So after some trials this code worked for me.

More»

Magento Add Admin User through programming code

Posted by Damodar Bashyal on April 25, 2012

 

We got a new magento project which was developed by another web development company and it wasn't finished. Client didn't have admin details but he had FTP details. He didn't know about control panel url, so couldn't access phpMyadmin. Instead of going back and forth with client about details, I wrote this code, so I could create admin user myself and access the admin.

I think it will be a good idea to create new admin user for every single admin user including developers, so if one developer quits we can just delete the user and don't need to worry about changing passwords again and again.

More»