Skip to content

Instantly share code, notes, and snippets.

View marvinosswald's full-sized avatar

Marvin Oßwald marvinosswald

View GitHub Profile
# Comments are supported, begin a line with a hash
src app/code/local/H2ODev/MagentoOrderExport/
# Destination file name is not required if the same as the source.
H2ODev_MagentoOrderExport.xml app/etc/modules/
var/connect/H2ODev_MagentoOrderExport.xml var/connect/H2ODev_MagentoOrderExport.xml
var/connect/package.xml var/connect/package.xml
@marvinosswald
marvinosswald / how.php
Created July 28, 2015 11:05
Maybe i didn't get some stuff straight with the getModel function here..
// Normal Code
Mage::getModel('H2o_XMLToMagento_Model_Ftp",$credentials);
// Ftp.php
require 'utils/FTP.php';
class H2o_XMLToMagento_Model_Ftp extends H2o_Dev_FTP {
}
#:::::::::magerun:::::::::::
array (
'LESS_TERMCAP_mb' => '',
'XDG_SESSION_ID' => '2',
'LESS_TERMCAP_md' => '',
'LESS_TERMCAP_me' => '',
'SHELL' => '/bin/bash',
'TERM' => 'screen',
'SSH_CLIENT' => '10.0.2.2 52026 22',
'LESS_TERMCAP_ue' => '',
$body = "Unable to upload Order: " . $orderId;
$mail = new Zend_Mail();
$mail->setBodyText($body);
$mail->setFrom($fromEmail, $fromName);
$mail->addTo($toEmail, $toName);
$mail->setSubject($subject);
[23-Jul-2015 15:45:07 UTC] PHP Fatal error: Call to a member function __toString() on a non-object in /vagrant/httpdocs/app/Mage.php on line 859
[23-Jul-2015 15:45:07 UTC] PHP Stack trace:
[23-Jul-2015 15:45:07 UTC] PHP 1. {main}() /vagrant/httpdocs/cron.php:0
[23-Jul-2015 15:45:07 UTC] PHP 2. Mage::dispatchEvent() /vagrant/httpdocs/cron.php:76
[23-Jul-2015 15:45:07 UTC] PHP 3. Mage_Core_Model_App->dispatchEvent() /vagrant/httpdocs/app/Mage.php:448
[23-Jul-2015 15:45:07 UTC] PHP 4. Mage_Core_Model_App->_callObserverMethod() /vagrant/httpdocs/app/code/core/Mage/Core/Model/App.php:1317
[23-Jul-2015 15:45:07 UTC] PHP 5. Aoe_Scheduler_Model_Observer->dispatch() /vagrant/httpdocs/app/code/core/Mage/Core/Model/App.php:1338
[23-Jul-2015 15:45:07 UTC] PHP 6. Aoe_Scheduler_Model_Schedule->process() /vagrant/httpdocs/.modman/Aoe_Scheduler/app/code/community/Aoe/Scheduler/Model/Observer.php:39
[23-Jul-2015 15:45:07 UTC] PHP 7. Aoe_Scheduler_Model_Schedule->runNow() /vagrant/httpdocs/.modman/Aoe_Scheduler/
@marvinosswald
marvinosswald / addTracking.php
Created July 22, 2015 07:01
adding a tracking code to an order - magento
public function addTracking($orderArr){
$order = Mage::getModel('sales/order')->loadByIncrementId($orderArr["externalordernumber"]);
$ship = Mage::getModel('sales/service_order', $order)->prepareShipment(count($order->getAllVisibleItems));
$ship = new Mage_Sales_Model_Order_Shipment_Api();
$shipmentId = $ship->create($orderArr["externalordernumber"]);
$shipment_collection = Mage::getResourceModel('sales/order_shipment_collection');
$shipment_collection->addAttributeToFilter('order_id', $orderArr["externalordernumber"] );
<session_save>db</session_save>
<redis_session> <!-- All options seen here are the defaults -->
<host>127.0.0.1</host> <!-- Specify an absolute path if using a unix socket -->
<port>6379</port>
<password></password> <!-- Specify if your Redis server requires authentication -->
<timeout>2.5</timeout> <!-- This is the Redis connection timeout, not the locking timeout -->
<persistent></persistent> <!-- Specify unique string to enable persistent connections. E.g.: sess-db0; bugs with phpredis and php-fpm are known: https://github.com/nicolasff/phpredis/issues/70 -->
<db>1</db> <!-- Redis database number; protection from accidental loss is improved by using a unique DB number for sessions -->
<compression_threshold>2048</compression_threshold> <!-- Set to 0 to disable compression (recommended when suhosin.session.encrypt=on); known bug w
@marvinosswald
marvinosswald / gist:77e6465f31d6c4983895
Created June 5, 2015 10:10
Request / Response Safari and Firefox for shop-blank.de

Firefox

#Static Frontpage

Request

    Host: www.shop-blank.de
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: de,en-US;q=0.7,en;q=0.3

@marvinosswald
marvinosswald / full-calendar.js
Last active August 29, 2015 14:19
Can't access jquery obj
import Ember from "ember";
export default Ember.Component.extend({
attributeBindings: ['id'],
id: 'calendar',
setEvents:function (){
var events = this.get("theEvents");
var arr = []
events.forEach(function(e,i,enumerable){
arr.push({
import Ember from "ember";
export default Ember.Component.extend({
attributeBindings: ['id'],
id: 'calendar',
setEvents:function (){
console.log(this.get("theEvents"));
}.observes("theEvents"),
_initializeCalendar: function() {
var self = this;