Opencart - which language was used during checkout? - localization

I am getting translators involved to get my opencart shop into multiple languages and I want to pay them on commission for all orders made in their language (not country). At the moment I cannot tell which language a person has ordered in.
Anyone know a way to tell which language a customer was using during checkout.
Ideally this would be built into Opencart or an extension.

This is something that is saved in your database with the order itself (in the order table). You will see there is a field called language_id which relates to the relevant language in the language table. This is the only way to find this information out by default (though there may be mods that let you know this information on the extension store)

Related

ASP.NET MVC get list of cities by country without Database.

I need to do something like:
Show list of countries >> Select country -> show list of Cities.
So I have to get a list of cities by country but without using data in database.
Can anyone please suggest me a solution ?. I really appreciate your help.
You could use an API but the problem is that you will have a request everytime your page load. Not every API provider will allow this. For example, Here is an API that gets Country / Cities.
Another solution as you are using .NET technologies is to use a localDB. A localDB is in fact a database but within your app. Have a look to the definition on the MSDN :
It is very easy to install and requires no management, yet it offers the same T-SQL language, programming surface and client-side providers as the regular SQL Server Express. If the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too.
Finely, the last solution that comes in mind if you can't use XML or JSON files nor a LocalDB is to have your lists in classes but in my opinion you should avoid this solution, it will simply load everything in RAM until you application stops, as HDD cost less that RAM I really think the better option is to use XML or JSON files in your app.
You can store the info into a text file or even into a static class in your code (not exactly a great idea, but doable).
Then you just need to get the info from the container and build two SelectList items, one for countries and one for cities.
Use javascript to link change event of countries SelectList to a filtered reload of cities SelectList
Assuming you have a preset list of cities by country, and you really cannot use any sort of database, then perhaps just use text files? One text file for the list of countries and then one file per country with the list of cities. Read in the text file and display as needed.

Locale based information on International site

