We noticed on our Virtuemart site that the promotion we had setup where you purchased 2 of one item and got a different one free, which was setup as an Auto Coupon, wasn't being applied automatically. If you manually added the item that should be free then the coupon appeared. I'm sure this used to be working on the site and I'm not sure exactly when it stopped working. We are running Virtuemart 4.0.22 10864 on Joomla 3.10.11 with AwoCoupon 3.6.0.10.
I worked through the code and eventually found the Virtuemart Cart object is requiring the quantity to be set in Post data for an item to be added to the cart so the call from awocoupon was failing. I have corrected this by adding the quantity into the vRequest before the call to add to cart in class-awocoupon-helper-estore-virtuemart-discount.php about line 2097 as follows:
$error_msg = '';
vRequest::setVar('quantity', array(1)); //Auto products weren't being added without a quantity set$status = $cart->add( array( $product_id ), $error_msg );
Hopefully this helps somebody else.