VirtueMart Forum

VirtueMart 2 + 3 => General Questions => Topic started by: Piero_M on January 28, 2019, 17:37:31 pm

Title: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Piero_M on January 28, 2019, 17:37:31 pm
Hi everyone I have a problem with this plugin and I hope that someone here can help me because I no longer know what to do, the support no longer responds!

Virtuemart 3 Product Filter by Custom Fields (Developer Dmitriy Usov)

The plugin after the update php 7.1 and after update Joomla and VM no longer works properly, in fact, when I filter a product and add it to the cart no longer adds it!

I've read some discussions in Russian where they say to change some code in the file  modules/mod_virtuemart_param_filter/assets/js.js (https://joomlaforum.ru/index.php/topic,210063.660.html) but the problem can't be solved!

Maybe someone has already managed to solve this problem?

Thank you for help!

Piero


Joomla 3.9.1
VM 4.4.2
Virtuemart 3 multiple customfield plugin 3.0.7



Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Studio 42 on January 28, 2019, 20:42:03 pm
If you provide a ink, perhaps a fix can be found.
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Piero_M on January 29, 2019, 12:11:38 pm
Hi Studio 42,

my site is https://63.33.218.98/new.auroranutriceutics/negozio

the plugin is https://myext.eu/en/update version 3.0.7

in this link you can see the type of error ($this is not defined) that the filter gives http://recordit.co/hYkI2Fmj8M

The file that seems to give problems maybe is this:
modules/mod_virtuemart_param_filter/assets/js.js

I have seen other users with this problem, but no one has left a solution to the problem, I could change plugins, but a lot of work on my site is based on this plugin and to replace it I would have a lot to do again.

Thank you in advance for your help!
Piero

Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Studio 42 on January 29, 2019, 14:30:30 pm
Have you a link to the old shop without updates?
$this is never defined, so this error should exist before your updates. and i dont really understand why you have $this in the javascript code because it is never initialized.
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Studio 42 on January 29, 2019, 15:48:06 pm
I checked the logic.
You should try to replace $this with this or search for
Code: [Select]
if($('*:checked,*:selected', $this).length > 0){
ajaxParamFilter($($('*:checked,*:selected', $this)[0]));
}
and replace with
Code: [Select]
if($('*:checked,*:selected', this).length > 0){
ajaxParamFilter($($('*:checked,*:selected', this)[0]));
}
in modules/mod_virtuemart_param_filter/assets/js.js
And of course refresh or delete the gk cache file /new.auroranutriceutics/t3-assets/js/js-bab04-60112.js
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Piero_M on January 31, 2019, 11:00:12 am
Hi, it's not working!

The error no longer appears in the console but the product is not added to the cart.
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Piero_M on January 31, 2019, 11:02:21 am
[v3.0.7] - fixed installation error in Joomla 3.7 (Using $this when not in object context)

the developer talks about this in the last chengelog, but I don't understand what it refers to.
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Studio 42 on January 31, 2019, 12:02:18 pm
Piero_M, the fix was not about cart problem, but you need to have no error before, to be sure other scripts are working.
If you call this javascript in the console
Code: [Select]
Virtuemart.product(jQuery("form.product"));It work.
So the Template is certainly obsolete and dont add correctly all the new Virtuemart scripts.
You have to compare Virtuemart and the template override to find the file to modify or contact the template developper.
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Piero_M on February 01, 2019, 11:28:35 am
The developer of the template tells me that the problem is the filter, if you disable the module the product is added without problems
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Studio 42 on February 01, 2019, 13:19:43 pm
This code should be called after the category product list
Code: [Select]
<script id="ready.vmprices-js" type="text/javascript">//<![CDATA[
jQuery(document).ready(function($) {

Virtuemart.product($("form.product"));
}); //]]>
</script>
But your filter reload directly the page and dont recall the script, because document is already loaded.
You have to readd this function on after ajax loading
Code: [Select]
Virtuemart.product($("form.product"));Certainly in js.js near end of
Code: [Select]
function ajaxParamFilterPM me if you want i do the Job.
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Piero_M on February 05, 2019, 13:39:14 pm
Hi, I sent you PM
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Studio 42 on February 05, 2019, 19:40:08 pm
Hi, I sent you PM
Please give me the email in the PM. I cannot answer you your inbox is always full when i try to send answer.
Title: Re: Virtuemart 3 Product Filter by Custom Fields by Dmitriy Usov has BUG!!
Post by: Piero_M on February 06, 2019, 10:32:45 am
where can I find your e-mail?