Author Topic: Product get removed from Cart  (Read 829 times)

sgagner

  • Translator Team
  • Beginner
  • **
  • Posts: 20
  • Joomla Professional consultant and translator
    • Web8 Universal (former Mei Ya e-Service)
  • Skype Name: stefangagner
Product get removed from Cart
« on: July 27, 2022, 22:07:43 pm »
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

  • Jr. Member
  • **
  • Posts: 82
Re: Product get removed from Cart
« Reply #1 on: July 28, 2022, 07:01:04 am »
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

  • Translator Team
  • Beginner
  • **
  • Posts: 20
  • Joomla Professional consultant and translator
    • Web8 Universal (former Mei Ya e-Service)
  • Skype Name: stefangagner
Re: Product get removed from Cart
« Reply #2 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
Best regards,
Stefan Gagner, Web8 Universal, Sweden

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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10580
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Product get removed from Cart
« Reply #3 on: July 29, 2022, 16:37:05 pm »
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
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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

  • Jr. Member
  • **
  • Posts: 82
Re: Product get removed from Cart
« Reply #4 on: July 30, 2022, 08:31:12 am »
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

  • Translator Team
  • Beginner
  • **
  • Posts: 20
  • Joomla Professional consultant and translator
    • Web8 Universal (former Mei Ya e-Service)
  • Skype Name: stefangagner
Re: Product get removed from Cart
« Reply #5 on: September 19, 2022, 11:32:23 am »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28339
  • Always on vacation
    • Jenkin Hill Internet
Re: Product get removed from Cart
« Reply #6 on: September 19, 2022, 15:55:45 pm »
Latest beta/test version is 4.0.7.10701   http://dev.virtuemart.net/projects/virtuemart/files
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 VirtueMart  4.0.2 10661 on Joomla 3.10.9 PHP 7.4.29

Mike J

  • Jr. Member
  • **
  • Posts: 82
Re: Product get removed from Cart
« Reply #7 on: September 20, 2022, 01:09:24 am »
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!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 851
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always the latest
Re: Product get removed from Cart
« Reply #8 on: September 20, 2022, 07:56:07 am »
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

  • Jr. Member
  • **
  • Posts: 82
Re: Product get removed from Cart
« Reply #9 on: September 20, 2022, 08:57:11 am »
... 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

  • Translator Team
  • Beginner
  • **
  • Posts: 20
  • Joomla Professional consultant and translator
    • Web8 Universal (former Mei Ya e-Service)
  • Skype Name: stefangagner
Re: Product get removed from Cart
« Reply #10 on: September 22, 2022, 04:56:18 am »
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!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 851
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always the latest
Re: Product get removed from Cart
« Reply #11 on: September 22, 2022, 07:45:18 am »
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

  • Translator Team
  • Beginner
  • **
  • Posts: 20
  • Joomla Professional consultant and translator
    • Web8 Universal (former Mei Ya e-Service)
  • Skype Name: stefangagner
Re: Product get removed from Cart
« Reply #12 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
Best regards,
Stefan Gagner, Web8 Universal, Sweden

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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10333
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Product get removed from Cart
« Reply #13 on: October 02, 2022, 23:50:39 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.

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

  • Jr. Member
  • **
  • Posts: 82
Re: Product get removed from Cart
« Reply #14 on: October 03, 2022, 05:55:47 am »
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