-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e862ff5
commit a17018b
Showing
79 changed files
with
6,015 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
DYNAMIC FORM FOR SHOPPING CART | ||
|
||
Plugin needs to generate a form that will be automatically inserted below <!-- Dynamically-generated form --> in this file: storefront/view/default/template/blocks/language.tpl | ||
|
||
Example of form output: | ||
|
||
<form action="" method="post" enctype="multipart/form-data" name="frmdata" onsubmit="return checkData(this)"> | ||
<select name="lang" id="lang" style="width:150px; font-size :10pt; font-family:Arial, Helvetica, sans-serif; text-transform: uppercase;"> | ||
<option value='ar' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag ar-lg" data-title="العربية">العربية</option> | ||
<option value='cn' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag cn" data-title="汉语/漢語">汉语/漢語</option> | ||
<option value='de' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag de" data-title="Deutsch">Deutsch</option> | ||
<option value='el' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag gr" data-title="ελληνικά">ελληνικά</option> | ||
<option value='en' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag us" data-title="English" selected="selected">English</option> | ||
<option value='es' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag es" data-title="Español">Español</option> | ||
<option value='fr' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag fr" data-title="Français">Français</option> | ||
<option value='it' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag it" data-title="Italiano">Italiano</option> | ||
<option value='pt' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag br" data-title="Português">Português</option> | ||
<option value='ro' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag ro" data-title="Română">Romanian</option> | ||
<option value='ru' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag ru" data-title="русский">русский</option> | ||
<option value='tr' data-image="extensions/smart_translator/msdropdown/images/msdropdown/icons/blank.gif" data-imagecss="flag tr" data-title="Türkçe">Türkçe</option> | ||
</select> | ||
</form> | ||
|
||
The form data is generated by the user when they fill out a form at msdropdown/examples/submitdata.php | ||
|
||
PLEASE NOTE: To simulate data entry, upload this to your server and go to dynamic_form_project/interace.html | ||
|
||
Below is an example of a text output that shows English as the source language, and French, Portuguese and Spanish as the target languages. An image screenshot of the output is available at image/preview4.jpg. | ||
|
||
Array | ||
( | ||
[lang_1] => en | ||
[flag_1] => us | ||
[lang_name_1] => English | ||
[lang_2] => Array | ||
( | ||
[0] => fr | ||
[1] => pt | ||
[2] => es | ||
) | ||
|
||
[flag_2] => Array | ||
( | ||
[0] => fr | ||
[1] => br | ||
[2] => es | ||
) | ||
|
||
[lang_name_2] => Array | ||
( | ||
[0] => Fran�ais | ||
[1] => Portugu�s | ||
[2] => Espa�ol | ||
) | ||
|
||
[send] => Submit | ||
) | ||
|
||
VERY IMPORTANT: For some reason, jquery is not outputting the language names in html characters and this needs to be fixed. For example, it shows Fran�ais instead of Français. This needs to be fixed since it will be a problem when the browser renders the page view. | ||
For the three language names above, the correct output should be: | ||
|
||
[0] => Français | ||
[1] => Português | ||
[2] => Español | ||
|
||
NOTES: | ||
|
||
lang_1, flag_1 and lang_name_1 refer to the source language, i.e. the language translating from. | ||
|
||
lang_2, flag_2 and lang_name_2 refer to the target language(s), i.e. the language(s) translating to. | ||
|
||
option value refers to lang_1 or lang_2 abbreviation. Examples: en (English), pt (Portugu�s), es (Espa�ol) | ||
|
||
data-title refers to the name of the language in the language. Example: Espa�ol (Spanish) | ||
|
||
data-imagecss refers to flag_1 or flag_2. It consists of the word "flag" followed by a space plus the country flag abbreviation. Examples: flag us | ||
|
||
data-image has the same value for all languages. | ||
|
||
The menu options need to be ranked in alphabetical order using lang_1/lang_2 abbreviations. | ||
|
||
lang_1 option must have this extra indicator: selected="selected" | ||
|
||
The onsubmit function must be changed to onchange. When language is selected from the dropdown menu, user is directed to the translated page in the language they picked. | ||
|
||
The URL language path needs to be added to the form. The language path is not static; it changes based on the referral URL. The referral URLs are as follows: | ||
|
||
lang_1: [http protocol]://[lang_1][referral url] Example: https://assistech.com/store/vision | ||
|
||
lang_2: [http protocol]://[lang_2][referral url] Examples: https://es.assistech.com/store/hearing, https://fr.assistech.com/mobility, etc. | ||
|
||
The form content changes dynamically everytime the user makes a new selection. | ||
|
||
The form output will be displayed in the language menu at https://assistech.com/up127/ or any Abantecart user that wants to add translation to their website. | ||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.