Magento 2.0 what’s cooking up?

Magento
Much like the outside world, the world of internet is not devoid of its share of controversies and mysteries. Application development organizations in a bid to market their new product try to create hype and mystery before its launch. For them it might be a marketing gimmick, but it provides cannon fodder to the media to further fuel the fire and ignite the internet with a new sensational story and in the process the newly launched product becomes popular.   Magento 2.0 which is an open source CMS tool for managing content for ecommerce websites has been in the new since 2010, when it was announced to be released in 2011. But in 2011, Magento was acquired by eBay and the reorganization process took its toll on the release and…
Read More

Override Magento Admin Controller

Magento
When you use magento sometime need to customize some admin core functionality based on requirement. If you want to change core functionality of any controller so you need to override controller action with your controller action. Learning how to perform this action may be helpful to those who have computer forensics degrees. how to override magento admin controller action This example to show you override edit action from ProductController.php is located app/code/core/Mage/Adminhtml/controllers/Catalog Step 1: Create new module from app/etc/Justwebdevelopment_Overridecontroller.xml [sourcecode language="plain"] <?xml version="1.0"?> <config> <modules> <Justwebdevelopment_Overridecontroller> <active>true</active> <codePool>local</codePool> </Justwebdevelopment_Overridecontroller> </modules> </config> [/sourcecode] Step 2: Make config.xml from app/code/local/Justwebdevelopment/Overridecontroller/etc/config.xml [sourcecode language="plain"] <?xml version="1.0"?> <config> <modules> <Justwebdevelopment_Overridecontroller> <version>0.0.1</version> </Justwebdevelopment_Overridecontroller> </modules> <admin> <routers> <adminhtml> <args> <modules> <Justwebdevelopment_Overridecontroller before="Mage_Adminhtml">Justwebdevelopment_Overridecontroller</Justwebdevelopment_Overridecontroller> </modules> </args> </adminhtml> </routers> </admin> </config> [/sourcecode] Using above code you want to override any…
Read More

Get Magento URL and Path

Magento
When you work or develop magento site so many places you need to some magento URL. Magento URL and magento path is very helpful to make development easy. When you want to create magento static block and you want to show some image or set any page link then you need to set exact path for that. Maegnto provide some basic path or URL by default. Here I want to show you magento path and URL. Use magento URL in static block get SKIN URL [php]{{skin url='images/sampleimage1.png'}}[/php] get Media URL [php]{{media url='/sampleimage1.png'}}[/php] get Store URL [php]{{store url='contact.html'}}[/php] get Base URL [php]{{base url='yourstore/contact.html'}}[/php] Use magento URL path in PHTML get Homepage URL [php]<?php $home_url = Mage::helper('core/url')->getHomeUrl(); ?>[/php] Or check current page is homepage [php]<?php if( Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() ==…
Read More

How to create custom module in magento

Magento
Magento is best eCommerce system now a days which is offering rich customization possibilities by extensions and modules. Magento is built on a fully modular model that influences an unlimited scalability and flexibility for your store. Make Custom Module Magento There are many things custom modules can do, from editing your Database, to handling module upgrades to overriding classes (Blocks, Controllers, Models) ... and more! Magento is an open source solution. So you can write new modules for Magento by yourself. Here I want to show you how to create simple costume module magento. In Magento all modules are organized under a package. This package is nothing but a simple folder under codepool containing different modules. For example all core modules of magento system is kept under package "Mage" (open…
Read More

Get attribute name and value magento

Magento
In magento you can create as many custom attributes for your products as you want.Suppose you want to add or display brand color for every product on home, category or product page. So this is very easy to do with custom attributes. If we were to create a new custom attribute called "brand_color" and the attribute was of a "Text Field" type, we could do something like the following at a product level to obtain its value. [php]<?php echo $_product->getBrandColor(); ?>[/php] Get attribute collection [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute'); ?>[/php] Get attribute type [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getAttributeType(); ?>[/php] Get attribute Label [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getFrontendLabel(); ?>[/php] Attribute is visible or not [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getIsVisible(); ?>[/php] Attribute is required [php]<?php $attribute = $_product->getResource()->getAttribute('my_attribute')->getIsRequired(); ?>[/php] Get attribute value [php]<?php $attributeValue = Mage::getModel('catalog/product')->load($_product->getId())->getMyAttribute();?>[/php]…
Read More

Excute custom query in magento

Magento
Magento has provide us very good features for handling or interacting with Database tables. Magento give all the data by default but some time we need to get or insert some custom data.So for this we need to write custom query. Database Connections In Magento [php] <?php // fetch read database connection that is used in Mage_Core module $read= Mage::getSingleton('core/resource')->getConnection('core_read'); // fetch write database connection that is used in Mage_Core module $write = Mage::getSingleton('core/resource')->getConnection('core_write'); ?> [/php] How to excute custom query in magento [php] <?php // fetch read database connection that is used in Mage_Core module $read= Mage::getSingleton('core/resource')->getConnection('core_read'); $value=$read->query("SELECT ...."); $row = $value->fetch(); echo "<pre>";print_r($row);echo "</pre>"; // As Array ?> [/php] Insert custom data in magento tabel [php] <?php // fetch write database connection that is used in Mage_Core module…
Read More

Magento Bug Call to a member function loadPriceData

Magento
Magento 1.5.0.1 Bug: Call to a member function loadPriceData() on a non-object Please do follow steup for solve this error: Open app\code\core\Mage\Catalog\Model\Product\Attribute\Backend\Tierprice.php Comment out lines from 202 to 219 Error:Fatal error: Call to a member function loadPriceData() on a non-object in E:\wamp\www\magento\app\code\core\Mage\Catalog\Model\Product\Attribute\Backend\Tierprice.php on line 202 [php] <?php /* $data = $this->_getResource()->loadPriceData($object->getId(), $websiteId); foreach ($data as $k => $v) { $data[$k]['website_price'] = $v['price']; if ($v['all_groups']) { $data[$k]['cust_group'] = Mage_Customer_Model_Group::CUST_GROUP_ALL; } } if (!$object->getData('_edit_mode') && $websiteId) { $rates = $this->_getWebsiteRates(); $full = $data; $data = array(); foreach ($full as $v) { $key = join('-', array($v['cust_group'], $v['price_qty'])); if ($v['website_id'] == $websiteId) { $data[$key] = $v; $data[$key]['website_price'] = $v['price']; } else if ($v['website_id'] == 0 && !isset($data[$key])) { $data[$key] = $v; $data[$key]['website_id'] = $websiteId; if ($object->getPriceModel()->isTierPriceFixed()) { $data[$key]['price'] = $v['price'] * $rates[$websiteId]['rate']; $data[$key]['website_price'] =…
Read More