SVN: Magento Best Practice
Who: Anyone who works with Magento (especially clients who are running a store) and could benefit from a more in-depth understanding of Magento best practices. What: SVN and Magento (a sweet relationship) Why: Because whether you are a client or a developer, your life can be made easier by using SVN and reaping its benefits Quick Summary:
- High-level explanation of SVN
- Who should use SVN
- Why it should be used
- Specific things to watch out for with Magento
- Bonus: optional tools

1. A high-level explanation SVN
“SVN” (aka “Subversion”) changes and improves the development process. It is an “enhancement” to “CVS” which allows developers to maintain local, staging, and production environments. This is a best proactive for most software development (and Magento) projects. SVN relates to “Git” (though some prefer one more than the other) and is free to use. Simply put, SVN is a tool that keeps a revision history of code over a period of time. You keep project code located within the repository and pull a copy of the entire code with one simple command (a total of about 6 seconds). In addition, any updates to the code are committed to the repository, which allows anyone who is “linked” to the repository to sync their code with the latest changes via one click of a button. A simultaneous, multi-user environment is thus organized for development and proper administration. Just to reiterate - there are an incredible number of benefits to SVN… too many to mention here.2. Who should use SVN
Everyone who works with Magento should use SVN. As a rule of thumb, SVN should be used in any significant software development project (unless you use Git).3. Why SVN should be used
SVN allows multiple developers to build simultaneously in an organized fashion with a detailed history of the progress. This ensures that the live storefront (production environment) is always intricately cared for (read open for business). Every developer has experienced early on in their career the inevitable mistake of removing a file via FTP, only left to realize that file is lost in space and no longer retrievable. But large cocktails are no longer necessary to cope with such an event thanks to SVN. The developer’s life becomes easier; and the client’s business is safer. When used properly, SVN ensures reliability, integrity, speed, and fall-back recovery.4. Specific things to watch out for with Magento
In our experience, there are a few specifics to watch out for when using SVN with Magento. Without getting too technical, here are a few things we’ve learned along the way: You need to watch out for the caching within Magento. Utilizing SVN:Ignore is the key to allowing the local environment to cache correctly. I would recommend setting SVN to “ignore” for the following (at least) when maintaining separate environments:- app/etc/local.xml (or use SVN lock instead for this)
- media/catalog/product/cache
- var/
5. Bonus: optional tools
At Elias, we fancy apps that make our lives easier. We invest a lot of time researching and trying out new apps to see how well they fit our business. So far we have found a few SVN tools that are worth mentioning. (Note: these may be Apple-specific. Forgive us):- VersionsApp: A high-quality desktop application that allows one to manage repositories locally for streamlined management of code.
- BeanstalkApp: A sweet as online SVN storage service to host repositories full of code, revisions, and a great interface for management.
- Coda App: A quality code editor that integrates with SVN
- TextMate: Another quality code editor with SVN integration
- MAMP: A personal Mac server with Apache, Mysql and PHP
- VirtualHostX: A virtual hosting utility that works well with MAMP
- VirtualBox: A sweet virtualization product to run multiple operating systems
- Spoon.net: A browser-compatibility testing tool we’re just becoming familiar with
Keramikos Excitement
So our friends at Keramikos Kitchen decided to send along a set of knives to their developer :) In the meantime, his wife enjoys…
Thanks Keramikos!
Part 1 of 3: Scene 7 Integration With Magento eCommerce
What: Straightforward overview on our approach for integrating Scene 7 with Magento eCommerce.
Why: Because Magento rocks and Scene 7 rocks. Together, they can create an inspiring user experience!
Who: For the business who desires real interactivity, and for developers who desire to implement Scene 7 capabilities with Magento.
We recently were approach by a company who knew about Scene 7’s capabilities and they wanted their Magento store to do the following:
1. Replace all product and category images with Scene 7 composited images 2. Allow the user to “build” a custom product based off of product options, and reflect the user selections in the product image 3. Create a unique user experience in their Magento storeWhy could this be useful? Well, take a few minutes to learn more about what Scene 7 and Magento integration can do together. Soon, when the project is completed - we’ll have some examples to share. What was our process in approaching this? Let me give a high-level outline our take on integrating the two systems. First off, we looked at how we can utilize Scene 7 url’s instead of native Magento URLs. So we decided to override the catalog image helper so we could add custom functions to composite the appropriate URLs to build the image via a specified URL string. Secondly, we interfaced this custom helper with the Scene 7 backend and some Javascript to build the desired product images. We did this by creating a function inside of the new helper to be able to do all URL string manipulation based off of product options changed by the user on the frontend. Thirdly, we went through and determined every theme file that needed modifying to use the function that built the Scene 7 URLs and reflect the composited image. As an overview, we took the following approach: 1. Created the right images in Scene 7 to use in correlation with Magento. 2. Created product options in Magento 3. Overlaid JS to the product options to be used as variables within our Helper function 4. Manipulated the URL string and returned the composited URL to build the product image (based off of the user-selected product options) The site has yet to go live, though keep in touch with Elias updates and you will see the finished product.
Magento and Scene 7 Integration: 3 Part Series
Hey All, Here’s a head’s up for those interested in Scene 7 integration with Magento. We’re excited for what Scene 7 brings to the table, and we hope to see it more throughout the Magento community in the near future. In an effort to back that up, we’re going to come out with a 4-part series on a project we recently did to integrate Scene 7 with Magento. For those interests that are being peaked, feel free to check back with us to catch up on the following:
1. How we integrated the two (a high-level overview of Magento and Scene 7) 2. How to structure Magento for Scene 7 3. How to structure Scene 7 for MagentoWe’ll try to keep it as straight-forward and basic as we can, as we’re very excited to see the Magento community start utilizing Scene 7 more. Cheers, Lee
Magento Featured Products: A More Convenient Way To Display Featured Products On The Home Page
About: How To Show / Display Featured Products On The Home Page (Conveniently) Who’s Interested: Informative to the technical gurus What: An alternative direction on how to show featured products on your Magento storefront home page Magento Version Relevance: Any Magento Store Setup: Any My thought: “Why not let the Admin choose what products to display on the home page like every other category?” If you’ve been involved in the community dialogue that constantly evolves through the Magento boards, you may have run across a topic mainly focused on ways for developers to display featured products on the home page. There have been many directions taken with this, including the following as only a few to mention:- Install a extension and configure
- Create an attribute, assign each product a value for that attribute, and then display products based upon the value they contain for that attribute
- Use the CMS template code to display a certain category
I didn’t want to override any other solutions, but simply offer another approach - one that does not do the following:
- Modify any core code
- Require per-product management
- Install any extension
- Create a new “structural block” within Magento (see example, thanks Inchoo)
- Create a (hidden) category within the Magento Admin
- Modify the structural block to display that category in a specific way
- Set the Category Id
Structural Block
- app/design/frontend/*/*/template/catalog/product/featured-products.phtml
Magento eCommerce: How To Reset All Test Order Information and Set Unique Prefix For Orders, Invoices, Shipments, and Credit Memos
About: How To Reset Test Orders, Dashboard Information, and Set Unique Starting Values for Orders, Invoices, Shipments, and Credit Memos Who’s Interested: Informative to the technical gurus What: Plug ‘n Play Database Script that runs queries to customize after store is installed and product(s) have been created Magento Version Relevence: 1.1.6 Magento Store Setup: Single-Store Setup A client of ours went in to test products, orders, invoices, etc. to get the feel for the overall “purchase order to shipment” process from start to finish. After creating many test users, orders, etc. - they now desire to have everything reset back to “0” (zero). Not only that, but they also want to separate the prefixes for the following items just for ease of dissimilarity when using the Magento ADMIN tools:
- Orders (set prefix to begin with “1”)
- Invoices (set prefix to begin with “2”)
- Shipments (set prefix to begin with “3”)
- Credit Memo’s (set prefix to begin with “4”)
- Find “YOUR_DB_NAME” down below and change to match your database name (though leave the ticks “)
- Copy and paste code into SQL manager (PhpMyAdmin or similar) and then run the query
- Feel free to Create test order, invoice, shipment, and credit memo’s via the ADMIN (easier than going through order process on frontend)
- Once you like the changes you see, go back and run the same SQL query …the following will now be in effect:
- All data pertaining to orders and search terms (Dashboard) are reset to 0 (zero)
- Order number prefix with 0, Invoice number prefix with 2, Shipment number prefix with 3, Credit Memo number prefix with 4
Magento: Create New Payment Method -> Cash On Delivery
About: How To Create a Magento Custom Module and A “Cash On Delivery” Payment Method Who’s Interested: Informative to the semi-technically savvy What: Custom Magento Payment Method So I’ve seen more and more people raising awareness about desire to create a new payment method that allows orders to be paid via “cash on delivery” or “on pickup” by customer. Is this helpful to companies who sell to local clients? Absolutely. So in offering a solution, I’ll go ahead and outline what files need to be created and why with hopes to help educate the intigued learner in how to create a Magento Custom Module as well. The benefit in knowing how to do this is modifying existing Magento functionality in a way that it will not be overwritten upon a successful Magento upgrade. Thus, I’ll jump in. The following 5 files will be created (relative to one’s Magento root folder):
- confix.xml
- system.xml
- PaymentMethod.php
- mysql4-install-0.1.0.php
- NewModule.xml
Elias: Cash On Delivery (Magento Payment Method)
Making It Happen: Coda-Slider
Modify the js code included in the page's header into this:
[sourcecode language='js']
jQuery(window).bind("load", function() {
jQuery("div#slider1").codaSlider()
// jQuery("div#slider2").codaSlider()
// etc, etc. Beware of cross-linking difficulties if using multiple sliders on one page.
//call every __ seconds
var autoSlide = setInterval(function()
{
$("#left-link").click();
}, 10000);
});
[/sourcecode]
And change line 63 (i believe, or corresponding line of code) of coda.slider.1.1.1.js:
[sourcecode language='js']
jQuery(this).before(”
