VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: JestaBlunt on May 25, 2016, 21:03:21 PM

Title: Multivariant - selectboxes on category view not working except first
Post by: JestaBlunt on May 25, 2016, 21:03:21 PM
hi,

i had set up an own template which was working fine, the customer could create multivariants and on the front page you could click the select boxes with the variants and it was going to the product.

then the customer was on holiday and since he's back, only the first product on category overview has usable select boxes. the others are only changing the url, like following:

http://bp-gerdenits.at/ --> http://bp-gerdenits.at/brown ... instead of going to the product detail page.

the first product on the category overview works like ever.

the customer said he didnt do any update and we havent change anything in the template. what could be the reason?

vm 3.0.16
joomla 3.5.1.

peace, jesta
Title: Re: Multivariant - selectboxes on category view not working except first
Post by: Dragoner on August 11, 2016, 18:42:51 PM
Hello I have same problem, same version of Joomla and VM! Yesterdad was funcion, today on first product.

Here is my ESHOP .. link to category http://lepidla.esovicka.cz/index.php/e-shop/tmely-pro-opravy-kovu-1
On first product multivariant WORK, on next products not work. :(

Please HELP!

Thank you David
Title: Re: Multivariant - selectboxes on category view not working except first
Post by: GJC Web Design on August 11, 2016, 21:17:55 PM
see here:  http://forum.virtuemart.net/index.php?topic=135095.0

does this help?
Title: Re: Multivariant - selectboxes on category view not working except first
Post by: Dragoner on August 12, 2016, 08:21:31 AM
Thanks for your reply.

I try remove
vmJsApi::addJScript('ajaxContent',$j);
not working

Then i try upgrade to VM 3.0.17.4 and if i click on product variant, eshop freeze and java script make error.

http://lepidla.esovicka.cz/index.php/e-shop/tmely-pro-opravy-kovu-1

David
Title: Re: Multivariant - selectboxes on category view not working except first
Post by: Dragoner on August 12, 2016, 09:19:57 AM
I found it!

I my template in category view. I paste this code to end of document


<?php 
$j 
'jQuery(document).ready(function($) {
Virtuemart.product(jQuery("form.product"));

$("form.js-recalculate").each(function(){
if ($(this).find(".product-fields").length && !$(this).find(".no-vm-bind").length) {
var id= $(this).find(\'input[name="virtuemart_product_id[]"]\').val();
Virtuemart.setproducttype($(this),id);

}
});
});'
;

$j "Virtuemart.container = jQuery('.produkt');
Virtuemart.containerSelector = '.produkt';"
;

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

echo 
vmJsApi::writeJS();
?>



And now, it working.