Skip to content

Instantly share code, notes, and snippets.

View magefast's full-sized avatar
😻

Alex S magefast

😻
View GitHub Profile
@magefast
magefast / customers.sql
Created April 21, 2018 16:34 — forked from leek/_Magento1_DeleteTestData.md
Magento - Delete All Test Data
SET FOREIGN_KEY_CHECKS=0;
-- Customers
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
@magefast
magefast / Magento - Remove image files, that not used in products
Last active March 16, 2019 05:37
Magento - Remove image files, that not used in products
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once './app/Mage.php';
Mage::app();
$collection = Mage::getModel('catalog/product')->getCollection();
@magefast
magefast / nginx.conf
Last active February 13, 2022 19:30
Magento - Nginx config - /etc/nginx/nginx.conf
user www-data;
##! SET_UP_PROD
# set equal to cores quantity
worker_processes auto;
pid /var/run/nginx.pid;
events {
##! Custom
## Determines how many clients will be served by each worker process.
worker_connections 1024;
##! Custom
@magefast
magefast / gist:d7210417a3249539ec128f8af71a9e4d
Created February 15, 2018 23:37
Magento, remove attribute of customer model
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
set_time_limit(400);
require 'app/Mage.php';
Mage::app('default');
$attributeCode = 'mobilephone';
@magefast
magefast / gist:575c1d651edef8084489df887d68af0b
Created February 15, 2018 23:30
Magento, remove categories
<?php
ini_set('memory_limit', '1000M');
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once './app/Mage.php';
Mage::app();
Mage::register('isSecureArea', true);
for ($i = 60000; $i <= 70000; $i++) {
@magefast
magefast / gist:8d06a00bfac86cf375de855b893dc711
Last active February 15, 2018 23:25
Magento, update Urlrewrite - target_path
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('time_limit', 1000);
ini_set('max_execution_time', 1000);
ini_set('memory_limit', '1600M');
require_once dirname(__FILE__) . '/app/Mage.php';
Mage::app();
@magefast
magefast / gist:b654dd3a4786d3ef28d87eb7ae4ff034
Last active February 15, 2018 23:16
Magento, get list of products that without assigned to any categories
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('time_limit', 1000);
ini_set('max_execution_time', 1000);
ini_set('memory_limit', '1600M');
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / gist:a26e6f083ae10dfa96df1d9652910fe4
Created February 15, 2018 23:05
Magento, get count of products in Category, products - exist in stock, and with sale price
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('memory_limit', '1G');
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / gist:4498617e9bf02509a2fdebcd7837e8b3
Created February 15, 2018 22:42
Magento, update url-keys in Url-rewrite module
<pre>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('time_limit', 1000);
ini_set('max_execution_time', 1000);
ini_set('memory_limit', '1600M');
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / gist:f4912bba69eccda56f92705067ea7ce4
Created February 15, 2018 22:37
Magento, check xml with errors
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('time_limit', 1000);
ini_set('max_execution_time', 1000);
ini_set('memory_limit', '1000M');