Showing posts with label module. Show all posts
Showing posts with label module. Show all posts

19 Jan 2014

Magento: Creating custom attribute using sql setup in custom module

/* Magento: Creating custom attribute using sql setup in custom module */
Here I am going show how to create a simple product attribute programatically.I have created a simple script which is creating the product attribute when I do install my module or upgrade my module.So please look at the below code which I have created.

11 Nov 2013

Magento: Setup Cron Jobs In Custom Module



Sometimes in magento we need some task to be run , i.e. these tasks/actions need to be performed periodically like:………….  

- Refreshing Catalog Price Rules
- Sending Newsletters to customers
- Generating Google Sitemaps and submitting it to Google
- Sending Customer Notification about product price change or product back in stock
- Updating currency rates
- Making backups
- Cleaning logs 



7 Nov 2013

Magento: Speedy Attribute Updates

Generally for updating our attribute value in admin we do like :


Magento : Get Attribute Set Name And Category Name By Product Id

Please follow the below code How to get attribute set name and Product's category name :



6 Nov 2013

Magento: Using Or And And Query Condition To Collection

Please check the below details how we can use AND and OR query condition in magento collection.
Product collection :



5 Nov 2013

Magento: Get Product By Sku

Suppose I have a product object called $product and I want get all the information of that product with reference to SKU .So for that I need to do like below coding.

2 Nov 2013

Magento: Use Mysql Functions With Addexpressionattributetoselect

Function addExpressionAttributeToSelect as defined in Mage_Eav_Model_Entity_Collection_Abstract (/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php) allows us to use MySQL functions in Magento collection. Here is an example of using MYSQL IN() clause in magenot more product collection at once :

31 Oct 2013

Magento: How To Select, Insert, Update, And Delete Data?

Suppose, I have a database table named ‘test‘ with the following fields:-
id : int, auto increment, primary key
title : varchar
content : text
status : 1
Suppose, I have a module named ‘mytest‘. Here follows the code to select, insert, update, and delete data from the ‘test‘ table.