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 )
Configurable product has duplicate simple product with same attribute or not check
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. SELECT `sku`,count(*) as C FROM `table_1` Group BY `orientatie`,`material`,`papier`,`paginas`,`paper_type_cover`,`veredeling_omslag`,`levertijd`,`aantal` Having COUNT(*) > 1
Display Position on List page Magento 1x
If you want to display Category product position on list.phtml please add bellow code for test it
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/powermedicalsupplies.com/html/app/Mage.php’; 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 www.trenzasoft.com */ 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 — http://www.phpmyadmin.net — — Host: 127.0.0.1 — 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 […]
How to edit magento 1x admin order details page (create a new area/block/tab)
You can easily edit this area by going path app/design/adminhtml/default/default/template/sales/order/view/ and all of the admin order details content you get from here. Suppose i want to add a new block after Shipping AddressEdit area. For this i just open info.phtml. Now just copy this line and past it again in lastly of info.phtml. Then go […]
Magento 1x get products per page for category product list
Here you just need bellow code for get list page product limit range get. $allowedValues = Mage::getStoreConfig(‘catalog/frontend/grid_per_page_values’); $grid_per_page_values = explode(“,”, $allowedValues); foreach($grid_per_page_values as $gridperpage){ echo $gridperpage; }
Create a event observer after order submit Magento 1x
Create a event observer after order submit. Bellow code is need to add in your module path/etc/config.xml if you have already adminhtml tag then just ignore adminhtml tag. in bellow code Trenza_Prescription is the module name. and class is the class name of which trigger it do when observer event run. Method is which class […]
Call PHTML from another PHTML Magento 1x
Call a phtml file from another phtml on magento 1x. Please follow the bellow steps there are several way you can call phtml files. When you want to add phtml on same module Then you need to follow this code. Use bellow code on your xml file. If you want to add a phtml file […]
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 […]