Page 1 of 1
Change color of selected currency
Posted: Fri Sep 29, 2017 7:58 pm
by WellChuck
Hi all,
Please excuse me for this question...
But, how i can change color if selected currency?

Re: Change color of selected currency
Posted: Fri Sep 29, 2017 11:02 pm
by yodapt
Change how? Whats the url of the store?
Re: Change color of selected currency
Posted: Sat Sep 30, 2017 12:50 am
by DigitCart
Hi,
If I understand you, edit this file:
Code: Select all
catalog\view\theme\default\template\common\currency.tpl
Find:
Code: Select all
<?php if ($currency['symbol_left']) { ?>
<li><button class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_left']; ?> <?php echo $currency['title']; ?></button></li>
<?php } else { ?>
<li><button class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_right']; ?> <?php echo $currency['title']; ?></button></li>
Change it it:
Code: Select all
<?php if ($currency['symbol_left']) { ?>
<li><button <?php echo $code == $currency['code'] ? 'style="color:red"' : ''; ?> class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_left']; ?> <?php echo $currency['title']; ?></button></li>
<?php } else { ?>
<li><button <?php echo $code == $currency['code'] ? 'style="color:red"' : ''; ?> class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_right']; ?> <?php echo $currency['title']; ?></button></li>
<?php } ?>
As you can see, I added
Code: Select all
<?php echo $code == $currency['code'] ? 'style="color:red"' : ''; ?>
Tested with OC 2.3, Default theme.

Re: Change color of selected currency
Posted: Mon Oct 02, 2017 4:53 pm
by WellChuck
DigitCart wrote: ↑Sat Sep 30, 2017 12:50 am
Hi,
If I understand you, edit this file:
Code: Select all
catalog\view\theme\default\template\common\currency.tpl
Find:
Code: Select all
<?php if ($currency['symbol_left']) { ?>
<li><button class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_left']; ?> <?php echo $currency['title']; ?></button></li>
<?php } else { ?>
<li><button class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_right']; ?> <?php echo $currency['title']; ?></button></li>
Change it it:
Code: Select all
<?php if ($currency['symbol_left']) { ?>
<li><button <?php echo $code == $currency['code'] ? 'style="color:red"' : ''; ?> class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_left']; ?> <?php echo $currency['title']; ?></button></li>
<?php } else { ?>
<li><button <?php echo $code == $currency['code'] ? 'style="color:red"' : ''; ?> class="currency-select btn btn-link btn-block" type="button" name="<?php echo $currency['code']; ?>"><?php echo $currency['symbol_right']; ?> <?php echo $currency['title']; ?></button></li>
<?php } ?>
As you can see, I added
Code: Select all
<?php echo $code == $currency['code'] ? 'style="color:red"' : ''; ?>
Tested with OC 2.3, Default theme.
Thank you so much! Problem solved C=
Re: Change color of selected currency
Posted: Mon Oct 02, 2017 4:55 pm
by DigitCart
You are welcome!