We're building an education platform. The site it's going to be published in different countries, having each country its own subfolder. For example,
France: http://myedusite.com/fr/
Spain: http://myedusite.com/es/
The site has courses belonging to providers
courses have different themes (Arts, Business, Science) and these themes have sub-themes (I'm planning to use ancestry to have a tree structure model)
Courses
providers can create courses if they have an account. The courses created will be published only in the domain they were created.
As an example, if I'm a course's provider and I create an account in http://myedusite.com/fr/, then the courses I create should only be published in http://myedusite.com/fr/.
For this purpose, I thought of defining a Country model with the field iso_3166. This field would be populated with the country codes defined in ISO 3166.
Then, the courses would have a target_country (class: Country), enabling the possibility of choosing where the course is published (if the course's target_country is France it should only be visible in http://myedusite.com/fr/).
Themes
For themes happens something similar, where for each country where the site exists there can be different themes. When a user arrives to http://myedusite.com/xx/, only themes existing in country "xx" will be shown. That implies that each theme should belong to a country.
On the other hand, each course would have one theme.
For dealing with country related information (for example loading cities for a country) I thought of using the country gem.
From the business perspective, we have chosen a bottom-top approach, meaning that only the necessary things are built now, adding features as it's needed.
I see this as a reasonable strategy to make the site international. What I'm afraid of is of choosing wrong and having trouble on the future as new features arrive. I would like to have as much flexibility as possible.
It's the first time I design an international project. Is the approach I've thought of something usual in this kind of sites? Anything I should pay attention to that I didn't mention?
I use navigator.language to get the locale and redirect from JS to whatever URL I want, or add it as a query string. In your case since you only want the language you should split it first, then redirect. In my case I use the full locale code because en is different from AU, US, CA, GB and so on, you'd probably want to consider doing the same especially if you will be displaying prices, dates and so on.
I think there is a way to get this with Rails too, see the Accept-language, accept charset headers.
Once you pass the language/locale to your controller you can then filter data as required.
This also leaves room for some nice SEO tricks if you set up a custom 404 page, engines will go for this.

Amazon Product API - How to get items for sale by price?

I have a strage requirement from a client, he needs to display a ramdom selection (100 - 200 items from mixed categories) of products for sale on & shipped by Amazon but ordered by price. The idea is to allow people find gift ideas based a user input price point.
I have been looking through the API docs but cannot see an obvious way to find search by price, I am thinking of writing a script to "copy" large parts of the amazon product catalogue into a local database & have it update every few weeks, then use this for user searches, but this does not feel right / their must be a better way.
Has anyone any experience with this type of problem? Thanks!
You would want to use the Amazon Product Advertising API. Using this API you would want to perform a SearchIndex-ItemSearch query. Possible parameters to ItemSearch are available on the API Docs here
You can see in the docs that you cannot query by MinimumPrice and MaximumPrice on SearchIndex: All. However, if you search specific indexes, it allows you to do a price related search.
I would guess that you can agree with your client which categories should the items be from. Then you can just query them one by one.
Amazon's database changes very often. Hence, caching data for a week without updating may not be desirable.

How to design a simple keyword content delivery mechanism that functions like Adwords

I'm have application that allows users to store food diary entries of approximately 140 characters in length. I am looking for a solution that will allow me to tie content modules (think tips for healthy eating) to the user's diary entries based on keywords in the entry similar to what Google does with adwords. Are there any out-of-the-box solutions that can do that in Rails?
Here are the specific requirements:
User logs food diary entry
In the user's food diary, if there's a specific tip that matches a keyword for the entry, then the tip is displayed next to the entry
Tips would be defined through an admin tool where the admin specifies the tip content and keywords that would make it appear in the diary
Trying to figure out a) if there's a pre-build solution I could use for something like this or b) what the best approach would be for performance since the users's food diary might have 20 entries per page, and each entry would have to be evaluated to see if there are any corresponding tips that match entry keywords.
For designing a home-grown solution, one idea I had was to make the tip associations when a new food entry is stored like this:
user adds a food entry
after_save a callback method breaks apart the entry into keywords and searches the tips model for matches
if there's a match, it's stored in an association table when new entries are created rather then when the user's food diary is rendered in the web page.
There's a performance hit on storing new entries, but it might allow the user's diary to load faster then doing all those look-ups when the diary is rendered.
Does that make sense, or is there a better way? better yet, are there tools that can accomplish what I'm trying to do?
Thanks!
This is not an AdWords API question, but I'll take a shot:
I would move the association table building into an offline task / cronjob. That would take care of the performance overhead when creating new entries, and users would be generally okay with a message like "Tips are being generated, please be patient" if they happen to view the topic too soon.
I'm not aware of any existing solutions, but this sounds like a hashtag system to me. Basically you have two lists (food dairy entries, tips), you want to assign hashtags to both lists and then pair entries with same hashtags. Googling for a hashtag system / library might be a good starting point.
Cheers,
Anash

Prestashop Translation

I have imported some other languages to my shop. When I change the language, all the fields are changed (items, categories, etc...) but products (name, description) and categories are in English.
I understand these language will not change but I also want those languages to be changed. How can I do that?
you need to change them manually
when you create new language, you'll see its flag next to the input fields, just click it and you can enter the text in that language you select
Prestashop (1.4) comes in 5 languages, and you can get language packs for many other languages (some more complete than others), that were contributed by members.
However, Prestashop will not automatically translate anything that you manually added to your shop (IE Categories, Products, CMS pages, Modules, etc..), you can either manually enter the translations, or you can use a module to automatically translate those using google translate.
You can see an example of a module that does automatic translation at http://www.presto-changeo.com/en/prestashop-modules/19-website-translator.html
Yes, you have to translate them manually. The packs are only available for default products.
You also can install a module to translate it automatically (probably utilizing Google Translate). But if you are selling, I don't think you should do that. As the automatic translation sometimes sounds funny. IT HURTS YOUR PROSPECT CUSTOMERS and you are loosing sale.

Resources