Search the Wiki

Viewing 41 to 50 of 233 items

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…

0

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…

1

CentOS 7 – Install latest Nginx, Mariadb, PHP 5.6

Setup Nginx server with latest Mariadb and latest PHP 5.6 CentOS 7 (with root user) Step 1: Installing Remi Repository # yum update && yum install epel-release # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm Install locate function to find the location of files # yum install mlocate # updatedb Install Vim to edit file easily # yum install  Full Article…

0

Centos – Nginx, PHP5-FPM and Permission Denied Errors

If you see the errors like the following: 2017/05/03 13:27:41 [crit] 4202#0: *1 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: xx.xxx.xx.xx, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "xx.xx.xx.xx" You can fix that issue by updating /etc/php5/fpm/pool.d/www.conf and set the listen.mode to 666 (remember to uncomment the line as well): listen.mode  Full Article…

0

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…

3

Magento – URL Rewriting Tutorial

How to manage URL rewriting in Magento Search engine friendly URLs improve the indexing and ranking of your site, make it easier for people to come across your site when searching through search engines for particular keywords, and generally are easier to remember and improve the navigation on your site. When you add a product  Full Article…

0

Install Latest Apache, MySQL, MariaDB, and PHP on RHEL/CentOS 7/6 & Fedora 24-18

This how-to guide explains how to install the latest version of the Apache 2.4, MariaDB/MySQL 5.5, and PHP 5.5/PHP 5.6 along with the required PHP modules on RHEL / CentOS 7/6 and Fedora 18-24. Install Apache, MySQL/MariaDB and PHP on CentOS/RHEL/Fedora This combination of operating system (Linux) with web server (Apache), database server (MariaDB/MySQL) and server-side scripting language (PHP) is known as  Full Article…

0

Magento – Login Into Multiple Website Store

Problem Case: The problem we are trying to solve here is, suppose you have multiple magento website setup on different domains on the same magento instance, and you want that if a customer login’s on any one our your site he is gets logged into all other sites as well. Solution: The solution for this  Full Article…

2

Magento – Product Collection

In this blog, we will see some important function in magento product collection class. Product Collection class in magento is Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection. Lets look at the important functions Get All Products of a category 1 2 3 $collection = Mage::getResourceModel('catalog/product_collection')             ->setStoreId($this->getStoreId())             ->addCategoryFilter($category); Tn this the addCategoryFilter() function, is used to get all products of a particular  Full Article…

0