News:

Looking for documentation? Take a look on our wiki

Main Menu

Product get removed from Cart

Started by sgagner, July 27, 2022, 22:07:43 PM

Previous topic - Next topic

sgagner

Hi,
I have an installation in Joomla 4.1.5 with Virtuemart 4.0.6.
When a customer add a product to the cart it is removed immidiatly and reports "Product removed" on top of page.

This is very urgent:  https://snowball.se/webshop/

/Stefan Gagner - Web8 Universal and Svensk Joomla, Swedish Joomla translator Team

Best regards,
Stefan Gagner, Web8 Universal, Sweden

We make the impossible while you wait. Wonders takes a little bit longer.

Mike J

Hello Sgagner,

Whilst VM 4.0.6 is being promoted as stable and compatible with J4, there are a few of us who have found some problems with it.

There may or may not be users running your combination successfully but from my experience, after a number of clean installs of just Joomla 4.1.5 with Virtuemart 4.0.6 (no additional templates or plugins - Just J! & VM source files), I found that both VM 4.0.6 (stable, compatible J3/J4) and 4.0.4 (stable, compatible J3/J4) fail, making VM unusable with J! 4.1.5.

If this is true, and it certainly is true for me, after a great deal of trial and error, I'd say hold at Joomla 3.10.10 and probably VM 4.0.2.10661.

I hear on the grapevine that a fix is not too afar off... Hopefully fairly soon.
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

sgagner

Hi!
I have had the same isue with Joomla 3.10.10 and VM 4.0.4
Best regards,
Stefan Gagner, Web8 Universal, Sweden

We make the impossible while you wait. Wonders takes a little bit longer.

GJC Web Design

#3
turn on the VM debugging to look for clues as to why this does this ..

the post to the cart looks fine so something in the logic of the cart is removing it again .. the message is very odd ...

please confirm  Produkten borttagen  is -> COM_VIRTUEMART_PRODUCT_REMOVED_SUCCESSFULLY as the language constant?

if it coming from the controller then the actual fuction remove is being called

if it is from the helper then it is because there isn't any quantity

   public function updateProductCart() {

      $quantities = vRequest::getInt('quantity');
      if(empty($quantities)) return false;
      $updated = false;

      foreach($quantities as $key=>$quantity){
         if (isset($this->cartProductsData[$key]) and !empty($quantity) and !isset($_POST['delete_'.$key])) {
            if($quantity!=$this->cartProductsData[$key]['quantity']){
               $this->cartProductsData[$key]['quantity'] = $quantity;
               $updated = true;
               vmInfo('COM_VIRTUEMART_PRODUCT_UPDATED_SUCCESSFULLY');
            }

         } else {
            unset($this->cartProductsData[$key]);
            vmInfo('COM_VIRTUEMART_PRODUCT_REMOVED_SUCCESSFULLY');
            $updated = true;
         }
      }

      $this->setCartIntoSession($updated, true);
      return $updated;
   }
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Mike J

Quote from: sgagner on July 29, 2022, 15:58:43 PM
Hi!
I have had the same isue with Joomla 3.10.10 and VM 4.0.4

Yes, others have reported this also. It seems that something went wonky in VM 4.0.4 & VM 4.0.6 (they were both released close together). I'm holding at VM 4.0.2 10661 but have found that if I take VM 4.0.2 10661 up to Joomla 4.x.x, customers can't check out when logged in due to a problem with the state drop down selector in the BE. The next 2 releases addressed that issue but a new router problem seems to have popped up in these. Again, other reliable users have reported that 4.0.4 (stable, compatible J3/J4) and 4.0.6 (stable, compatible J3/J4) are not agreeing with 3.10.10 either.

According to GJC Web Design, who certainly knows his stuff, "routing problems were fixed in the soon to be released 4.0.8."

Hang tight... Rome wasn't built in a day.
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

sgagner

Now I have waited a long time for a solution.
The shop I use does not function and nothing can be sold until the routing problems are solved.
Any idea when VM 4.0.8 will ne relaesed or where to get a beta?

/Stefan Gagner
Best regards,
Stefan Gagner, Web8 Universal, Sweden

We make the impossible while you wait. Wonders takes a little bit longer.

jenkinhill

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

Mike J

#7
Hello Stefan,

I feel you pain. I moved our store to J4 and had nothing but problems and wasted weeks before I started creating clean installs (just Joomla and VM) with no other templates or plugins and found my problem.

Consider these posts that may help you get through this saga:

https://forum.virtuemart.net/index.php?topic=148609.msg530834#msg530834 This seems to suggest that 4.0.7 may get you up and running.

