Magento Professional customer’s password hashing

So you want to import customer accounts but you’ve to generate the password hash? here you’ve the algorithm used by Magento Professional (which is different from Magento Community, but you can easily find that one in the net):

$passhash = hash("sha256", $salt . $password) . ":$salt";

By the way, for the community it’s

$passhash = md5($salt . $password) . ":$salt";

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

Create a custom order attribute in Magento

I’ve run into a few posts about this thing but none of them was working out of the box so I took all the info and glued them together so…

if you’ve to create a custom attribute for a Magento order but you don’t have a module (and its installer script) simply create a php file in the project’s root with this code:

require_once(‘app/Mage.php’);
Mage::app()->setCurrentStore(Mage::getModel(‘core/store’)->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = newMage_Sales_Model_Mysql4_Setup;
$attribute = array(
‘type’ => ‘text’,
‘backend_type’ => ‘text’,
‘frontend_input’ => ‘text’,
‘is_user_defined’ => true,
‘label’ => ‘Your attribute label’,
‘visible’ => true,
‘required’ => false,
‘user_defined’ => false,
‘searchable’ => false,
‘filterable’ => false,
‘comparable’ => false,
‘default’ => ”
);
$installer->addAttribute(‘order’, ‘your_attribute_code’, $attribute);
$installer->endSetup();

This attribute is a “text” and it’s made not to be visible but just to use it as a container for some data you may need in your custom development, more info may come in comments if you need.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

UCK 2.4.5 is out!

A new maintainance release is ready just for you, giving you full oneiric compatibility (except for alternate, we need help), here’s the changelog:

———–
– 2.4.5 –
———–
* Frontend:
* new languages (zh-hans/zh-hant) are now correctly handled.
Fixes #770810
* hybrid image generation support was added to uck-gui (#830146)
* oneiric language packs support was added
* Backend:
* /etc/fstab is not mandatory in the squashfs file system (#808506)
* /var/run is now a symbolic link to /run (#812418)
* Oneiric alternate support was added (#842487)
* mkisofs calls were replaced with genisoimage (#836350)
* isohybrid support was added (uck-remaster-pack-iso -h) (#830146)
* manifest diff now checks if manifest files really exist
* lxterminal support was added (#865295)
* mksquashfs now uses XZ (lzma) compression if available
(squashfs-tool => 4.1 and guest kernel => 2.6.30)
(#654234)
* gfxboot-theme-ubuntu download method was rewritten
(question #157847)
* firefox locale auto-remove workaround was added (#886838)
* Package:
* suggestion for syslinux (isohybrid) installation was added

Download UCK 2.4.5 or use our stable PPA.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

“Magento 1.4 Themes Design Cookbook” review

As I wrote a few days ago, I was asked to review the Magento 1.4 Development Cookbook by Packt so I took the right time to read it deeply and with great attention to point out every pro and con of this mid-length book (249 pages).

First of all the book is available at a price of ~40 USD (~31 EUR) if you want the paper book, or ~32 USD (~25 EUR) for the digital copy (in PDF format), the price is right (maybe just a little high) for a highly technical book like this. You’ll also receive a comprehensive archive of all the code that’s used in the book, really useful for a quick cut&paste to try out things!

Now, I’ve to say that Magento 1.6 is near to be released and still we’ve no book about 1.5, and also if 1.4 documentation is still valid I think that it would be the time to update all the books on the new releases.

Chapter 1: I think it’s completely useless unless for the section about the differences between 1.3 and 1.4, in this moment every designer about to design and/or code a Magento themes already know what can be done and surely has seen enough themes in the wild so I think that we don’t need an introduction or a showcase.

Chapter 2: this is one of my preferred chapters, ok it’s not so difficult but it explains all the basic concept and it’s really needed for the first timers. I think this chapter should have been the first one but anyway it’s great.

Chapter 3: probably it could be merged with the 2nd ’cause it keeps talking about the basic things you need to know when you’re about to start working on a Magento themes, useful but anyway I think none needs a “where do I get inspiration for a favicon” section. The “display products on the homepage” section is instead really useful and raises the level of this chapter.

Chapter 4: first real steps into customizing a default Magento theme to fit your design, with some more basic hits (like enabling template path hints and block names hints) and some detailed info about CMS pages (which actually area managed pretty bad in Magento).

Chapter 5: creating a theme from scratch, pretty advanced things are going on here :) and that’s the kind of things I like the most.

Chapter 6: starts with a useless section about integrating font-face into a Magento theme, actually I don’t understand why this kind of info should be in a Magento book, it should have been in a HTML/CSS one… but finishes with some pretty handy documentation about “navigation” and the “product view” template.

Chapter 7: the part I liked the most about this chapter is about creating a custom block and using it in a layout xml file, other things (adding javascripts or stylesheets) are a little too basic at this point.

Chapter 8: talks about mail templates, pretty basic stuff in the beginning, getting interesting later with variables in emails and a good section about how to integrate external newsletter systems and another one on upgrade-proof email templates.

Chapter 9: integrating social stuff, absolutely basic notions about copying facebook’s html widgets and paste it in your templates…

Chapter 10: print styles, once again I think that this topic should be covered in a HTML/CSS guide.

Conclusions: if you never wrote a Magento theme buy this book, it will help you in a lot of ways. The second time you’ll have to do the same work again… you won’t need it.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

P4A 3.8.4 is out!

Another maintenance release for our beloved project, here you’ve the changelog:

- “meta viewport” tag was added to mask’s HTML for a better mobile rendering
- P4A::getMetaViewport() and setMetaViewport() methods were added
- p4a_center_elements() javascript funcion now removes marginLeft/paddingLeft
from the first visible column of the first P4A_Frame widget
- a bug with P4A_Frame and multiple CSS classes was solved
- P4A_Table’s arrow symbols were because the past ones weren’t shown on mobile
devices
- an ob_clean() call was added to P4A_Thumbnail_Generator::outputThumbnail()
method
- Zend Framework was updated to 1.11.10
- P4A_Table’s image cols do not throw exception anymore if the image
does not exist
- P4A_Field_loadSelectByArray helper now supports a second parameter to specify
the array’s primary key field name

Download P4A 3.8.4

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

P4A 3.8.3 is out!

A few improvements on different areas, here you’ve the changelog:

- P4A_DB_Navigator now supports query defined sources
- a bug with P4A_Data_Source::saveUploads() was solved
- a bug with P4A_Table’s image cols (without GD installed) was solved
- P4A_DB_Navigator now triggers a beforeclick event
- all p4a_load_js calls were migrated to require.js
- a bug with P4A_DB_Source::deleteRow() called when in newRow state was solved
- p4a_ajax_enable javascript function was added
- a bug with P4A_GD constant default definition was solved
- P4A_Mask::restart() method was added
- Zend Framework was updated to 1.11.7
- translations were updated
- P4A_DB_Source::load() method now checks for duplicate calls and throws an error

Download P4A 3.8.3

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

P4A 3.8.2 is out!

This is a minor release but it contains really a lot of great upgrades and fixes, here you’ve the changelog:

- Zend Framework was updated to 1.11.6
- CKEditor was updated to 3.6.0
- jQuery UI was updated to 1.8.11
- requirejs was added
- P4A_Dir_Source automatically sorts files
- P4A_Dir_Source::setPageLimit() calling was disabled
- P4A_Dir_Source’s page limit is now set to 0 (disabled)
- autocomplete values are now sorted and unique
- P4A_Field::getSource() method was added
- p4a_load_js now uses requirejs
- P4A_Field and P4A_Data_Fields now support the “datetime” type
- P4A_Field and P4A_Data_Fields now support the “time” type
- P4A_Object::dropImplement() now turns the action to lowercase
- deprecated method P4A_Object::dropMethod() was removed
- a javascript bug with P4A_DB_Navigator’s drag&drop functionalities was solved
- P4A_DB_Navigator now correctly supports source with non-default DSN

Download P4A 3.8.2

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

Probably the best WordPress LinkedIn profile plugin :-)

A few weeks ago I was working on my Italian professional website and I wanted to use my LinkedIn profile as the website’s home page, I tried some of the existing WordPress LinkedIn plugins but none of them was working (they use a bunch of complex regex that are really easy to break, if LinkedIn changes its pages a little bit all of them won’t work, and that was the case) so I started to write my own LinkedIn resume plugin.

I used a different approach using DOM parsing and I think that will be absolutely bulletproof :)
It also outputs raw parts of LinkedIn HTML so it’s much easier to style and we’re sure that it will include every future feature LinkedIn may add (also without my intervention), I think that’s a great plus.

Release 1.3 it’s available right now and the plugin (available under GPL license) is right there for you to download and use for free.
Check it out!

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

What a great monitor for Sony Vaio VPCF11Z1E (i7, 8GB RAM, bluray burner)!

The title is obviously rhetorical, let me explain.

First a bit of introduction, this is an hi-end pc, it has an i7 processor, 8GB RAM, blu ray burner and a 1080p (1920×1080) LCD panel, there are no excuses, this is a quite expensive machine and must be perfect!

I bought the notebook a few months ago and I had troubles with the LCD panel since the first day, at the beginning it had a darker section (~5mm) on all the bottom part of the panel. That’s really annoying. I sent the notebook back to sony 2 times (more than 2 weeks without the newly bought PC):

  • first time the wrote me “ok we replaced your panel”: it simply was not true (IMHO)
  • second time they told me “hey your monitor is perfect, this is our standard”

WHAT??? I see a lot of notebooks every day where I work and in the stores, none has this kind of problems (neither the sony’s). I always heard that SONY LCD were just great, one of the best and instead I’ve the ugliest monitor I ever had!!! In the past I had a few DELL pcs (I know, I did a big mistake chosing SONY against DELL).

Now the problem gets worse, just look at the pictures:

Is this the SONY LCD top quality? ahahhaha just don’t make me laugh!
Actually I’ve to say that the situation shown in the pictures above happens only sometimes (apparently randomly), all other time the problem is less serious but anyway… what if it completely break right after the warranty expiration?

Another great feature of this top class LCD panel is that if you turn down the brightness level to the minimum, half the screen slowly turns off (and then it bounces on and off forever), don’t you believe me? Here you have:
If you want to see it in action check this movie clip.

There’s one more problem, the leather inserts are falling apart, take a look at this picture:

I’ll try to send the notebook to SONY another time (and this is a problem for me ’cause I work with this machine!), will they understand that it has a problem? I’ll keep you updated.

UPDATE: sony changed the motherboard and the leather part, everything not related to the monitor which still have the same problems!!!

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

Magmi, the best Magento importer

I found out Magmi while writing my Esprinet importer for Magento.

I think that using Magento API is the cleanest way to do every import operation but importing something like 70.000 products was absolutely TOO SLOW so I had to look for something else…

Magmi (which is released under the MIT license) does everything using SQL queries and it’s blazing fast! It also features a few really useful plugins, the one I like the most are:

  • Category importer: you can type category names in CSV instead of category ids, really nice. It also creates parent categories if you use the “parent/child” syntax.
  • Optimizer: runs some MySQL tables optimization before importing.
  • Magento reindexer: updates all (or just some) Magento indexes, couldn’t live without it!

What I didn’t like?

  • Using “/” for the category importer separator, I’ve a lot of categories with the “/” char in the name, so I hat to patch the plugin to use “->” instead of “/”. I think it could be better in any case but for the maximum flexibility it should be a part of the configuration options
  • I couldn’t find any documentation about the CLI usage
  • Using Magmi CLI it seems to me that the import progress file isn’t updated the right way

Anyway the Magmi team did a great job, hope it will continue to be maintained for future Magento releases.

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine