News:

Looking for documentation? Take a look on our wiki

Main Menu

Product not adding to cart after latest update

Started by joozen, July 07, 2022, 15:14:40 PM

Previous topic - Next topic

Mike J

Sharing my experiences with Joomla 4.1.5 & VirtueMart 4.0.6 10690

Good news: State drop down error is resolved!

Started with VirtueMart4.0.2_Joomla_3.10.9-Stable-Full_Package.zip (Just this source file. Clean install / no other templates or plugins).

* Installed with preconfigured VirtueMart (also for multilanguage sites) + Installed VirtueMart with sample data enabled.

Joomla ‎3.10.9 > 3.10.10 VM test order using COD (Cash On Delivery) = Success... Reached thank you page and order was recorded as confirmed in BE.

Updated J to 4.1.5 = Call to undefined method Joomla\CMS\Application\SiteApplication::isAdmin() in FE (Front End).
Back End (BE): Swapped template from Horme 3 - Default to vmbeez3 - Default = #500 behavior::framework not found.
BE: Swapped template from vmbeez3 - Default to Cassiopeia - Default = User is redirected to home page (not thank you page) after selecting COD > Check Out – No trace of order in BE.

* As I ran many attempts, I did select different options when installing and at one stage installed my Pay Pay Credit Card payment plugin (for VM 3 and VM 4 ) which worked great in Joomla ‎3.10.10 / VirtueMart 4.0.6 10690 but locked everything up after clicking Confirm Order in Joomla 4.1.5 / VirtueMart 4.0.6 10690.

So, my experience revealed that test orders in 3.10.10 + VirtueMart 4.0.6 10690 = Success
Test orders in Joomla 4.1.5 + VirtueMart 4.0.6 10690 = No go.

Would love to hear reports from others as your experience may help me in moving forward.
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

ssc3

#16
The product not adding to cart issue looks to be caused by an update to vrequest.php

Revision 10690 The fix for J4 in vRequest

http://dev.virtuemart.net/projects/virtuemart/repository/revisions/10690/diff/trunk/virtuemart/administrator/components/com_virtuemart/helpers/vrequest.php?utf8=%E2%9C%93&type=inline

The problem is also present in J4 as well as J3

Test by setting

"Display modal popup upon 'Add to cart'" to No

The add to cart button will no longer work in 4.0.6

Reverting to the version of  vrequest.php used in 4.0.4 fixes this.
Virtuemart Payment Plugins
https://plugins.online-store.co.uk

ssc3

#17
$vars = $router->getVars();
if($source===0){
$source = $_REQUEST;
if(!empty($vars)){
$source = array_merge($_REQUEST,$vars);
}



seems to be causing the problem in vrequest.php
if $_REQUEST['view'] is already set
it is overwritten by the value from $router->getVars()
so
view = cart
becomes
view = productdetails

in this case staying on the product details page instead of going to the cart page.
Virtuemart Payment Plugins
https://plugins.online-store.co.uk

Mike J

Many thanks ssc3,

I tried an install of VirtueMart 4.0.4 10688 which worked perfectly in J 3.10.10 but broke when updating to J 4.1.5 as per my previous findings.

Was just checking to see if the problem was introduced between VM 4.0.4.10688 & VM 4.0.6.10690 but not the case.
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

ssc3

#19
if you get fed up of waiting for 4.0.8

you could try hacking the code in vrequest.php

change

$source = array_merge($_REQUEST,$vars);
               
to
                  
$source = $_REQUEST + $vars

using the array union operator. This prevents the view from being overwritten if it already exists in $_REQUEST

Fixes the "Not Adding to Cart" problem but may or may not cause others, so use entirely at own risk!
Virtuemart Payment Plugins
https://plugins.online-store.co.uk

Mike J

Hey thanks ssc3,

This may just save my bacon. I'm about to jump ship as other stuff I'm running must be on J! 4.

... Been pulling my hair out over this dilemma being a happy VM user for decade... Reluctant to move to something else.

This may be my only hope as time has run out. :(
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

ssc3

Still using Joomla 3. I have no plugins that require Joomla 4, so no plans to upgrade yet.

Joomla 3 still has security updates until August 2023

The "Adding to Cart" problem affects both Joomla 3 and 4. The hack "fixes" that one,

but there are still a whole set of other problems that are exclusively Joomla 4's.
Virtuemart Payment Plugins
https://plugins.online-store.co.uk

sgagner

I tried to add the mentioned code in VM 4.0.6 but the problem with items removed from cart remains
Best regards,
Stefan Gagner, Web8 Universal, Sweden

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

pinochico

Quote from: ssc3 on August 12, 2022, 11:00:30 AM
Still using Joomla 3. I have no plugins that require Joomla 4, so no plans to upgrade yet.

Joomla 3 still has security updates until August 2023

The "Adding to Cart" problem affects both Joomla 3 and 4. The hack "fixes" that one,

but there are still a whole set of other problems that are exclusively Joomla 4's.

Thank you,
we're still on J3 and VM3 as well.

But next month we will start to update most of our about 80 active extensions for VM to J4 and prepare two new eshops for VM4 and J4.
Completion date - 04/2023

Plenty of time before the end of J3 security upgrades are complete and plenty of time before the functional versions of VM4 and J4 are complete.

The "scaremongers" who have to keep upgrading to VM4 and Joomla4 are smiling and probably forgot about the same issues when moving from J1.5, J2.5, J3...
But I keep my fingers crossed for them, I just feel sorry for their customers.

Translated with www.DeepL.com/Translator (free version)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

ssc3

#24
Quote from: sgagner on August 15, 2022, 22:55:54 PM
I tried to add the mentioned code in VM 4.0.6 but the problem with items removed from cart remains

The code fixes a VM 4.0.6 problem but looking back at your posts you also had this problem with VM 4.0.4

I can find no problem with with items removed from cart using VM 4.0.4 or VM 4.0.6 using the default setup with no third party plugins installed.

I would try with a different template or checkout. Then uninstall any third party plugin one by one to see that makes a difference.

If that does not work then roll back to whatever were the last versions of Joomla or Virtuemart that worked for you.

Virtuemart Payment Plugins
https://plugins.online-store.co.uk

GJC Web Design

#25
The routing problem becomes apparent with an "POST" .. e.g. using the "add to cart" without ajax or trying to update a stored address.

Anything using a "GET" works correctly ... as mentioned .. with the last development version before the holidays - com_virtuemart.4.0.7.10693 - afaik all routing problems were solved

if anyone wants to experiment here is the router & vrequest from that version. THESE ARE DEV VERSIONS AND NOT INTENDED FOR PRODUCTION!




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