Skip to content

Instantly share code, notes, and snippets.

View thiagolima-bm's full-sized avatar

Thiago thiagolima-bm

View GitHub Profile
@thiagolima-bm
thiagolima-bm / order-uncancel.php
Created September 13, 2017 08:44 — forked from derak-kilgo/order-uncancel.php
One-off tool to uncancel an order in magento 1.x
<?php
if(php_sapi_name()!=="cli"){
echo "Must be run from the commend line.";
};
/**
* Setup a magento instance so we can run this export from the command line.
*/
require_once('app/Mage.php');
umask(0);
if (!Mage::isInstalled()) {
@thiagolima-bm
thiagolima-bm / Install Composer using MAMP's PHP.md
Created March 24, 2016 16:42 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@thiagolima-bm
thiagolima-bm / gist:b6072d119fef6b31b653
Last active September 8, 2015 18:46 — forked from brankoajzele/gist:2781404
Programatically create Magento order with tablerate shipping
<?php
require_once 'app/Mage.php';
Mage::app();
$quote = Mage::getModel('sales/quote')
->setStoreId(Mage::app()->getStore('default')->getId());
$product = Mage::getModel('catalog/product')->load(6); /* 6 => Some product ID */
@thiagolima-bm
thiagolima-bm / orderCreate.php
Last active September 8, 2015 18:36 — forked from trabulium/orderCreate.php
Magento: Create Order from a Previous Order Programmatically
<?php
define('MAGENTO_ROOT', "/var/www/web");
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
umask(0);
Mage::app();