Skip to content

Instantly share code, notes, and snippets.

View harshvardhanmalpani's full-sized avatar
💯
life is a party!!

Harshvardhan Malpani harshvardhanmalpani

💯
life is a party!!
View GitHub Profile
@harshvardhanmalpani
harshvardhanmalpani / letsencrypt-ca-bundle-new.crt
Last active March 12, 2018 20:58
Let's Encrypt Root CA Bundle
-----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/MSQwIgYDVQQK
ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X
DTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0NlowSjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxl
dCdzIEVuY3J5cHQxIzAhBgNVBAMTGkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4
S0EFq6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8SMx+yk13
EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0Z8h/pZq4UmEUEz9l6YKH
y9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWAa6xK8xuQSXgvopZPKiAlKQTGdMDQMc2P
MTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQAB
@harshvardhanmalpani
harshvardhanmalpani / update-product-attribute-options.js
Created November 22, 2017 09:55
Manage Magento 2 product attribute options - values using JS console
$jq=new jQuery.noConflict();
var mimim=["Abalone",
"Titanium Druzy",
"Tourmaline",
"Turquoise",
"Yellow Zircon",
"Light Blue Druzy"];
var trans=[];var o=0;
$jq('#manage-options-panel tbody tr td:nth-child(3) input').each(
function(a,b){
@harshvardhanmalpani
harshvardhanmalpani / createCat.php
Created October 27, 2017 08:02
How to create Magento 2 category programmatically
<?php
//creating categories in magento 2
//last verified Magento 2.2.0 27 Oct 2017
use \Magento\Framework\App\Bootstrap;
echo 'code by harshvardhanmalpani';
include('./app/bootstrap.php');
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
function createCategory($a='',$b=2,$c=true,$d='',$e='',$f='',$g='') {
global $objectManager;
@harshvardhanmalpani
harshvardhanmalpani / Magento-Product-CustomOptions-Duplicate-Remover.php
Created April 24, 2017 22:50
This code removes duplicate custom options for all products. Use toggle for test and debug.
<?php
$debug=0;
$test=0;
/*
Code by Harshvardhan Malpani - https://harshmalpani.in
Tested for Magento CE 1.9.x
Date: 25/04/2017
Use $debug and $test toggles to display messages.
This script will remove all duplicate custom options in each product (duplicate logic = same title for multiple custom options)
*/
@harshvardhanmalpani
harshvardhanmalpani / convertProductImages2Jpg.php
Last active January 5, 2017 18:13
Converts all magento images from PNG to JPG
<?php
$halfPath='./media/catalog/product';
$user="username"; //username for SOAPv2 api
$pass="password"; //password for above user
$products = array(20,21,22); //array of product IDs to be converted
ini_set('display_errors',E_ALL);
error_reporting(E_ALL);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;