Skip to content

Instantly share code, notes, and snippets.

View magefast's full-sized avatar
🥶

Alex S magefast

🥶
View GitHub Profile
@magefast
magefast / Get Telephones + count orders + money values -- from Orders - last 900 days
Last active January 19, 2022 17:07
Get Telephones + count orders + money values -- from Orders - last 900 days
<pre>
<?php
require_once dirname(__FILE__) . '/../app/Mage.php';
Mage::app();
$fromDate = date('Y-m-d H:i:s', strtotime('900 days ago'));
$toDate = date('Y-m-d H:i:s', strtotime('now'));
$o = Mage::getModel('sales/order')->getCollection()
->addFieldToFilter('status','complete')
@magefast
magefast / Convert XML to CSV - products export XML file (Prom)
Created November 18, 2021 08:32
Convert XML to CSV - products export XML file (Prom)
<pre>
<?php
$path = "yml_catalog.xml";
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / Magento - import Category form CSV
Created November 10, 2021 07:06
Magento - import Category form CSV
<?php
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', 20000);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / Magento - export Products with categories to CSV
Created November 10, 2021 07:04
Magento - export Products with categories to CSV
<?php
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', 20000);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / Magento - Assign products to categories form CSV file
Created November 10, 2021 07:03
Magento - Assign products to categories form CSV file
<?php
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', 20000);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / PHP script for Export Category data to CSV file - Magento 1
Last active November 10, 2021 07:33
PHP script for Export Category data to CSV file - Magento 1
<?php
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', 20000);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / Prepare import CSV for images
Created October 25, 2021 10:53
Prepare import CSV for images
<?php
ini_set('max_execution_time', 20000);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('memory_limit', '2048M');
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / Prepare products for import. Compare EXIST SKU and New Product Import. EXIST sku - will cut from Product Import file.
Created October 25, 2021 10:24
Prepare products for import. Compare EXIST SKU and New Product Import. EXIST sku - will cut from Product Import file.
<?php
ini_set('max_execution_time', 20000);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('memory_limit', '2048M');
require_once './app/Mage.php';
Mage::app();
@magefast
magefast / Copy images from external URL by CSV list
Last active October 6, 2021 05:37
Copy images from external URL by CSV list
<pre>
<?php
ini_set('max_execution_time', 20000);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$allImages = [];
$file = 'img-list.csv';
$imgDirSave = 'images';
@magefast
magefast / CustomerAttributeCreate.php
Created March 28, 2021 17:13
Customer Attribute Create
<h1>Customer Attribute Creator for Magento</h1>
<br/>
<br/>
<form method="post" action="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; ?>">
<h2>Add new Attribute for Customer.</h2>
<br/>
Input name for Attribute
<br/>
<input type="text" name="name" value="test"/>
<br/>