Skip to content

Instantly share code, notes, and snippets.

View zaheerbadi's full-sized avatar
🏠
Working from home

Zahirabbas Badi zaheerbadi

🏠
Working from home
View GitHub Profile
@zaheerbadi
zaheerbadi / .bash_profile
Last active January 31, 2020 11:44
Define Multiple Command Line PHP and COMPOSER in windows For More info about how to setup please visit https://zaheerbadi.wordpress.com/2020/01/31/define-multiple-command-line-php-and-composer-in-windows/
alias composer701='/E/wamp64/bin/php/php7.0.32/php.exe /c/composer/composer.phar '
alias composer71='/E/wamp64/bin/php/php7.1.22/php.exe /c/composer/composer.phar '
alias php70='/E/wamp64/bin/php/php7.0.32/php.exe'
alias php71='/E/wamp64/bin/php/php7.1.22/php.exe'
alias php56='/E/wamp64/bin/php/php5.6.38/php.exe'
################### Remove definer from sql file ##########################
sed 's/\sDEFINER=`[^`]*`@`[^`]*`//g' -i oldfile.sql
#################### Displya new product using widget xml (Mage2.1) ####################
<referenceContainer name="page.bottom.container">
<block after="-" class="Magento\Catalog\Block\Product\Widget\NewWidget" name="new_product_blog" template="Magento_Catalog::product/widget/new/content/new_grid.phtml">
<arguments>
<argument name="uiComponent" xsi:type="string">widget_new_products</argument>
<argument name="page_size" xsi:type="number">10</argument>
<!-- 'Product attributes to show' configuration -->
@zaheerbadi
zaheerbadi / Magento1Snippets.php
Created December 9, 2019 09:04
Magento1 Snippets
########################### Change store programatically ###########
Mage::app()->getLocale()->emulate($shipment->getStoreId());
Mage::app()->setCurrentStore($shipment->getStoreId());
####################### Parse the magento directives in custom module ######################
$helper = Mage::helper('cms');
$processor = $helper->getBlockTemplateProcessor();
$html = $processor->filter($contentToParse);
echo $html;
@zaheerbadi
zaheerbadi / Emailpreivew.php
Created December 9, 2019 09:00
Email preview magento2
<?php
namespace Vendor\Extenssion\Helper;
use Magento\Framework\App\Area;
class Emailpreivew extends \Magento\Framework\App\Helper\AbstractHelper
{
/**
* @var \Magento\Framework\App\Config\ScopeConfigInterface
*/
@zaheerbadi
zaheerbadi / ProductMetaImport.php
Created October 1, 2019 08:21
Here i am updating three meta attribute.But you can update any no of attribute as per your requirement.
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('memory_limit', '512M');
require 'app/Mage.php';
umask(0);
Mage::app('default');
class ImportProductMeta extends Mage_Core_Model_Abstract {
@zaheerbadi
zaheerbadi / config.xml
Created July 16, 2018 03:49
M2MigrationConfigXmlSource
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../../config.xsd">
<steps mode="settings">
<step title="Settings Step">