feat(currency): add Iranian Rial support #241
feat(currency): add Iranian Rial support #241superdav42 merged 1 commit intoUltimate-Multisite:mainfrom
Conversation
WalkthroughAdded Iranian Rial (IRR) support by updating currency lists, symbol mapping, and zero-decimal handling within existing currency utility functions in inc/functions/currency.php. No function signatures changed; all updates are data additions inside current public functions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
inc/functions/currency.php (2)
160-160: Consider maintaining alphabetical order in the currency list.The IRR entry is correct, but it's appended at the end rather than in alphabetical position. To maintain consistency with the rest of the currency list (which appears alphabetically sorted by currency code), consider placing IRR between 'INR' (line 77) and 'ISK' (line 78).
Apply this diff to move IRR to its alphabetical position:
'INR' => __('Indian Rupee', 'ultimate-multisite'), + 'IRR' => __('Iranian Rial', 'ultimate-multisite'), 'ISK' => __('Icelandic Króna', 'ultimate-multisite'),And remove the duplicate entry from line 160:
'ZMW' => __('Zambian Kwacha', 'ultimate-multisite'), - 'IRR' => __('Iranian Rial', 'ultimate-multisite'), ]
433-433: Consider maintaining alphabetical order in the zero-decimal currency list.IRR is correctly classified as a zero-decimal currency (consistent with how payment processors like Stripe handle Iranian Rial). However, to maintain consistency with the alphabetically sorted list, consider placing IRR between 'GNF' and 'JPY'.
Apply this diff to move IRR to its alphabetical position:
'GNF', // Guinean Franc + 'IRR', // Iranian Rial 'JPY', // Japanese YenAnd remove the duplicate entry from line 433:
'XPF', // CFP Franc - 'IRR', // Iranian Rial ];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
inc/functions/currency.php(3 hunks)
🔇 Additional comments (1)
inc/functions/currency.php (1)
196-198: LGTM! Symbol mapping is correct.The Rial symbol '﷼' (U+FDFC) is properly mapped for IRR. The implementation follows the existing pattern in the switch statement.
|
@mahyarrezghi Just wondering which payment method you will be using because I don't think stripe supports IRR |
|
@superdav42 That’s right, nearly all global payment gateways don’t support IRR. I created an MU-plugin to integrate one of the Iranian payment gateways instead. |
Added Iranian Rial (IRR) as a supported payment currency in the Ultimate plugin.
Includes:
Summary by CodeRabbit