[solved] VM recent version broke AddToCart feature in 3rd party extensions

Started by nordmograph, June 07, 2019, 09:52:23 AM

Previous topic - Next topic

nordmograph

Hello

I have 3 components that use to integrate the Core VM AddToCart feature (add to cart, pricing and vmcustom fields) via the VM api, but recently latest VM3.4.5 (or previous, not sure) broke that. Html is loaded but CSS and JS only partly load and Add to cart button doesn't add anything but redirects to the cart page.

If any one has a clue on what changed, it would be greatly appreciated.
Thanks!

Adrien

StefanSTS

Hi Adrien,

a link to a not working example might help.
Maybe you are missing the class product-container for the product container. I think the script uses that for finding the root of the product.

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.

nordmograph

Thank you for your help.
Actualy I downgraded to VM 3.2.14 to solve the issue. Every newer version breaks it.
Some clients also have the same issue.

I'll setup another online test so I can reproduce and share a link.

AH

QuoteI'll setup another online test so I can reproduce and share a link.

Correct - Test in a development environment first

Every new version has changes - that is why it is released.

If you are coming from 3.2.14.

Your templates, overrides and or plugins must be tested for compatibility with the latest version - if you see an issue then you should look to the developers of these plugins/templates for support before you upgrade live.


QuoteDoesn't add anything but redirects to the cart page.

Look in your browser developer too console for the error - that would give you a better idea of what need modifying
Regards
A

Joomla 3.10.11
php 8.0

Milbo

Quote from: nordmograph on June 11, 2019, 23:19:51 PM
Actualy I downgraded to VM 3.2.14 to solve the issue.

Ah come on, that is not "solving". My customsize and my download plugin still works.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

brassens

Hello, I have the same problem. We have a plugin to calculate prices of custom sizes of products. Sometimes those product are not added to the cart. The plugin developpers say that the cause is a virtuemart performance problem

Quoteit is not a problem of our plugin, not even only of your web, you can try the product by deactivating the plugin to check it. It does not have to do with changing the amount or not, it's a virtuemart performance problem. If you do the same test, changing dimensions data or not, it is indifferent, but waiting a few seconds between change and change of field, and leaving the request text blank, or waiting again a few seconds before hitting the button will work. If you simply enter the page, you type very quickly in the text of requests (a key pressed for example), and you hit the button immediately, it does not work.


The solution would be in the internal code of virtuemart, for example blocking the button until the other functions have finished or making the button work synchronously. Perhaps in the VM support they have some other additional solution.

Thanks for your help

jenkinhill

Brassens you have a completely different problem, likely to be down to server performance or template. Impossible to guess further without further information such as J/VM versions etc.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

nordmograph

Ok, I solved my Add to cart compatibility problem (that was actually only happening in one extension integrating VM addtocart),
by updating the code

if(!class_exists('shopFunctionsF')){
require JPATH_BASE.'/components/com_virtuemart/helpers/shopfunctionsf.php';
}
vmJsApi::jQuery();
vmJsApi::jSite();
vmJsApi::jPrice();
vmJsApi::cssSite();
echo vmJsApi::writeJS();

Making sure the Joomla chosen library was now also loaded
So this is solved. Thanks for your inputs.

AH

Regards
A

Joomla 3.10.11
php 8.0