October 28, 2009 3 Comments
I have put together an XAMPP based portable Magento demo site. You can easily download it to your windows PC, drop the xampp folder into the root of your C: drive, launch the XAMPP control panel to start Apache and MySQL and then you are away.
You can get the files on GitHub here:
Please read the README which is displayed at the bottom of the GitHub page for up to date instructions.
As previously announced, we have started to run a Magento training course. The course is targeted at Magento site owners who are new to the system and are keen to get the most out of their Magento store.
One of the key advantages of Magento is it’s wealth of professional ecommerce features that all come bundled as standard. These really make it stand proud of the competition. However, if you don’t know how to use those features then they are wasted. This course aims to rectify that.
If you would like to book one of the limited number of places, please do so ASAP. Simply give us a call on 0844 357 0201 or contact us via our contact form. There are multiple dates scheduled so get in touch to find out the latest information.
Here are some details of the course:
This is a one day introductory course to the Magento Ecommerce system. Magento is an awesomely powerful cutting edge open source ecommerce package that is quickly gaining a large following due to its impressive array of powerful enterprise level features.
This course will give you the background understanding and practical skills needed to get the best out of your Magento store. You will leave with a clearer understanding of some of the more complex principles in Magento and will learn how to leverage some of the core features of Magento to get the most out of your store.
This course is designed for business owners or staff who are or will be running a Magento based ecommerce business. It will enable your business to get the maximum return on your investment into Magento by ensuring you and your staff are using the system to it’s fullest capabilities.
You will learn how to:
Key Magento Principles:
MVC Code Architecture, EAV Database Structure, Module Based Customisation and Magento Connect
Magento Product / Category Administration:
Attribute Sets, The Product Types (Simple, Configurable etc), Cross Sell, Up Sell, Related Products and SEO Techniques
Magento Order / Customer Administration:
Orders, Invoices, Shipments,Credit Memos and Customer Details and Passwords
Basic Magento Configuration Options:
Payment Methods, Shipping Methods and General Configuation
Key Magento Principles
A holistic overview of the Magento system and its core principles, philosophy and background.
Magento Product / Category Administration
Setting up the categories and products that make up your store and updating this catalogue. In depth coverage of the extra features of the Magento products system. This will be the largest element of the course.
Magento Order / Customer Administration
How to manage orders, customers, invoices, shipments and credits within the Magento adminstration system.
Basic Magento Configuration Options
A brief overview of how the Magento configuration works and a look at some of the more commonly used configuration options.
Get in touch for the latest dates – new dates being added all the time!
If you would like to book one of the limited number of places, please do so ASAP. Simply give us a call on 0844 357 0201 or contact us via our contact form
October 27, 2009 1 Comment
Linux has a great little utility called split, which can take a file and split it into chunks of whatever size you want, eg 100 line chunks.
However, for CSV files etc, each chunk generally needs to have the header row in there. Unfortunately the split command doesn’t have an option for that. However with a little bit more code you can achieve it.
tail -n +2 file.txt | split -l 4 - split_
for file in split_*
head -n 1 file.txt > tmp_file
cat $file >> tmp_file
mv -f tmp_file $file
October 22, 2009 1 Comment
If you need to move your osCommerce (and derivatives such as CRE Loaded and Zen Cart) based site to a new server, here is a quick explanation of our approach which enables you to handle the migration without any downtime and no loss of order or customer information despite the fact that in the propagation period, visitors may visit the new server or the old server.
This propagation period is due to the fact that DNS servers around the globe may have cached your old DNS record, which points your domain name at your old IP address. These caches can stay alive for up to 48 hours meaning that you can not be certain that a visitor will definitely go to your new server within this period despite the fact that you have updated your domain name to point at your new name servers.
First – Copy the Files + Database:
Of course you need to copy all of the site files from the old server to the new server. The slowest and least reliable way to do this is via FTP. By using FTP, you have to actually download all the files on your old server to your local PC and then upload those files from your local PC to the new server. This can take a long time, especially the uploading part (thanks to the asynchronous nature of ADSL).
For the database you need to create a dump file via the command line or exporting from phpMyAdmin. Like FTP for the files, if you use phpMyAdmin then you have to download the dump file to your local machine and then upload it to the new server.
A better method for moving the files and database dump is to use SCP to copy files directly from the old server to the new server. I have written an article explaining this technique here: Basic Server Migration Using SSH + SCP.
Configuring the New Server
Unfortunately osCommerce based sites often require register globals to be enabled. They also use the old fashioned long arrays. That means that you will probably need to edit the configuration of the new server to enable these old PHP features.
This is an example vhost.conf (don’t forget to create the vhost_ssl.conf with the same settings) for Plesk.
php_admin_value open_basedir /var/www/vhosts/******.co.uk/dbCreds:/var/www/vhosts/******.co.uk/httpdocs:/tmp
php_admin_flag register_globals on
php_admin_flag register_long_arrays on
Note that I have specified a non webaccessible folder called dbCreds which contains the database credentials. I can then simply include this file from within the includes/configure.php and admin/includes/configure.php files.
Ensuring No Loss of Customer or Order Information
To make sure that you don’t lose any customer or order information, we need to take a couple of extra steps. First though an explanation of what can go wrong:
During the propagation period, there is a distinct possibility that you will be taking orders on both servers. If you don’t take any extra steps, then you might have orders and customers on both servers that have the same id number on the database. This can then make transferring the missing orders from the old server to the new server problematic.
A simple solution is to simply edit the autoincrement value on the orders and the customers table. I would normally suggest using a big jump in increment like 1000. This will mean that new orders and customers created on the new server will have id numbers that are 1000 higher than the old server. By doing this, we can then import any missing order and customer information over, safe in the knowledge that the id numbers will not clash. Of course, if you expect to create 1000 orders or customers within a couple of days then you will need to make a bigger increment increase on the new server. You are probably also turning over vast amounts of cash
Once the propagation period is over, lets say 3 days after you update your name servers, you can use this little script I created to help you to export the missing orders from your old server to your new server
Server Migration Orders / Customers Synchronisation
Get Someone To Handle it For You
Of course, if you prefer you can book someone to handle the migration for you. If you would like us to take care of your migration, just get in touch.
October 21, 2009 1 Comment
If your Magento database has swelled to truly gargantuan proportions, then perhaps you have suffered the same fate as a recent client. Magento happily logs all kinds of data to a collection of tables beginning with the prefix log_
It is possible to configure Magento to clean out these logs on a regular basis as part of its Cron schedule (you have created a cron job to run the cron.php script haven’t you?). Alternatively, it seems you can disable logging altogether simply by going to the admin then in the system menu, select config.
At the bottom you will see a link to advanced. In this section you can disable selected Magento modules, one of which is Mage_Log.
If you want to check coverage against ICEcat, the best thing to do is to import their dump file available here into a MySQL database.
The file format is a bit unusual, but here is a nice command you can run. You need to have created a database in it with a table called prodid_d
CREATE TABLE IF NOT EXISTS <code>prodid_d</code> (
<code>id</code> int(11) NOT NULL AUTO_INCREMENT,
<code>part_number</code> varchar(255) NOT NULL,
<code>brand</code> varchar(255) NOT NULL,
<code>quality</code> varchar(255) NOT NULL,
<code>category</code> varchar(255) NOT NULL,
<code>model</code> varchar(255) NOT NULL,
<code>ean</code> varchar(255) NOT NULL,
<code>market_presence</code> varchar(255) NOT NULL,
PRIMARY KEY (<code>id</code>)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
then in the command line (linux) run the follwing command:
mysqlimport --user=DBUSER --password=DBPASSWORD --columns=part_number,brand,quality,category,model,ean,market_presence --fields-terminated-by='\t\t\t' --replace DBTABLE /ABSOLUTE/PATH/TO/prodid_d.txt
I seem to be incredibly busy this month…
Managed to do a lot though. One cool thing is the creation of a shared hosting friendly (and also wysiwyg designer friendly) MVC framework. It doesn’t require anything more fancy than PHP5 with PDO. No open base dir problems, no modifying the include path problems, no bloat problems, no excess complexity problems.
We do a lot of subcontracting for design agencies and needed something that we could work on at the same time, with proper separation of visual design and logic. However the current big frameworks are all a bit too heavy duty so we have rolled our own small MVC system.
It uses a lot of Jquery to create nice interactive forms and as much as possible auto generates forms etc from the database structure. Its all designed with a view to enabling us to achieve rapid application development whilst still being accessible to non technical (Dreamweaver) designers as much as possible.
All the template files are pure HTML files with no PHP logic in them what so ever. This means that the WYSIWYG designer can work comfortably in a way that is familiar.
We aim to release the framework as open source shortly, just need to go over the code and documentation to make sure that it is a good cohesive package.
October 11, 2009 No Comments
This weekend saw the second annual PHP North West conference in Manchester. It was great
After seeing two talks that touched upon the Symfony framework plus the plethora of other developers with an almost religious passion for the framework that I spoke to, I will definitely be getting into it soon. Especially now I have seen that I can try the Symfony framework and still have access to some of the cool Zend Framework modules such as Zend_Mail as demonstrated by Stefan Koopmanschap.
In comparison to PHP London, they managed to restrict the Microsoft evangelists to a roughly 15 minute slot rather than a full slot on track 1, which was a welcome relief. I used the time to try to register my free PHP Architect Magazine voucher and extend my subscription. (Didn’t actually work though, but I seem to remember there were issues last year as well, customer service request pending).
I loved the talk about Xdebug as well. Xdebug is so awesome, it was great to see an in depth explanation of all of its features, there were a few that I have yet to play with. Also great to see that my favourite FOSS IDE, Netbeans, is regarded by Derick Rethans, the inventor of Xdebug, to be the second best IDE for use with Xdebug. He prefers Komodo which I haven’t actually tried and is paid for software so that makes Netbeans the best open source IDE (I already knew it was).
It was good to get an overview of the SPL library by Michelangelo van Dam. Its one of the features of PHP that I know I should probably use more and it was great to have some demonstrations of the capabilities of the library.
All in all it was a great conference and the food was really nice too
Looking forward to next year!