Skip to content

Instantly share code, notes, and snippets.

@texboy
texboy / composer-patches.md
Last active January 8, 2025 12:38
How to apply git patches using composer on a magento 2 project.

Introduction

Patches are great for small bugfixes since they're easy to create and maintain. You should follow magento's official documentation to install the required composer plugin. Don't forget to add the required patch section on your composer.json or composer will not be able to see your patches.

Getting started

Create a repo to start the creation of a patch.

  1. Go inside the folder that the file you need to fix is.
  2. Execute the git init . command.
  3. Execute the git add -A . command.
  4. Commit something. Ex: git commit -m "start of patch"
@leek
leek / _Magento2_DeleteTestData.md
Last active March 27, 2025 06:52
Magento 2 - Delete All Test Data

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@CNanninga
CNanninga / minify-magento2.sql
Created January 8, 2019 14:39
Minify a Magento 2 database
-- ----------------------------------
select "Deleting all but 50 customers" debug;
drop procedure if exists minify_customers;
delimiter #
create procedure minify_customers()
begin
select @remaining_customers := count(*) from `customer_entity`;
while @remaining_customers > 50 do
@rafaelpatro
rafaelpatro / magento-address-autocomplete.js
Last active September 23, 2024 12:44
Magento Address Auto Fill based on Postcode
/**
* Address Auto Fill based on Postcode
*
* Author:
* Rafael Patro <[email protected]>
*
* Intallation:
* Add a CMS Static Block applying the entire script below.
* Add a Widget to pages with address forms.
*
@vinicius-stutz
vinicius-stutz / README.md
Last active July 23, 2024 16:51
Máscara p/ telefones com 8 ou 9 dígitos (jquery.mask.js)
@jeroenvermeulen
jeroenvermeulen / jv_clean_product_images.php
Last active July 7, 2021 10:21
Script to clean up unused Magento images
#!/usr/bin/env php
<?php
/**
* mh_remove_unused_product_images.php
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL: