it.ti.teczo Posted December 11, 2018 Share Posted December 11, 2018 Hello, I'm new to web programming with Prestashop 1.7 I'm having a problem with this. My website is in English, Vietnamese. And I get the current page link to share facebook this way: <a href="http://www.facebook.com/sharer.php?u={$urls.current_url}"> The trouble is that when I use the web in Vietnamese, {$ urls.current_url} will be in Vietnamese url. When I use the web in English, {$ urls.current_url} will be in the English url. I do not want that. I want the URL fixed in Vietnamese language. This means that even if you surf the web, it will only take the current page URL with the id of the Vietnamese language. I need some help. Sorry for my english. Thank you. Link to comment Share on other sites More sharing options...
musicmaster Posted December 11, 2018 Share Posted December 11, 2018 Smarty is a language. So you can do operations in it. In your case that would mean that you would replace {$urls.current_url} with {$urls.current_url|replace: '/en/' : '/vn/'} 1 Link to comment Share on other sites More sharing options...
it.ti.teczo Posted December 12, 2018 Author Share Posted December 12, 2018 8 hours ago, musicmaster said: Smarty is a language. So you can do operations in it. In your case that would mean that you would replace {$urls.current_url} with {$urls.current_url|replace: '/en/' : '/vn/'} Hi, thank you. I have done your way. It works but not perfect. Not my intention. For example: Use: {$urls.current_url|replace: '/en/' : '/vn/'} Web language: Vn => aabbcc.c0m/vn/trang-chu.html Web language: En => aabbcc.c0m/vn/home.html (instead of: aabbcc.c0m/en/home.html) I do not want that. I want: Web language: Vn => aabbcc.c0m/vn/trang-chu.html Web language: En => aabbcc.c0m/vn/trang-chu.html I need some help. Sorry for my english. Thank. Link to comment Share on other sites More sharing options...
it.ti.teczo Posted December 14, 2018 Author Share Posted December 14, 2018 Help me! Link to comment Share on other sites More sharing options...
musicmaster Posted December 14, 2018 Share Posted December 14, 2018 What is the problem? The customer won't notice the difference as long as development mode is switched off. Link to comment Share on other sites More sharing options...
it.ti.teczo Posted December 22, 2018 Author Share Posted December 22, 2018 (edited) Problem when using facebook comment. Web language: Vn <div class="fb-comments" data-href="https://###.com/vn/sony/ong-kinh-sony-fe-70200gm.html" data-numposts="5"> </div> Web language: En <div class="fb-comments" data-href="https://###.com/en/sony/sony-fe-70-200mm-f28-gm-oss-lens.html" data-numposts="5"> </div> There are 2 different comments on 1 product due to different urls. I use <div class="fb-comments" data-href="{$urls.current_url}" data-numposts="5"> </div> Edited December 22, 2018 by it.ti.teczo (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now