Magento Customization With Extensions. Ashley Schroder aschroder.com ashley.schroder@gmail.com



Similar documents
Bazaarvoice for Magento Extension Implementation Guide v6.3.4

Monday, April 8, 13. Creating Successful Magento ERP Integrations

Data Migration from Magento 1 to Magento 2 Including ParadoxLabs Authorize.Net CIM Plugin Last Updated Jan 4, 2016

Follow Up . Magento Extension User Guide. Official extension page: Follow Up . User Guide: Follow Up

CORNERDROP OVERVIEW & CORNERDROP MAGENTO INSTALLATION INSTRUCTIONS CORNERDROP.COM/CONTACT-US

J2T Points & Rewards Magento Extension

Copyright 2013 X.commerce, Inc. All rights reserved

Magento Quotation Module User and Installer Documentation Version 2.2

Google Trusted Stores Setup in Magento

Magento Integration Manual (Version /24/2014)

Magento Extension User Guide

Magento Certified Developer What, Why & How

ASULPUNTO Magento unicenta opos integration extension Version 1.0.0

JOINUS AG. PowerPay Checkout. Magento Module User Manual. Support:

Magento Content API Technical Overview

Paul Boisvert. Director Product Management, Magento

Magento Certified Developer Exam Exam: M70-101

SEO Suite Pro. User Guide

DutyCalculator - Installation and Configuration

Script-controlled Backups in SAP HANA Database

Magento Dhru Fusion Integration Extension. IMEI Profile Configuration

Bazaarvoice for Magento

Designing and Implementing an Online Bookstore Website

CounterPoint SQL and Magento ecommerce Interface

Top 7 Data Magento Extension For Your ecommerce Site Management

Avatier Identity Management Suite

install the extension:

CheckItOut Developer Manual

MAGEJAM PLUGIN INSTALLATION GUIDE

Informatica Corporation Proactive Monitoring for PowerCenter Operations Version 3.0 Release Notes May 2014

Table of Contents. Magento Certified Developer Exam Study Guide

Installing and Using the Zimbra Reporting Tool

Estimating Magento Upgrades. Tim Bezhashvyly Openstream Internet Solutions

Connect Getting Started Guide. Connect Getting Started Guide

How to Replicate BillQuick 2003 database on SQL Server 2000.

SuiteCRM Magento Integration

Training Events Database (TED) Setup Guide

SEO Toolkit Magento Extension User Guide Official extension page: SEO Toolkit

LP Express Installation and User Manual

Version 4.0 MageB2B Pricesystem ReadMe AIRBYTES GmbH

Magento Extension Developer s Guide

Two new DB2 Web Query options expand Microsoft integration As printed in the September 2009 edition of the IBM Systems Magazine

Manual. Version: 1.0.0

Trytond Magento Documentation

SMTP Settings. Magento Extension User Guide. Official extension page: SMTP Settings. User Guide: SMTP Settings

How to pass Magento Certification Exam in 30 days Published by David Nguyen at Smashwords Copyright 2013 David Nguyen

Altima Lookbook Free Extension v

HOW TO CONFIGURE SQL SERVER REPORTING SERVICES IN ORDER TO DEPLOY REPORTING SERVICES REPORTS FOR DYNAMICS GP

SERVICE SCHEDULE PUBLIC CLOUD SERVICES

Create a Database Driven Application

Linas Virbalas Continuent, Inc.

Version of this tutorial: 1.06a (this tutorial will going to evolve with versions of NWNX4)

Magento Clang Integration Extension version 1.2.0

NextGen Setup Guide First-time Workstation Setup & Logging In

X-POS GUIDE. v3.4 INSTALLATION SmartOSC and X-POS

equate Installation QUICK START GUIDE

Using the PL/SQL Cartridge of the Oracle Application Server to Deploy Web Applications. Connie Begovich Oak Ridge National Laboratory

Magento Integration User Guide

