المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : سكريبت Whmcs كيفية اضافة ايقونات الاعلام / الدول language flags



Rise Company
20-11-2021, 22:32
سكريبت Whmcs كيفية اضافة ايقونات الاعلام / الدول language flags
How to add country flags? - how to change flag? - to change language flags on v8
How to use icons in WHMCS to select the language in client area

https://www.rise.company/upload/uploads/16374445432441.png


WHMCS has flags for the following currencies as standard; AUD, CAD, EUR, GBP, INR, JPY, USD and ZAR. If any of these currencies are configured, a flag will appear on the shopping cart for new signups to select as shown above.

In this example I will be adding Chinese Yuan (CNY) and modifying the Modern template,
but you can also follow this same technique with the Slider template.

على سبيل المثال : الصين او وضع مصر


So to add flags for more currencies, first obtain or create a flag image measuring 16px by 11px and then upload it to the whmcs/assets/img/flags directory.

Next we need to copy the order form template to give us one we can customize.
So duplicate the /templates/orderforms/modern directory and name it whatever you like,

https://www.rise.company/upload/uploads/163744469274241.png

for this example I will call it 'moderncustom'.


Open /templates/orderforms/moderncustom/products.tpl and look for line 26:

{elseif $curr.code eq "EUR"}eu
{elseif $curr.code eq "GBP"}gb
{elseif $curr.code eq "INR"}in
{elseif $curr.code eq "JPY"}jp
{elseif $curr.code eq "USD"}us
{elseif $curr.code eq "ZAR"}za
{else}na{/if}.png" border="0" alt="" /> {$curr.code} (http://3.12.123.82/96174/cart.php?gid={$gid}&currency={$curr.id})

Replace it with:

{elseif $curr.code eq "EUR"}eu
{elseif $curr.code eq "GBP"}gb
{elseif $curr.code eq "INR"}in
{elseif $curr.code eq "JPY"}jp
{elseif $curr.code eq "USD"}us
{elseif $curr.code eq "ZAR"}za (http://3.12.123.82/96174/cart.php?gid={$gid}&currency={$curr.id})
(http://3.12.123.82/96174/cart.php?gid={$gid}&currency={$curr.id}){elseif $curr.code eq "EGP"}eg (http://3.12.123.82/96174/cart.php?gid={$gid}&currency={$curr.id})
{else}na{/if}.png" border="0" alt="" /> {$curr.code} (http://3.12.123.82/96174/cart.php?gid={$gid}&currency={$curr.id})

Where my flag image is called ch.png. I've highlighted the code added in the screenshot below.
The end result is a block of code on line 26 which looks like:


https://www.rise.company/forum/images/imported/2021/11/6.png

افتح هذا المسار اذى كان legacy modern هو الافتراضى لك

whmcs/templates/orderforms/legacy_modern/products.tpl

and made the exact same modification to line 47 of this file too.

Now upload the two templates files we just edited. Login to your WHMCS admin area to
select the moderncustom order form template from the Setup > General Settings > Ordering tab and you're done!

A flag image will now be displayed to visitors on the order form next to the CNY currency option.
It would just be a case of adjusting the "CNY" variable and "ch" filename in order to add as many different flags as desired.

https://www.rise.company/forum/images/imported/2021/11/5.png

الخلاصة :

0- اذهب الى مسار الاعلام وضع لوجو علم دولتك
1- شاهد داخل اعدادات whmcs اسم order template الافتراضى
2- اذهب الى مسار order template وعدل ملف باسم products.tpl
3- داخل هذا الملف ابحث مثلا us شوف الكود الخاص بها وكرره ولكن مع تغيير القيم
4- ضع الصورة فى المسار whmcs/assets/img/flags

ملحوظة :
هتجد الكود الذى هيتطلب تعديله مرتين داخل ملف products.tpl

المرجع:
http://3.12.123.82/96174/whmcs-insights-adding-custom-currency-flags
https://whmcs.community/topic/305858-how-to-change-language-flags-on-v8/
https://whmcs.community/topic/168593-v503-anyone-knows-how-to-change-flag/
https://domainregister.international/index.php/knowledgebase/340/How-to-use-icons-in-WHMCS-to-select-the-language-in-client-area.html