Author Topic: [solved] VM recent version broke AddToCart feature in 3rd party extensions  (Read 313 times)

nordmograph

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 169
  • VirtueMart Version: 3 on Joomla3
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

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 310
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: VM recent version broke AddToCart feature in 3rd party extensions
« Reply #1 on: June 07, 2019, 13:54:08 pm »
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

nordmograph

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 169
  • VirtueMart Version: 3 on Joomla3
Re: VM recent version broke AddToCart feature in 3rd party extensions
« Reply #2 on: June 11, 2019, 23:19:51 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2899
  • VirtueMart Version: 3.4
Re: VM recent version broke AddToCart feature in 3rd party extensions
« Reply #3 on: June 12, 2019, 08:57:16 am »
Quote
I'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.


Quote
Doesn'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.9.1
php 7.1

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9843
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VM recent version broke AddToCart feature in 3rd party extensions
« Reply #4 on: June 12, 2019, 11:57:51 am »
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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

brassens

  • Beginner
  • *
  • Posts: 11
Re: VM recent version broke AddToCart feature in 3rd party extensions
« Reply #5 on: June 12, 2019, 13:26:54 pm »
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

Quote
it 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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27431
  • Always on vacation
    • Jenkin Hill Internet
Re: VM recent version broke AddToCart feature in 3rd party extensions
« Reply #6 on: June 12, 2019, 13:56:17 pm »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.3.10057 on Joomla 3.9.8 PHP 7.0.33
Testing VM .3.6.0.10075 on Joomla 3.9.8

nordmograph

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 169
  • VirtueMart Version: 3 on Joomla3
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2899
  • VirtueMart Version: 3.4
You never stated what extension you had this problem with??
regards
A

Joomla 3.9.1
php 7.1