Add to cart from search list - first item not working

Started by cygan89, July 28, 2017, 09:17:19 AM

Previous topic - Next topic

cygan89

Jooomla: 3.5.1
VM: 3.0.16
Example of problem: https://ccy.pl/pl/sobd2/search?keyword=lpg&x=0&y=0&limitstart=0&option=com_virtuemart&view=category&virtuemart_category_id=0

Description:
For first item firm list when i press add to cart website just going to the cart but not adding any item.
For 2nd and next items everything is ok...

I checked updates joomla and vm on the clone website and nothing.

Studio 42

Your <form> need ot have class="product js-recalculate" but the firs item have no class set.
Probably it comes from a module ?
Eg. valid <form method="post" class="product js-recalculate" action="#"></form>

cygan89

Hello,
Thanks for answer, probably you are right but i found file addtocart.php in components/com-virtuemart/sublayouts/addtocart.php and look like correct:
https://pastebin.com/uQnvKcRV

I have no idea why first item dont have this class, any ideas?

Studio 42


cygan89

Yes but i dont know reason... my solution is:

templates/ZZZZZ/html/com_virtuemart/sublayouts/products.php

echo "<div style='display: none;'>" . shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'row'=>0))."</div>";   
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'row'=>0));   

its very stupid solution but o cant find better