Magento Customer Segments Under the Hood

Deploying BitDefender Client Security and BitDefender Windows Server Solutions

Shipbeat Magento Module. Installation and user guide

Magento - Feature Set

OrderFlow Magento Integration

Task Scheduler. Morgan N. Sandquist Developer: Gary Meyer Reviewer: Lauri Watts

How to Prepare for the Upgrade to Microsoft Dynamics CRM 2013 (On-premises)

Fall CRM Server Software Design TEAM MEMBERS: Project Owner: Herve Ntareme Champion: Bjorn Pehrson. MAHSA TABATABAEI ( mahsat@kth.

SHIPSTATION / MIVA MERCHANT SETUP GUIDE

Creating Value through Innovation MAGENTO 1.X TO MAGENTO 2.0 MIGRATION

Magento Enterprise Edition Datasheet

Magento 1.3 Feature List

TSM Studio Server User Guide

Jet Data Manager 2012 User Guide

Magento integration 1.0

AVOIDING THE GIT OF DESPAIR

Module Google Rich Snippets + Product Ratings and Reviews

Module - Facebook PS Connect

Embedded ERP for Magento Integration and User Guidelines Version 2.3 & 1.5

700 Fox Glen Barrington, Illinois ph: [847] fx: [847]

Bidirectional replication for InterBase and Firebird

Top Import / Export Magento Extension For Your ecommerce Site Management M-Connect Media. Prepared By: M-Connect Media

ProxiBlue Dynamic Category Products

How To Import From Amazon On Kubana

Newsletter Popup with Free Gift Coupon

Magento Extension REVIEW BOOSTER User Guide

Module Google Rich Snippets + Product Ratings and Reviews

Chancery SMS Database Split

AJ Shopping Cart. Administration Manual

Stripe Payment Module Magento 2 USER MANUAL MAGEDELIGHT.COM SUPPORT E: SUPPORT@MAGEDELIGHT.COM P: +1-(248)

Manage Your Shop with Policy Based Management & Central Management Server

Bubble Code Review for Magento

August 2012 Web Application for Enprise Job Costing SAP 2007A, SAP 2007A SP01, SAP 8.8 All regions

Future-proofed SEO for Magento stores

PaybyFinance Magento Plugin

InstantSearch+ for Magento Extension

Transcription:

Magento Customization With Extensions Ashley Schroder aschroder.com ashley.schroder@gmail.com

World Wide Access

Magento In New Zealand

Evolving Magento developers

Starting with Magento Difficult to understand, hard to make changes Things take a long time, quick core hacks Using app/code/local overrides

Using Extensions Google Analytics Sitemap Google Checkout Reports Gift Message

Customization Pain Points Upgrade heartache Related code gets spread out and duplicated Difficult to engineer

Why Extensions? Extensions are self-contained blocks of functionality, they can go places You can add configurability to your extensions You can engineer your extensions

Extension Do Cool Things Scheduled processes using Cron Schema changes using SQL setup scripts Hook into events for pinpoint customizing

Processing like clockwork Works like the Unix cron daemon, but let s you work purely in Magento Use it for scheduling tasks in your extensions Warehouse inventory and Fulfillment tracking

Scheduled Processing <crontab> <jobs> <fbashipping_inventorysynch> <schedule><cron_expr>*/5 * * * *</cron_expr></schedule> <run><model>fbashipping/inventory::cron</model></run> </fbashipping_inventorysynch> <fbashipping_tracking> <schedule><cron_expr>0 */6 * * *</cron_expr></schedule> <run><model>fbashipping/tracking::cron</model></run> </fbashipping_tracking> </jobs> </crontab>

Processing like clockwork public function cron() { // We need to load the Adminhtml events Mage::app()->loadAreaPart('adminhtml', Mage_Core_Model_App_Area::PART_EVENTS); } // Only actually do anything if tracking is enabled if (Mage::helper('fbashipping')->isTrackingEnabled()) { $this->submitrequest(); } BUT: Don t forget to allow cron functionality to be disabled, and make sure you enable admin events if your cron job is doing admin things.

Cron Reliability It s not always running! $schedules = Mage::getModel('cron/schedule')->getCollection() ->addfieldtofilter('status', Mage_Cron_Model_Schedule::STATUS_PENDING) ->load(); Use remote pinging tools as an easy setup, e.g webstore monitors

Schema Changes and EAV Add/Edit attributes for core entities (thanks EAV). $installer->startsetup(); $installer->addattribute('catalog_product', 'disabled_from', array( 'type' => 'int', // snip... 'apply_to' => '', 'is_configurable' => false ));

Schema and EAV You can manipulate/create your own tables and entities. Create Tables $installer->run(" CREATE TABLE `{$this->gettable('smtppro_email_log')}` ( `email_id` int(10) unsigned NOT NULL auto_increment, `log_at` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `to` varchar(255) NOT NULL default '', `template` varchar(255) NULL, `subject` varchar(255) NULL, `email_body` text, PRIMARY KEY (`email_id`), KEY `log_at` (`log_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; "); $log = Mage::getModel('smtppro/email_log') ->setto($to) ->settemplate($template) ->setsubject($subject) ->setemailbody( $ishtml?$email:nl2br($email)) ->save(); Use them

Schema and EAV Gotchas Backward Compatibility Each script only runs once, logged to core_resource Keep an eye on your config.xml version number

Events Explicit Events Mage::dispatchEvent ('admin_session_user_login_success', array('user'=>$user)); Implicit Events protected function _beforesave() { Mage::dispatchEvent('model_save_before', array('object'=>$this)); Mage::dispatchEvent($this->_eventPrefix.'_save_before', array ($this->_eventobject=>$this)); return $this; }

Events Catch events using configuration in config.xml <events> <sales_order_shipment_save_after> <observers> <customerservice_after_ship> <type>singleton</type> <class>customerservice/customer_observer</class> <method>shipment</method> </customerservice_after_ship> </observers> </sales_order_shipment_save_after> </events>

Events You can fire events too e.g SMTP Pro email event Mage::dispatchEvent('smtppro_email_after_send'... Allow customization without class overrides Help resolve extension conflicts - we ll get to this soon

Engineering Extensions

Version control & Releases Place extensions into a code repository then either export them (or svn:externals) them into other projects Symlinks allow you to have a single extension installed in multiple stores.

Symlinking with modman modman is a great script made by Colin Mollenhour Create all symlinks with a recipe. All stores can use the same recipe

Dev and Prod versions Maintain a production version and a development version of each extension Push changes to production only when you are happy with the stability of development Test on multiple versions of Magento Update all stores running at the same time

Limitations of extensions Effort - takes longer to create Certain core class changes eg superclasses Clashes! Let s look at this one in more detail...

Extension clashes How do they happen? override same class Bane of any extension developers life Real problem for Magento in general - with growth of extensions

What to do about clashes Detect them so the users know (self test) Publish a list of known clashes that users can search and see - before they install.

One way to resolve clashes Create your own events fired in the override class <events> <wwa_autologistics_register_order_button> <observers> <fbashipping_order_button_observer> <type>singleton</type> <class>fbashipping/observer</class> <method>get_order_button</method> </fbashipping_order_button_observer> </observers> </wwa_autologistics_register_order_button> </events>

Then fire your event... All of the extensions that need to add a button can listen //Fire event+add buttons, if we can ship, and we are enabled if ($this->_isallowedaction('ship') && $this->getorder()->canship() && Mage::helper('autologistics')->isEnabled()) { Mage::dispatchEvent('wwa_autologistics_register_order_button', array('orderid' => $orderid, 'block' => $this)); }

What do we do with all of these extensions...

So...

ASchroder.com Ashley Schroder @aschroder ashley.schroder@gmail.com visit New Zealand