Adding Store Email Addresses to Magento 1 | Magento. How to edit store emails

Magento 1.6 uses three pre-defined email addresses in certain situations. By default, you can specify the General Contact, Sales Representative, and Customer Support email addresses. Each address has the default sender name and email address when you initially install your store. You’ll want to update these to your own email addresses during the configuration of […]

delete duplicate simple product with same attribute from a configurable product in CSV

Import configurable csv to a mysql database table then try to use bellow sql query which give you the duplicate simple product with same attribute values. delete from `table_1` where sku in ( select sku from ( SELECT `sku` FROM `table_1` Group BY `orientatie`,`material`,`papier`,`paginas`,`paper_type_cover`,`veredeling_omslag`,`levertijd`,`aantal` Having COUNT(*) > 1 ) t )

How to Filter Products Based on Attribute Value & Attribute set | magento | Magento 1.9

You can follow the code : <?php ob_start(); ini_set(‘max_execution_time’, 0); set_time_limit(0); ignore_user_abort(true); require_once ‘/chroot/home/powerme1/’; Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $_write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’); $_read = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’); $collection = Mage::getModel(‘catalog/product’)->getCollection()->addAttributeToFilter(‘attribute_set_id’,9)->addAttributeToFilter(‘brand’, array(‘eq’ => 1674)); foreach($collection as $_product): $_product = $_product->load($_product->getId()); echo $_product->getSku() . ‘ >>> ‘ . $_product->getUpc() .'<br>’; endforeach; echo ‘<hr />’; $collection = Mage::getModel(‘catalog/product’)->getCollection()->addAttributeToFilter(‘attribute_set_id’,9)->addAttributeToFilter(‘brand’, array(‘eq’ => 1853)); foreach($collection as $_product): […]

Magento 1x: Create a controller & xml layout for the module

If you don’t know how to create a module then see this link. Create a Folder controllers in inside your module path: app\code\local\Trenza\Orderimage\ . Now create a IndexController.php and add bellow code in here. <?php /* * Copyright (c) 2015 */ class Trenza_Orderimage_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { $this->loadLayout(); $this->renderLayout(); } } Now […]

Create a new table on for you module & connect with model

Go to phpmyadmin and select your magento database. Here go to sql and insert the bellow command. It create a table trz_orderimage which is your table. — phpMyAdmin SQL Dump — version 4.5.1 — — — Host: — Generation Time: Oct 27, 2017 at 07:59 AM — Server version: 10.1.13-MariaDB — PHP Version: […]

Create a new module on magento 1x | How to create a Magento 1.9 Custom Module | Magento 1.9.x: How to create an Extension / Module ?

Create a magento 1x simple module:  Make sure magento admin panel  system/tools/compilation is disabled. Just need to create a new file on app\etc\modules Trenza_Orderimage.xml <?xml version=”1.0″?> <config> <modules> <Trenza_Orderimage> <active>true</active> <codePool>local</codePool> </Trenza_Orderimage> </modules> </config> Here Trenza_Orderimage this is my module identity. Now go to app/code/local/ create a folder Trenza go inside trenza(package name) and now open Orderimage (Module […]

Magento 1x: How to select, insert, update, and delete data from custom table

If you have a custom table which has model Mage::getModel(‘mynews/mynews’); then you can easily insert , select , update & delete data from your table see bellow codes. INSERT DATA $data = array(‘title’=>’hello there’,’content’=>’how are you? i am fine over here.’,’status’=>1); $model = Mage::getModel(‘mynews/mynews’)->setData($data); try { $insertId = $model->save()->getId(); echo “Data successfully inserted. Insert ID: […]

How to set, get & delete Session on Magento 1x

1.  Magento 1x Set a new session: Here is the example of it. Mage::getSingleton(‘core/session’)->set{YOUR SESSION NAME}({SESSION VALUE}); Example : $Value =’test’; Mage::getSingleton(‘core/session’)->setName($Value); *** if you use phtml/controller/model of magento 1x there you can use Mage:: function if you use a single file on root of you magento site then you need to add some functionality […]

Magento 1x All Events Reference

Magento 1x All Events Reference Here The list of event can create on magento 1x . Observer use after / before any magento module action. Magento Module Event Name Parameters Mage Admin admin_session_user_login_success array(’user’⇒$user) Mage Admin admin_session_user_login_failed array(’user_name’⇒$username, ‘exception’ ⇒ $e) Mage Admin admin_user_authenticate_after array(’username’ ⇒ $username,’password’ ⇒ $password,’user’ ⇒ $this,’result’ ⇒ $result) Mage Adminhtml […]