Defining Custom Address Format in Magento

Written by shuron on December 13, 2009 – 02:09 -

If you want to change the default address representation in your Magento shop you should simply add new address format for desired country. It should be done in the table mage_directory_country_format.

The following example illustrates how to do this. This statemet inserts the same format in three forms: HTML, text and PDF for beeing used in PDF documents like invoices.

INSERT INTO `mage_directory_country_format` (`country_id`, `type`, `format`) VALUES
('DE', 'html',
'{{depend company}}{{var company}}<br />{{/depend}}\n
{{var firstname}} {{var lastname}}<br/>\n
{{var street1}}<br />\n
{{depend street2}}{{var street2}}<br />{{/depend}}\n
{{depend postcode}}{{var postcode}}{{/depend}}{{depend city}} {{var city}}{{/depend}}
{{depend region}}, {{var region}}{{/depend}}<br/>\n
{{var country}}<br/>\n{{depend telephone}}Tel : {{var telephone}}{{/depend}}\n
{{depend fax}}<br/>Fax : {{var fax}}{{/depend}}'),
('DE', 'text',
'{{depend company}}{{var company}}\n{{/depend}}
{{var firstname}} {{var lastname}}\n
{{var street1}}{{depend street2}}{{var street2}}\n{{/depend}}\n
{{depend postcode}}{{var postcode}}{{/depend}}{{depend city}} {{var city}}{{/depend}}
{{depend region}}, {{var region}}{{/depend}}\n
{{var country}}
{{depend telephone}}\nTel : {{var telephone}}{{/depend}}
{{depend fax}}\nFax : {{var fax}}{{/depend}}'),
('DE', 'pdf',
'{{depend company}}{{var company}}|\n{{/depend}}
{{var firstname}} {{var lastname}}|\n
{{var street1}}|{{depend street2}}{{var street2}}|\n{{/depend}}\n
{{depend postcode}}{{var postcode}}{{/depend}}{{depend city}} {{var city}}{{/depend}}
{{depend region}}, {{var region}}{{/depend}}|\n
{{var country}}
{{depend telephone}}|\nTel : {{var telephone}}{{/depend}}
{{depend fax}}|\nFax : {{var fax}}{{/depend}}|')

Prioduces something like:
My Company GmbH
Max Mustermann
Mönkeberg Str. 123
22090 Hamburg
Hansestadt Hambug
Deutschland


Tags: , , , , ,
Posted in Magento | No Comments »

First Steps with Magento

Written by shuron on May 5, 2009 – 00:14 -

magento-logo I would like to start new topic with this article: Magento, the eCommerce Platform. Let me say vew words about the Magento itself, before diving deeper into Plugin development.

First Magento versions appeared on the end of 2007. But only at the end of 2008 the community got relative stable versions of the system. Today, we can speak about Magento as of the leading Open Source eCommerce Platform. You can read on the official site about the features that Magento offers in detail. Their big amount and high configurability of the Magento result in a growing compelxity. The guyes from Varien have choosen the  Zend Framework and the plugins concept as the foundation  for Magento.  In doing so,  they complied with requirements for high customization and configuration of a modern eCommorce system. In the same time, they created a complex multi-technology system which automatically leads to some sceptical comments on forums. This happens often with systems which tries to deliver many features and aims to remain simple in the same time.

However, we believe that Magento is well architected, so developers just need do structure their work properly and share this experince with others. Therefore we start a new Magento article series here, in which we intend to cover technical aspects. Another goal is to develop some useful Plug-Ins an share them with you.

Magento plugin configuration will be covered in the following article. Stay tuned…


Tags: , , , ,
Posted in Magento | No Comments »