Category: Magento

  • Good way to connect database in Phalcon php framework

    Database connection settings can be done by registering services in the container. Here is how we can connect a postgresql database use Phalcon\DI; use Phalcon\Db\Adapter\Pdo\Postgresql as DbAdapter; /** * We can move this config is a separate config file */ $config = new \Phalcon\Config(array( ‘database’ => array( ‘adapter’ => ‘Postgresql’, ‘host’ => “localhost”, ‘username’ =>…

  • Make image to base64 dataUri in NodeJS

    Images are already in server, may be uploaded by multer. now have to make dataUri for s3. var fs = require(‘fs’); var uploadPath = ‘upload/’; var image = ‘blahblah.jpg’; fs.readFile(uploadPath+image, ‘base64’, function(err, data){ if (err) throw err; var type = image.split(‘.’)[1]; //here is the dataUri var dataUri = ‘data:image/’+type+’;base64,’+data; console.log(dataUri); });

  • Change/Override Base Url from local.xml of Magento

    For ‘default’ store Open /app/etc/local.xml Add just before closing tag. https://www.ashrafulabedein.com/ https://www.ashrafulabedein.com/ https://www.ashrafulabedein.com/ https://www.ashrafulabedein.com/

  • Quick Install Apache PHP Mysql for Magento on Ubuntu

    sudo apt-get update sudo apt-get install apache2 sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql sudo mysql_install_db sudo /usr/bin/mysql_secure_installation sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-curl php5-gd

  • Magento re-install module’s install script

    Go to database find table ‘core_resources’ Search for your module and change back your installer version Then reloading any magento page will run installer again

  • Set a value as selected in select dropdown custom admin form in Magento

    I found this in Varien_Data_Form_Element_Select which generates the select option html $fieldset->addField( ‘sample’, ‘select’, array( ‘label’ => ‘Sample Dropdown’, ‘name’ => ‘sample’, ‘class’ => ”, ‘note’ => ”, ‘style’ => ”, ‘values’=> array(1=>’Yes’, 2=>’No’) ) ); Find: with in same form file $form->setValues($values); Add line before: // add this line just before setValues() $values[‘sample’] =…

  • Magento Switch Store by Customer Group

    It’s really nice when you have many customer group and want to show different products to each customer group. This can be done by creating stores in Magento to view different products in each store and dedicate a store for a customer group. On a Multi Store Magento site where you have many customer group…

  • Magento Switch Store by Customer Group

    It’s really nice when you have many customer group and want to show different products to each customer group. This can be done by creating stores in Magento to view different products in each store and dedicate a store for a customer group. On a Multi Store Magento site where you have many customer group…

  • Magento Redirect Category link to CMS page, CMS page in Top menu by URL rewrite management

    Magento Redirect Category link to CMS page, CMS page in Top menu by URL rewrite management

    Sometime I have to add article content page and external url in Magento’s top navigation menu. This can be done without using any third-party extension. I have my own menu extension ready for any projects but when menu is not complex and all themes styling are ready for default navigation I use default Navigation. Magneto…

  • Magento Sort Products by Attribute Set

    To Sort Products by Attribute Set, Update the default toolbar files Mage/Catalog/block/Product/List/Toolbar.php