Search the Wiki

Viewing 211 to 219 of 219 items

Install and upgrade custom module in Magento

Magento automatically installs or upgrades any module that it encounters during runtime. The installation files are located under YourModule/sql/yourmodule_setup/mysql4-install-X.Y.Z.php. The trigger for running this file is that your module’s version number is not present in the DB table `core_resource` and that you have defined a version number in your module’s etc/config.xml file. You will also  Full Article…

0

Understanding block type in magento

core/template: This block renders a template defined by its template attribute. The majority of blocks defined in the layout are of type or subtype of core/template. page/html: This is a subtype of core/template and defines the root block. All other blocks are child blocks of this block. page/html_head: Defines the HTML head section of the  Full Article…

0

Get Product ID and Product Name in Magento

In Magento eCommerce while working with catalog model, There arise the need to fetch product details from product id. We can get all product details if we have product id. But sometimes we only have product name, so we need to get product id for getting product details. I am listing here both the method.  Full Article…

0

Getting url in .phtml files

Get Url in phtml files 1. Get Base Url :   Mage::getBaseUrl();   2. Get Skin Url :   Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);   (a) Unsecure Skin Url :   $this->getSkinUrl('images/imagename.jpg');   (b) Secure Skin Url :   $this->getSkinUrl('images/imagename.gif', array('_secure'=>true));   3. Get Media Url :   Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);   4. Get Js Url :   Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);   5. Get  Full Article…

0

Check current page is home page or not

Using the code below to check current page is home page or not. <?php if( Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' ) : ?> //insert your code here <?php endif; ?>

0

How To Create a New User and Grant Permissions in MySQL

How to Create a New User In Part 1 of the MySQL Tutorial, we did all of the editing in MySQL as the root user, with full access to all of the databases. However, in the cases where more restrictions may be required, there are ways to create users with custom permissions. Let’s start by making  Full Article…

0

Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite()…

Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website SET FOREIGN_KEY_CHECKS=0; UPDATE `core_store` SET store_id = 0 WHERE code=’admin’; UPDATE `core_store_group` SET group_id = 0 WHERE name=’Default’; UPDATE `core_website` SET website_id = 0 WHERE code=’admin’; UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code=’NOT LOGGED IN’; SET FOREIGN_KEY_CHECKS=1;

0