https://forum.virtuemart.net/index.php?topic=148569.msg530656#msg530656 provides a possible hack that may be helpful.

My best advise, however, is hold at Joomla 3.10.11 & VM 4.0.2.10661 and wait at least a month until everyone here says all bugs on J4 are ironed out. If you're already committed to J4 (and I know what that's like) but can't go back, hopefully 4.0.7 will get you over the line.
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

Jumbo!

By the way, it seems all the Javascript files on your site are hacked. They all contain malicious scripts. You can find some examples below. Open any files, scroll down and see the extra scripts added to all the files.

https://snowball.se/media/jui/js/jquery.min.js
https://snowball.se/media/jui/js/jquery-migrate.min.js
https://snowball.se/components/com_virtuemart/assets/js/vmsite.js
https://snowball.se/components/com_virtuemart/assets/js/vmprices.js
https://snowball.se/components/com_virtuemart/assets/js/fancybox/jquery.fancybox-1.3.4.2.pack.js

The malicious script generates errors; therefore, all other standard scripts (including add to cart function) fail to work.

Since the JS files are affected, I doubt other PHP files might also are hacked. You should check and clear all hacked content from your site. You also need to find the source of the problem so that they do not come back after you clean your site.

Mike J

#9
... Now that's way better than my advice... Nice one Jumbo!

PS Stefan, Could you let me know if you get it working? Best Mike
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

sgagner

#10
Hi again,
I have now scanned and cleaned the website which had a severe hack with more than 2000 files compromised.
I have installed the verion 4.0.7 of VM but still nothing is put in the cart. It runs on Joomla 3.10.11 but I can update to Joomla 4.2.2 if needed.

/Stefan Gagner
Best regards,
Stefan Gagner, Web8 Universal, Sweden

We make the impossible while you wait. Wonders takes a little bit longer.

Jumbo!

That's because your site is still generating Javascript errors, and the error is generated by a 3rd party plugin called "JCE MediaBox". You can see the error in your browser's console.

Disable this plugin which should resolve the issue.

sgagner

Thanks a million for your input!!!  ;D

I inactivated JCE Mediabox and now the cart works properly.
This is strange though. I have used JCE Mediabox on numerous of websites for many years without any problem.

Thanks all for your efforts to solve this problem.

/Stefan Gagner - Coordinator Swedish Joomla Translator Team - Web8 Universal
Best regards,
Stefan Gagner, Web8 Universal, Sweden

We make the impossible while you wait. Wonders takes a little bit longer.

Milbo

Quote from: sgagner on September 22, 2022, 12:20:16 PM
Thanks a million for your input!!!  ;D

I inactivated JCE Mediabox and now the cart works properly.
This is strange though. I have used JCE Mediabox on numerous of websites for many years without any problem.

Thanks all for your efforts to solve this problem.

/Stefan Gagner - Coordinator Swedish Joomla Translator Team - Web8 Universal

hahah, Wow :-) Nice to read, Stefan. Yes, not only VM has problems to adjust to the evolving bugs of j4. Abhishek you are really a hero.

Quote from: Mike J on July 30, 2022, 08:31:12 AM
Quote from: sgagner on July 29, 2022, 15:58:43 PM
Hi!
I have had the same isue with Joomla 3.10.10 and VM 4.0.4

Yes, others have reported this also. It seems that something went wonky in VM 4.0.4 & VM 4.0.6 (they were both released close together). I'm holding at VM 4.0.2 10661 but have found that if I take VM 4.0.2 10661 up to Joomla 4.x.x, customers can't check out when logged in due to a problem with the state drop down selector in the BE. The next 2 releases addressed that issue but a new router problem seems to have popped up in these. Again, other reliable users have reported that 4.0.4 (stable, compatible J3/J4) and 4.0.6 (stable, compatible J3/J4) are not agreeing with 3.10.10 either.

According to GJC Web Design, who certainly knows his stuff, "routing problems were fixed in the soon to be released 4.0.8."

Hang tight... Rome wasn't built in a day.

Yes, you have a good source. GJC is in the dev chat and an active member. Yeh the routing problems and this and that. It just popps up with a new version and we have to deal with it.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Mike J

Quote from: Milbo on October 02, 2022, 23:50:39 PM
Quote from: sgagner on September 22, 2022, 12:20:16 PM
Yes, you have a good source. GJC is in the dev chat and an active member. Yeh the routing problems and this and that. It just popps up with a new version and we have to deal with it.

Thanks for the update Max. OK, all good. Many thanks.

PS Yes, Abhishek/Jumbo & GJC both do a brilliant job!
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39