News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Remove button on VirtueMart Currency Selector

Started by hollowGod, June 15, 2012, 01:13:37 AM

Previous topic - Next topic

hollowGod

VM 2.0.6

Hi! ,

I want to remove the button on the VirtueMart Currency Selector, and instead make it so the change happen when you choose a currency in the dropdown list.
How can I change the code to make this happen?
Is it possible to change the text color inside the dropbox?

This is the code that need to be changed:
<!-- Currency Selector Module -->
<?php echo $text_before ?>
<form action="<?php echo JURI::getInstance()->toString(); ?>" method="post">
<br />
<?php echo JHTML::_('select.genericlist'$currencies'virtuemart_currency_id''class="inputbox"''virtuemart_currency_id''currency_txt'$virtuemart_currency_id) ; ?>
    <input class="button" type="submit" name="submit" value="<?php echo JText::_('MOD_VIRTUEMART_CURRENCIES_CHANGE_CURRENCIES'?>" />
</form>



hollowGod

hollowGod

#1
I solved it

srajca

Do you mind sharing how you solved it? Also is there a way to use icons instead of dropdown?

hollowGod

Hi srajca

go to  ... modules\mod_virtuemart_currencies\tmpl\default.php

and change this <!-- Currency Selector Module -->
<?php echo $text_before ?>
<form action="<?php echo JURI::getInstance()->toString(); ?>" method="post">
<br />
<?php echo JHTML::_('select.genericlist'$currencies'virtuemart_currency_id''class="inputbox"''virtuemart_currency_id''currency_txt'$virtuemart_currency_id) ; ?>
    <input class="button" type="submit" name="submit" value="<?php echo JText::_('MOD_VIRTUEMART_CURRENCIES_CHANGE_CURRENCIES'?>" />
</form>


to this

<!-- Currency Selector Module -->
<?php echo $text_before ?>
<form action="<?php echo JURI::getInstance()->toString(); ?>" method="post">
    <br />
    <?php echo JHTML::_('select.genericlist'$currencies'virtuemart_currency_id''class="inputbox" onchange="this.form.submit()"''virtuemart_currency_id''currency_txt'$virtuemart_currency_id) ; ?>
</form>


about the icons I am not sure , have not looked into that .. sorry , maybe someone else have a solution for that :)


hollowGod

rzrz

thanks this is helpful. However have u had any solution to switch to icons?

Thanks


mark R

Hi all
Did anyone find how to change this drop down to a list ( only need GBP and Euro )

Would prefer to show just the symbols £

VM 2.6.6

Any help would be much appreciated.
Seek and ye shall find.........
4 VM sites and counting

susanacaetano

I tried this code but it did not work out.

I am using the virtuemart 3.

Someone can help me?

Dragoner

Hi, it is possible to show only symbols?

Like there

www.fispo.cz
(top right)
Thanks so much.

Dragoner

I solved it. It is not so clean, but funcion ;)

This is my jssubmit.php from ../modules/mod_virtuemart_currencies/tmpl/


<?php // no direct access
defined('_JEXEC') or die('Restricted access');
vmJsApi::jQuery();
vmJsApi::chosenDropDowns();
?>


<!-- Currency Selector Module -->
<?php echo $text_before ?>
     

<div class="changeSendForm" action="<?php echo vmURI::getCleanUrl() ?>">
<a href="<?php echo $_SERVER['REQUEST_URI']; ?>?virtuemart_currency_id=33">Kč</a>
<a href="<?php echo $_SERVER['REQUEST_URI']; ?>?virtuemart_currency_id=47">Eur</a>
</div>




<?php 
$j 
'jQuery(document).ready(function() {

jQuery(".changeSendForm")
.off("change",Virtuemart.sendCurrForm)
    .on("change",Virtuemart.sendCurrForm);
})'
;

vmJsApi::addJScript('sendFormChange',$j);

echo 
vmJsApi::writeJS();


where virtuemart_currency_id=XX is virtuemart_currency_id from database table _virtuemart_currencies.

David

Dragoner

I modified a file to work switching between currencies, script before was bad ;)


<?php // no direct access
defined('_JEXEC') or die('Restricted access');
vmJsApi::jQuery();
vmJsApi::chosenDropDowns();
?>



<?php 
$link
=substr($_SERVER['REQUEST_URI'], 0strpos($_SERVER['REQUEST_URI'], '?'));
$hosturl 'http://' $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

?>

<!-- Currency Selector Module -->
<?php echo $text_before ?>
     

<div class="changeSendForm" action="<?php echo vmURI::getCleanUrl() ?>">
<a href="<?php  
if (strpos($hosturl'?virtuemart_currency_id=47') == true) echo $link '?virtuemart_currency_id=33';
else echo 
$hosturl '?virtuemart_currency_id=33';
 
?>
"> Kč  </a>
  <a href="<?php  
if (strpos($hosturl'?virtuemart_currency_id=33') == true) echo $link '?virtuemart_currency_id=47';
else echo 
$hosturl '?virtuemart_currency_id=47';
 
?>
"> Eur </a>
</div>

<?php 
$j 
'jQuery(document).ready(function() {

jQuery(".changeSendForm")
.off("change",Virtuemart.sendCurrForm)
    .on("change",Virtuemart.sendCurrForm);
})'
;

vmJsApi::addJScript('sendFormChange',$j);

echo 
vmJsApi::writeJS();