Plone, GetPaid and the euro symbol
October 2018
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
About
This site is an effort to share some of the base knowledge I have gathered through all this years working with Linux, FreeBSD, OpenBSD, Python or Zope, among others. So, take a look around and I hope you will find the contents useful.
Recent Entries
Recent Comments
Recent Trackbacks
Categories
OpenBSD (9 items)
BSD (0 items)
FreeBSD (19 items)
Linux (3 items)
Security (3 items)
Python (22 items)
Zope (13 items)
Daily (144 items)
e-shell (9 items)
Hacks (14 items)
PostgreSQL (3 items)
OSX (8 items)
Nintendo DS (0 items)
enlightenment (0 items)
Apache (3 items)
Nintendo Wii (1 items)
Django (24 items)
Music (12 items)
Plone (7 items)
Varnish (0 items)
Lugo (2 items)
Sendmail (0 items)
europython (7 items)
Cherokee (1 items)
self (1 items)
Nature (1 items)
Hiking (0 items)
uwsgi (0 items)
nginx (0 items)
cycling (10 items)
Networking (1 items)
DNS (0 items)
Archives

Syndicate this site (XML)

RSS/RDF 0.91

14 noviembre
2008

Plone, GetPaid and the euro symbol

or replacing the currency symbol in getpaid

Plone is currently our CMS-of-choice for almost every project. It was a matter of time that one of our customers finally asks us for an online-shop website. Well, what now? If you do some research mostly everyone is using OSCommerce, Zencart or more recently Magento. Of course everyone will have different oppinions here, the old-and-monolitic oscommerce, it's descendant zencart, the new web-2.0 magento... and there are even some more projects out there.

For me the problem is that all of them are built on top of PHP (which is not a real problem anyway, but...) and they will not integrate so smoothly with my existing production deployment (which is a real problem, that is, adding some more stuff to maintain in the production servers).

So what should I do? I use getpaid. Getpaid is an addon product for Plone that integrates easily on top of the CMS and allow admins to mark any content (really __any__ content!) as buyable/shippable/donatable and more. This is an incredible powerful approach to e-commerce, as you do not have limitation when adding products to your shop. You can use the powerful content types management behind plone and then mark your contents as buyable (a page with a product description and pictures of it, a folder full of pages or whatever else you would like to sell).

After marking that content as buyable, getpaid transparently adds some information to the content, so users could add it to the shipping cart, buy it, etc.

Of course getpaid is a development product, that is, it is not a finished product and it lacks of some features, and that's the reason for that post.

One of those features I missed while setting up a new e-commerce site is the hability to change the shop currency (from USD to EUR for example) as well as the fact that you can't have multiple currencies at the same time (as far as I know).

So, what if you need to change the USD symbol ($) and use the EUR symbol (€) instead?

Well, it is pretty easy:

  • First, go to your Zope instance Products folder or, if you are using buildout, to your $buildout_dir/parts/productdistros/PloneGetPaid. There you will find the interfaces.py file, edit it, locate the IGetPaidManagementCurrencyOptions class and replace:

    currency_symbol = schema.TextLine( title = _(u"Currency Symbol"),
                                   required = True,
                                   default = u"$"
                                 )
    

    with

    currency_symbol = schema.TextLine( title = _(u"Currency Symbol"),
                                   required = True,
                                   default = u"€"
                                 )
    

    There are some other parameters there for the currency thing, but forget them for now (I hope real support for this will be added soon to the project :D)

  • Second, go to the i18n directory located just in the same directory as the interfaces.py file, locate your language .po file (plonegetpaid-es.po for spanish), edit it and replace:

    #. Default: "Price: $ ${value_price}"
    #: ./browser/templates/portlet-content-buyable.pt:33
    msgid "text_price"
    msgstr "Precio: $ ${value_price}"
    

    with:

    #. Default: "Price: $ ${value_price}"
    #: ./browser/templates/portlet-content-buyable.pt:33
    msgid "text_price"
    msgstr "Precio: € ${value_price}"
    

    or, if you prefer:

    #. Default: "Price: $ ${value_price}"
    #: ./browser/templates/portlet-content-buyable.pt:33
    msgid "text_price"
    msgstr "Precio: ${value_price} €"
    

    There is another .po file in this directory (plonegetpaid-plone-es.po) but you do not need to change anything in there.

  • Third, go to your Zope instance ZMI (Zope Management Interface) then click on Control_Panel and then on Placeless Translation Service, locate the translation catalog for you language (PloneGetPaid.i18n-plonegetpaid-es.po for the spanish translation) and click on the Reload this catalog button.

  • Et Voilá!, reload your e-commerce site in your favourite browser to check if the symbol was changed correctly.

Of course, this is a quick-and-dirty hack. As proper currency configuration (and probably conversion tools) will be added sooner to getpaid (or I hope so!).

Posted by wu at 17:34 | Comments (0) | Trackbacks (0)
<< Seguro del hogar, ¿para que? | Main | A week since the WPD >>
Comments
There are no comments.
Trackbacks
Please send trackback to:http://blog.e-shell.org/122/tbping
There are no trackbacks.
Post a comment