Hello,

I had a similar issue: products only available in certain countries. 

My solution :

1 Extend the product model as described in the manual with a
ManyToManyField to languages.
2 write a template context processor to add language information of the
user (either browser language or language of the userprofile if logged
into the template context (I do both country and language)
3 change the category.html to display/ not display certain products

alternatively you can of course implement step 2 and 3 also in
Javascript.

I would also love to have feedback whether this approach is good django
programming practice, but in any case it works. Code is available but I
do not guarantee state-of-the-art python is I restarted programming 1/2
year ago with a background of intensive 8080 assembler coding (for the
ones that still remember computer medieval).

regards,

marc


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Lucio
Sent: Sonntag, 6. Februar 2011 03:56
To: Satchmo users
Subject: Seeking advice on how to model titles (products) in
multilingual bookstore

Hi all,

I'm trying to implement a small multilingual web bookstore using
Satchmo where titles fall in one of the following classes:
(1)- title is only available in the store's default language
(2)- title is only available in a language different from store's
default
(3)- title is available in both store's default *and* another language
(i.e. there is a translation published for that title).

As for functional requirements, I'd like a user to see only what is
available in his/her selected language, e.g.,
- when the store's default language is selected, user should see
titles in (1) + (3);
- when other language is selected, user should see titles in (2) + (3)
for the selected language.

The approach that first comes to mind is to create each title in the
store's default language and enter appropriate translations in the
"Product Translations" section of the Product Admin page.  But for
titles in (3), this modeling seems to imply that there is a single
product which is just being described in multiple languages.  This
does not appear to be the case as each title/language combination will
most likely have different properties (number of pages, isbn,
publishers, etc) and thus defines a product in its own right.
Furthermore this approach doesn't seem to be appropriate for titles in
(2) where no product should exist for the store's default language,
just for the translation.

Another approach could be create each title/language as a separate
product.  For example, if the bookstore sells "Hamlet" in English,
French and German we'd have 3 different products in the catalog.
While this data model seems to reflect reality more accurately, it is
still not clear to me how I could implement the requirement of only
showing the user titles available in the selected language.

Is there a recommended way to customize Satchmo to handle what I am
trying to implement?
Any advice would be greatly appreciated!

thanks,
--lucio

-- 
You received this message because you are subscribed to the Google
Groups "Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.

Reply via email to