Magento 2.2.0切换中英文商店时货币符号丢失问题求助
Hey there, let's work through this currency symbol issue you're hitting when switching to your Arabic store in Magento 2.2.0. I see you already tried modifying the ar_SA.xml file in the Zend Framework directory, but that didn't resolve things—no sweat, let's walk through some more targeted solutions:
Double-check Magento backend currency configurations
Head over toStores > Configuration > General > Currency Setup, and make sure you're switching to your Arabic store view (not the default view). Verify:- The Currency Symbol for SAR is explicitly set (try both
SARand the Arabic symbolر.سto see which works) - SAR is included in Allowed Currencies, and your Base/Default/Display currencies are correctly assigned for the Arabic store
- The Currency Symbol for SAR is explicitly set (try both
Clear all caches and redeploy static content
Cached configs or outdated static files often cause this kind of display glitch. Run these commands via your server terminal:php bin/magento cache:clean php bin/magento cache:flush php bin/magento setup:static-content:deploy ar_SAYou can also manually delete the contents of
pub/staticandvar/cachedirectories if the commands don't fully clear things out.Inspect your theme's currency template files
Custom themes sometimes override Magento's default pricing templates. Check if your theme has a file atapp/design/frontend/[YourVendor]/[YourTheme]/Magento_Theme/templates/pricing/amount/default.phtml. Ensure it's using the correct method to pull the currency symbol—like$block->getDisplayCurrencySymbol()—instead of hardcoding symbols that won't switch with store views.Fix the Zend Locale file properly (don't delete nodes)
Instead of deleting the<numbers>section invendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml, restore the original content and modify the currency format pattern to fit right-to-left Arabic display. Try updating it to:<numbers> <currencyFormats numberSystem="latn"> <currencyFormatLength> <currencyFormat type="standard"> <pattern>#0.00 ¤</pattern> </currencyFormat> </currencyFormatLength> </currencyFormats> </numbers>This places the currency symbol after the number, which aligns with Arabic reading direction. After making this change, rerun the cache and static content commands from earlier.
Verify database-level currency settings
If backend configs aren't sticking, check thecore_config_datatable for store-specific currency values. Run this SQL query (replace[your_arabic_store_id]with your actual store ID):SELECT * FROM core_config_data WHERE path LIKE '%currency%' AND store_id = [your_arabic_store_id];Make sure the
currency/symbol/sarentry exists and has the correct symbol value. If it's missing, save the currency config again in the backend to generate it, or insert it manually.
If none of these steps work, take a look at var/log/system.log and var/log/exception.log for any errors related to locale or currency handling—those can often point you to the root cause.
内容的提问来源于stack exchange,提问作者Faizan

