Archive for the ‘Tips & Tricks’ Category

Magento one page checkout : display shopping cart details in sidebar

magentoonepagecheckoutorder

There are a lot of discussions going on about Magento’s one page checkout procedure : it is supposed to enhance customer payment experience by probviding ajax based single page order progress. But there are alos some discussions in the forum on how to enhance this process which is quite unusual and might discourage some customers. In a previous post I reviewed the code that produces sidebar shopping cart in default pages with right margin. The solution below explains how to add a full shopping cart display for the customer’s that trying to complete an order.

Read the rest of this entry »

Magento custom attributes display on product page

The flexibility created by the attribute feature in Magento allows limitless possibilities : vairous product types can be created and each of them can go with specific attributes, meaning specific form fields for the admin, that are inserted in the product view (template/product/view.phtml) for public display. The functions availble for each user defined attributes are very simple to guess : they are dynamically created for each attribute create using , as explained in the Pratthost developer zone blog
Read the rest of this entry »

Magento simple ssh install

The magento wiki has a good article that details how to install Magento with the help of PEAR downloader. We don’t need that, just want to install magento via ssh in a few commands, here is the detail. Before you install, make sure you check requirements, especially innoDB option for mysql.

 

  • go to your root folder and download magento :
     wget http://www.magentocommerce.com/downloads/assets/1.2.1/magento-1.2.1.tar.gz 
  • unzip tar and delete it :
     tar xvzf magento-1.2.1.tar.gz 
    rm magento-1.2.1.tar.gz
     
  • copy files back to your root folder, including htaccess, then remove the magento dir
     mv magento/* .  

    mv magento/.ht* .
    rmdir magento/

     

  • chmod / chuser files in order to let apache do its job
    chown magento:users * -R
     for i in $( find . -type d ); do chmod 755 $i; done  

     for i in $( find . -type f ); do chmod 644 $i; done

Not that you mightr have to specify your own permissions in the last command. If you’ve got there, That’s it, you’re ready to run the installer, GOOD LUCK. Core upgrades can be done via the Magento Downloader.

MDI viewer

MDI , a high resolution, tag-based graphics format, is supported only by the Microsoft Office 2003 version of Microsoft Office Document Imaging. If you plan to share files with people who are using Office Document Imaging 2002, or another document imaging program, it’s best if you save your files in TIFF format for compatibility. If by luck you happen to receive MDI files, the best option if you have been greedy enough to save on M$ Office (prefer openoffice), is to try products from Buysoft, that provides MDI tools and a free MDI reader that will print your MDI file in less than a minute.

Jquery picasa album scroller

Is it necessary to build an alternative picasa viewer when picasa itself provides nice flash gallery viewers ? for webmasters it turns out that sometimes it can be necessary to hide picasa details, and thanks to picasa itself providing various remote server access, you can use your albums within any kind of rss or json enabled application. We provide here an example of a JSON – jquery powered slideshow that takes input from any picasa album. The advantage of using picasa over hosted or specific applications such as famous menalto’s gallery of coppermine is that picasa does resizing jobs for you, and offers up to 1 GB of free online image storage which largely enough for any small website presentation.

Read the rest of this entry »

Laying text over title image in wordpress

Used by many news portals, the technique above is a great example of how to optimize layout of breaking news. We have gone the simple way with the image above, using a combination of Photoshop layers over a background image. The way it is implemented for Wordpress platform by Derek Punsalan illustrates the power of wordpress custom fields, and also the limits of this input system. We would like to have image custom input fields, such as file browser or color selector. The popular custom field GUI plugin handles select, checkboxes and radio buttons but would require extensions to handle more advanced input types. There is hack on Wordpress forums for that plugin  that handles Wysiwyg fields, but I would not expect it to be maintained over future versions of Wordpress. The “More Fields” Plugin is a bit more flexible and is worth having a look at too.

Online Image editing : jquery’s way

My last article on Silvesrtripe CMS online image editing feature led me to investigate alternative solution for websites and software developers that wish to implement this kind of component for their backoffice.. Surfing on CAKEPHP framework homepage turned out to illustrate perfectly the kind of component that should be standard on all CMS : resizing is now pretty common, and what we want now is cropping. There is actually a plugin for jquery that does the interface job, ImgAreaSelect. ImgAreaSelect come with loads of configuration options that make it a perfect tool for cropping images : the selection area is responsive, draggable, and can be adjusted to work only within specified limits or predefined aspect ratio. What’s missing in Jquery is the server side of things, and you’ll find that either on webmotionUK for pure PHP or on CAKEPHP’s site for Cake integration.

Silverstripe form validation translation

Silverstripe’s nice form builder, in its current version, has one big drawback : it doesnot handle translations very well. Coming from a discussion on Silverstripe’s forums, I have decided to manage my own translation solution for UserDefinedForms.

Read the rest of this entry »

Create url for mod_rewrite

Creating urls with Search engine optimized keywords from database records involves more than just mod_rewrite and htaccess synchronization. The first step of a good search engine indexing strategy is to take one of your database fields as index (title is a good one) , transform it by removing spaces, special characters, and if necessary append record unique identifier to the generated string. Here is a sample function that transforms a string to make it file compliant using a regular expression to discard non alphanumeric characters and replace spaces with dashes :

function make_url($string){

$pattern = “([^[[:alnum:]|[:space:]|[:blank:]])+”;
$anchor = ereg_replace($pattern, ”, strtolower($string));
$pattern = “([[:space:]]|[[:blank:]])+”;
$anchor = ereg_replace($pattern, ‘-’, $anchor);
return short_name($anchor); // return the short filtered name
} # end function