VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: hollowGod on June 15, 2012, 01:13:37 AM

Title: Remove button on VirtueMart Currency Selector
Post by: hollowGod on June 15, 2012, 01:13:37 AM
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
Title: Re: Remove button on VirtueMart Currency Selector
Post by: hollowGod on June 16, 2012, 02:52:22 AM
I solved it
Title: Re: Remove button on VirtueMart Currency Selector
Post by: srajca on June 26, 2012, 23:40:38 PM
Do you mind sharing how you solved it? Also is there a way to use icons instead of dropdown?
Title: Re: Remove button on VirtueMart Currency Selector
Post by: hollowGod on June 28, 2012, 23:50:46 PM
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
Title: Re: Remove button on VirtueMart Currency Selector
Post by: rzrz on January 31, 2013, 06:30:24 AM
thanks this is helpful. However have u had any solution to switch to icons?

Thanks
Title: Re: Remove button on VirtueMart Currency Selector
Post by: Rahul_D_Legend on April 18, 2013, 14:17:08 PM
Thanks a lot hollowGod  :)
Title: Re: Remove button on VirtueMart Currency Selector
Post by: mark R on July 07, 2014, 23:10:13 PM
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.
Title: Re: Remove button on VirtueMart Currency Selector
Post by: susanacaetano on October 25, 2015, 22:49:08 PM
I tried this code but it did not work out.

I am using the virtuemart 3.

Someone can help me?
Title: Re: Remove button on VirtueMart Currency Selector
Post by: Dragoner on September 09, 2016, 09:01:33 AM
Hi, it is possible to show only symbols?

Like there

www.fispo.cz  (http://www.fispo.cz) (top right)
Thanks so much.
Title: Re: Remove button on VirtueMart Currency Selector
Post by: Dragoner on September 09, 2016, 14:46:09 PM
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
Title: Re: Remove button on VirtueMart Currency Selector
Post by: Dragoner on September 11, 2016, 19:01:27 PM
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();