Page 4 - Magento Tutorial
-
- July 19, 2014
You have created a new entity type and want to display it as a paginated list ?
First, integrate the MagePageBlockHtmlPager through your block :
class Your_Module_Block_Entityname_ListextendsMage_Core_Block_Template {
protectedfunction _construct() {
parent::_construct();
// We get our collection through our model
$this->_entities = Mage::getModel('your_module/entityname')
->getCollection()
->setOrder('created_at');
// Instantiate a new Pager block
$pager =newMage_Page_Block_Html_Pager();
// We set our limit (here an integer store in configuration).
// /!\ The limit must be set before the collection
$pager->setLimit((int)Mage::getStoreConfig('your_module/entityname/pagination'))
->setCollection($this->_entities);
// Add our Pager block to our current list block
$this->setChild('pager', $pager);
}
}ou just need now to include the call in your template (phtml) file :
<divclass="your_module_entities">
<?php foreach($this -
- July 12, 2014
Magento Helpdesk used for customer support . For this magento Customer Support system you customer can create support ticket from magento dashboard . From this extension your customer can create the following ,
For Customer
- Create the ticket .
- Can view list of ticket available by created for you ,
- Customer can replay the the ticket ,
-
- March 31, 2014
AW Blog Report Generation extends used to generate user view AW Blog result count . Following
type of report you can see- Report displayed by Days .
- Report displayed by Month .
- Report displayed by Year .
Features- AW Blog User Visit Report .
- Used to Customer visting interest .
- Help to improve SEO of your Blog post .
Recomented
- Magento 1.7.x or Magento 1.8.x .
- AW Blog Magento Extension .
-
- March 26, 2014
Magento CMS & nBlog Integrated Search extension includes your nBlog blog posts and Magento CMS pages. This extension is useful to make your store more interactive and reduces user bounce rate.
After install extension go to System -> Index Management .
In Index Management check “Rebuild nBlog fulltext search index” click “Reindex Data”if you are not install the supported magento extension nBlog,Samdoit_Portfolio the Search Setting
are look like the following image.After install the supported extension (nblog,samdoit_portfolio) the setting will be look like the following image.
-
- March 26, 2014
WordPress Vtiger Synchronization to synchronize the wordpress user to vtiger user
-
- February 25, 2014
Here is a quick code to get the admin user’s data (id, name, username, email, password, etc).
By admin user, I mean the users that login through the admin panel and those who have access to the admin panel of Magento. The users can be administrator, or with some specific roles.$user = Mage::getSingleton('admin/session')->getData();
$userId = $user->getUser()->getUserId();
$userEmail = $user->getUser()->getEmail();
$userFirstname = $user->getUser()->getFirstname();
$userLastname = $user->getUser()->getLastname();
$userUsername = $user->getUser()->getUsername();
$userPassword = $user->getUser()->getPassword();
Hope this helps.Thanks.
-
- January 30, 2014
Create the Dropbox app use this following url http://www.samdoit.com/news/how-to-create-dropbox-app
Go to your admin panal menu click the menu by
System-->Tools->Multibackup
then click the button called
Check Available Backup
all the already taken bakup files are uploaded to Dropbox what are already linked to this site.
-
- January 23, 2014
Create DropBox app
- Use following link to create new app in DropBox .
-
Create App using following image shown.
Then click the button “Create App” . then you hava a access key and secret look like following image
After Creating DropBox App login to your Magento store admin go to
-
- January 11, 2014
Use of session in Magento:
Let’s start this blog with the session definition, ‘It is a way to preserve certain data across subsequent accesses’. This enables you to build more customized applications and increase the appeal of your web site. Now, Let’s see how to set ,unset and retrieve a session in Magento.Generally, Magento session is handled by core Module ‘core/session’. We use “set<session name>” to set a session variable. For more understanding, look on to the following syntax and example.
Mage::getSingleton(‘core/session’)->set<YOUR SESSION NAME>(<VARIABLE NAME>);
Example :
$myValue =’test’;
Mage::getSingleton(‘core/session’)->setMyValue($myValue);In this example, I have declared the variable $myValue as “test”. I am going to set this variable in session. To do so, I have used the default syntax of the Magento in line 2. Now the session variable is set in the magento.Wow, its easy to set the session variable.
Let’s now look, how to get value from the session variable
-
- January 11, 2014In this blog we will see advanced operations in model and collection, to execute complex sql queries. We will look into collections and details of resource models.
First let’s look at model and collection architecture in magento. If you look at a magento model class it extends Mage_Core_Model_Abstract which intern extends Varien_Object.The class Mage_Core_Model_Abstract has function like getId(), load(), save(), delete() etc .
SQL and Mysql4 Resource FilesMysql4 resource files, as I mentioned earlier are used to perform database queries on tables. Below will list how we do sql operations inside resource files.
SELECT QUERY
Suppose we have the file Excellence_Test_Model_Mysql4_Test resource file.
<?php class Excellence_Test_Model_Mysql4_Test extends Mage_Core_Model_Mysql4_Abstract { public function _construct() { $this->_init('test/test', 'test_id'); } public function loadByField($field,$value){ $table = $this->getMainTable(); $where = $this->_getReadAdapter()->quoteInto("$field