I have created the custom attribute (test) for products as a text field with default value('test') from admin panel And assign that attribute to default attribute set. Now I can able to see the new custom attribute in product edit page. When I try to filter with the product collection Mage::getModel('catalog/product')->getCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('test', array('like' => 'test'))->getData(); It returns the Full Article…
Magento – Filter product collection by special price
To create a new page with products have special price only, you need to create a new block that filters discounted products. Let’s create this file, Special.php in local/Mage/Catalog/Product/Block/ directory. You will have to create this directory path if it’s not already there. Using below code to create new block <?php class Mage_Catalog_Block_Product_Special extends Mage_Catalog_Block_Product_List Full Article…
ErrorException: proc_open(): fork failed – Cannot allocate memory in phar
If you see the errors like that ErrorException: proc_open(): fork failed – Cannot allocate memory in phar:///var/www/workspace/MyProject/build/composer/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php on line 943 Call Stack: 0.0523 765208 1. {main}() /var/www/workspace/MyProject/build/composer/composer.phar:0 0.0528 763216 2. It means your server doesn't have enough memory for composer executes their commands. You can solve it by upgrading your server or you can create Full Article…
Jquery – Start FancyBox on page load without clicking
When you want to open a popup on page load without click by using Fancybox, you can use this script: window.jQuery(document).ready(function() { $.fancybox.open('#popup_box'); }); Hope it will help ^^
Magento – Get the last added product and cart items
This code will show you how to get the product id of the last product that was added to the shopping cart, and all the products currently in the shopping cart. $productID=Mage::getSingleton('checkout/session')->getLastAddedProductId(true); echo $productID."<br>"; $_product=Mage::getModel('catalog/product')->load($productID); echo $_product->getName()."<br>"; $session= Mage::getSingleton('checkout/session'); foreach($session->getQuote()->getAllItems() as $item) { $productID = $item->getProductId(); $productSku = $item->getSku(); $productName = $item->getName(); $productQty = $item->getQty(); Full Article…
Magento – Set the default direction or ordering for category-pages
On Magento category-pages you can select how to view the available products: By price, name or relevance, and ascending or descending. Within the Magento backend, the default ordering (price, name or relevance) can be configured but strangely enough the default direction (ascending or descending) not. Here is a XML layout update that allows you to Full Article…
Ubuntu – Assign static name for partitions
If you are running Linux system and you have an additional disk in your computer, you can see that the partion name will change after you reboot your operating system. That's issue is not good for users who want to have a static link of those partitions. Here is the solution to resolve your problem. Full Article…
Magento – Abandoned carts report doesn’t work
Solutions: Yes this is known bug caused by the middle name attribute in recent versions of Magento. Here is the solution for this issue, we need to insert records for middle name attribute for old customers, here is the script to update database table require 'app/Mage.php'; Mage::app('default'); $db_read = Mage::getSingleton('core/resource')->getConnection('core_read'); $tablePrefix = (string) Mage::getConfig()->getTablePrefix(); Full Article…
Centos – Install latest GIT version
I found this nice and easy-to-follow guide on how to download the GIT source and compile it yourself (and install it). If the accepted answer does not give you the version you want, try the following instructions: http://tecadmin.net/install-git-2-0-on-centos-rhel-fedora/ (And pasted/reformatted from above source in case it is removed later) Step 1: Install Required Packages Firstly we Full Article…
Apache and httpd running but I cant see my website
If you have installed apache on my server however you can not browse your website through your server's IP. Here is some reasons: firewall, iptables configuration apache listen address / port More information is needed about your configuration. What distro are you using? Can you connect via 127.0.0.1? If the issue is with the firewall/iptables, you Full Article…