[ 
https://issues.apache.org/jira/browse/OFBIZ-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14391936#comment-14391936
 ] 

Sebastian Wachinger commented on OFBIZ-4412:
--------------------------------------------

I can confirm that in trunk as of now this description by [~mz4wheeler] still 
is valid, i.e. prices calculated from the foreign exchange rate table are not 
displayed on the _product detail page_.
It perfectly works though in the _cart view page_ since 
[r1592977|http://svn.apache.org/viewvc?view=revision&revision=r1592977].
After I fixed 
[ProductDetail.groovy|http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?diff_format=h&view=log]
 as shown in 
[ShoppingCartItem.java|http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?r1=1592977&r2=1592976&pathrev=1592977]
 this issue is solved.

~(If it is preferable to start a new thread instead of bringing this up here, 
please let me know.)~

> Set initial ecommerce Locale/Currency based on mount point specified in 
> specialpurpose/ecommerce/ofbiz-component.xm
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4412
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4412
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: specialpurpose/ecommerce
>    Affects Versions: Trunk
>         Environment: Not specific
>            Reporter: mz4wheeler
>            Assignee: Jacques Le Roux
>            Priority: Trivial
>              Labels: patch
>         Attachments: OFBIZ-4412.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Using the specified patch, it is now possible to set a users initial Locale 
> (and even currency) based on the webapp mount point.  This works with a 
> single store, and does not require the use virtual hosts.  This is especially 
> useful when setting up sitemap.xml, which allows crawlers (like google) to 
> correctly locate and traverse products and services in multiple languages.
> Here is an example where "ecomclone" has been modified to Locale=fr with a 
> mount point of "/fr".
> specialpurpose/ecommerce/ofbiz-component.xml:
> <!--  <init-param name="Currency" value="EUR"/> -->
>     <webapp name="ecommerce"
>         title="eCommerce"
>         server="default-server"
>         location="webapp/ecommerce"
>         mount-point="/ecommerce"
>         app-bar-display="false">
>     </webapp>
>     <webapp name="ecomclone"
>         title="eCommerce Clone"
>         server="default-server"
>         location="webapp/ecomclone"
>         mount-point="/fr"            <------- SPECIFY MOUNT
>         app-bar-display="false">
>         <init-param name="Locale" value="fr"/>  <------- SPECIFY LOCALE
>     </webapp>
> The below sitemap.xml would allow products with the "/fr" path to be indexed 
> in french.
> <?xml version="1.0" encoding="UTF-8"?>
> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9";>
> <url><loc>http://ofbizsite.com/ecommerce/products/10002/p_1001TANGRAMPUZ</loc></url>
> <url><loc>http://ofbizsite.com/fr/products/10002/p_1001TANGRAMPUZ</loc></url>
> </urlset>
> The patch:
> The attached patch modifies setDefaultStoreSettings in ProductEvents.java, 
> which is called once during the initial session creation.  
> After a user enters the URL, they are still free to modify the language, as 
> long as the page supports it (like the default demo store).  The patch also 
> allows the Currency to be forced as well, and it does appear to work, but 
> should be more throughly tested.
> Although this patch bypasses the requirement for multiple stores, there may 
> be issues with other aspects of the store, like emails.  However, it is no 
> different than a user who enters your English-based ecommerce store, selects 
> "french", and attempts a checkout.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to