Skip to content

Instantly share code, notes, and snippets.

View JonathanCosta's full-sized avatar
😁
Focusing

Jonathan Martins Costa JonathanCosta

😁
Focusing
View GitHub Profile

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

magento troubleshoot: list all configurable products, whose stock status is wrong according to its associated simple products

This script lists all configurable products, which are "Out of Stock" and where at least one associated simple product is in stock. Additionally it lists configurable products, where the configurable product is set to "in stock" but none of the associated simple products are "in stock". When catalog is setup correctly, this script should return nothing.

<?php
require_once('app/Mage.php'); //Path to Magento
#!/bin/bash
#
# Found on StackOverflow:
# http://stackoverflow.com/a/9304264/3765
#
if [ ! -f ./app/etc/local.xml.template ]; then
echo "-- ERROR"
echo "-- This doesn't look like a Magento install. Please make sure"
echo "-- that you are running this from the Magento main doc root dir"
@JonathanCosta
JonathanCosta / removeDuplicates.php
Created March 13, 2017 19:37
Remover imagens duplicadas e setar as imagens para a imagem base
<?php
ini_set('display_errors', 1);
set_time_limit(0);
require('app/Mage.php');
umask(0);
Mage::app('admin');
Mage::register('isSecureArea', 1);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$collection = Mage::getModel('catalog/product')->getCollection();
import java.util.Scanner;
public class Principal {
Scanner valorInput = new Scanner(System.in);
public static void main(String[] args) {
//Lista I
CalcArea();
@JonathanCosta
JonathanCosta / datataflow.php
Created November 13, 2017 15:04 — forked from vpietri/datataflow.php
Magento shell script to run dataflow from the command line
<?php
require_once 'abstract.php';
/**
* Magento Dataflow Shell Script
*
* This file should be save in the shell directory of Magento
* Basic usage samples:
* php dataflow.php
* php dataflow.php list
@JonathanCosta
JonathanCosta / magento-xhrcart.js
Created December 2, 2017 12:07 — forked from rafaelpatro/magento-xhrcart.js
Add ajax compatibility to Magento action buttoms
/**
* Add XHR compatibility to Magento action buttoms
*
* Author:
* Rafael Patro <rafaelpatro@gmail.com>
*
* Requirements:
* DOMParser HTML fixes
* jQuery Growl library
*
@JonathanCosta
JonathanCosta / imporarClientes.php
Created February 17, 2018 10:42
Script para importação de clientes magento
<?php
/**
* Magento
*
* JONATHAN M. COSTA
* https://github.com/JonathanCosta
*
*
* Importação de clientes
*
<html>
<head>
<style>
.item {width:300px; display: inline-block; }
.item .itemtitle {font-weight:bold; font-size:2em;}
.hidden {display:none;}
</style>
</head>
<body>
<h1>Amalgam Comics Characters</h1>