You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Magento 2.2.0切换中英文商店时货币符号丢失问题求助

Fixing Missing Currency Symbols When Switching to Arabic Store in 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 to Stores > 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 SAR and 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
  • 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_SA
    

    You can also manually delete the contents of pub/static and var/cache directories 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 at app/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 in vendor/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 the core_config_data table 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/sar entry 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:19:53