VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: roman5527 on May 27, 2019, 23:32:43 PM

Title: Currency module problem
Post by: roman5527 on May 27, 2019, 23:32:43 PM
Hi, i have problem with currency module selector . When i want change currency i see this error in console :

(index):794 Uncaught TypeError: user_mode89.submit is not a function
    at HTMLSelectElement.onchange ((index):794)
    at Object.trigger (jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
    at Object.a.event.trigger (jquery-migrate.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
    at HTMLSelectElement.<anonymous> (jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
    at Function.each (jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
    at a.fn.init.each (jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
    at a.fn.init.trigger (jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
    at a.fn.init.d.fn.<computed> [as change] (jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
    at HTMLAnchorElement.<anonymous> (bootstrap-select.min.js:7)
    at HTMLDivElement.dispatch (jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2)
onchange @ (index):794
trigger @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2
a.event.trigger @ jquery-migrate.min.js?257f9bda8ab7c1172d09b770956fbccc:2
(anonymous) @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2
each @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2
each @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2
trigger @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2
d.fn.<computed> @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2
(anonymous) @ bootstrap-select.min.js:7
dispatch @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2
v.handle @ jquery.min.js?257f9bda8ab7c1172d09b770956fbccc:2

can you help me fix it ?

thanks
Title: Re: Currency module problem
Post by: Jörgen on May 27, 2019, 23:35:11 PM
VM version ?
Joomla version ?
Trying to use bootstrap?

Jörgen@ Kreativ Fotografi
Title: Re: Currency module problem
Post by: roman5527 on May 28, 2019, 00:02:39 AM
Oh sorry .

Joomla : 3.9.5
VM : 3.4.2
i using bootstrap in template

url : piratarmy.com/en
Title: Re: Currency module problem
Post by: Studio 42 on May 28, 2019, 00:11:48 AM
The only problem i have found is CSS not fine always and sharethis button not loaded using https.
I dont have your reported problem.
Is this in a specific page ?
Title: Re: Currency module problem
Post by: roman5527 on May 28, 2019, 00:22:35 AM
Hi, web url is piratarmy.com/en

Title: Re: Currency module problem
Post by: roman5527 on May 28, 2019, 00:34:53 AM
Hi, patrick . where is problem with css ? i dont see it.

Thnaks
Title: Re: Currency module problem
Post by: Studio 42 on May 28, 2019, 00:37:18 AM
The problem is
<select id="virtuemart_currency_id" name="virtuemart_currency_id" class="inputbox selectpicker bs-select-hidden" onchange="user_mode89.submit();return false;">
This code is not Virtuemart core i think, but a template modification
Title: Re: Currency module problem
Post by: Studio 42 on May 28, 2019, 00:41:21 AM
i have ?tmpl=comingsoon and cannot see the full site anymore.
About CSS, i had the problem only first time, so dont know the exact URL.
Title: Re: Currency module problem
Post by: roman5527 on May 28, 2019, 00:45:38 AM
hi, patrick .

modification default.php in template/html/mod_virtuemart_currencies is :

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


<!-- Currency Selector Module -->
<?php echo $text_before?>
<?php 
$this_name_form 'user_mode'.$module->id
$class "class='inputbox selectpicker' OnChange='".$this_name_form.".submit();return false;'";
?>

<div id="curVm3_<?php echo $module->id?>" class="curVm3">
<form id="cur_form" class="cur_box" name="user_mode<?php echo $module->id?>" action="<?php echo vmURI::getCleanUrl(); ?>" method="post">
<!-- <input class="button" type="submit" name="submit" value="<?php echo vmText::_('MOD_VIRTUEMART_CURRENCIES_CHANGE_CURRENCIES'?>" /> -->
<?php echo JHTML::_('select.genericlist'$currencies'virtuemart_currency_id'$class 'virtuemart_currency_id''currency_txt'$virtuemart_currency_id) ; ?>
</form>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$modId = $('#curVm3_<?php echo $module->id?>');
// Selectpicker
$('.selectpicker', $modId).selectpicker();
});
</script>


can you help me fix this problem ?

thanks
Title: Re: Currency module problem
Post by: Jörgen on May 28, 2019, 06:52:15 AM
Has it ever worked you are trying to call a js function with wrong naming ?

Jörgen @ Kreativ Fotografi
Title: Re: Currency module problem
Post by: roman5527 on May 28, 2019, 07:44:38 AM
Hi, Jorgen.

you think:

<script type="text/javascript">
jQuery(document).ready(function($) {
$modId = $('#curVm3_<?php echo $module->id?>');
// Selectpicker
$('.selectpicker', $modId).selectpicker();
});
</script>


corect is change $ to jQuery ?

thanks
Title: Re: Currency module problem
Post by: Jörgen on May 28, 2019, 07:54:22 AM
Where do You create this function ?
user_mode89.submit is not a function
Looks to me that You should compare your js function and the call, they do not look alike.

Has it ever worked? I doubt that.

Jörgen @ Kreativ Fotografi
Title: Re: Currency module problem
Post by: roman5527 on May 28, 2019, 08:07:02 AM
Hi, i find this in template .
Originally I used other currency module. Can you send me in PM your IP adress so you can see website ?

But this originall module stopped working some times back. but i dont know why. console dont see error.
currency module works on iphone mobile but no on android phone and pc .

when i click to currency on pc or android mobile , website is reloaded by currency dont change.

can you help me fix it ?
Title: Re: Currency module problem
Post by: Jörgen on May 28, 2019, 08:46:08 AM
The "original" currency module should work just fine, have you checked with protostar template ? If it works then, refer to the template developer.
This "new" module You should also refer the questions to the template developer.

This is probably a problem with Your template.

I think You can get payed support faster from somebody else in the forum, right now I have very little time to help You with this.

Jörgen @ Kreativ Fotografi