Post by WellChuck » Fri Sep 29, 2017 7:58 pm

Hi all,
Please excuse me for this question...
But, how i can change color if selected currency? :ponder:

Newbie

Posts

Joined
Fri Sep 29, 2017 7:54 pm

Post by yodapt » Fri Sep 29, 2017 11:02 pm

Change how? Whats the url of the store?

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by DigitCart » 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.

Image

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by WellChuck » Mon Oct 02, 2017 4:53 pm

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.

Image
Thank you so much! Problem solved C=

Newbie

Posts

Joined
Fri Sep 29, 2017 7:54 pm

Post by DigitCart » Mon Oct 02, 2017 4:55 pm

You are welcome!

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm

Who is online

Users browsing this forum: No registered users and 172 guests