🇵🇹Portugal luis_oliveira Portugal
🇵🇹Portugal luis_oliveira Portugal
I added a bit of logic in the AddToCartForm class in submitForm(), I compare if the selected variation is the same as the default variation, if not add a query parameter (?v) with the variation ID to the URL and create a new Redirect in the form state.
🇵🇹Portugal luis_oliveira Portugal
🇵🇹Portugal luis_oliveira Portugal
I used patch #30 but did not work, I did some debugging and found out that in Drupal 10 the array key 0 does not exist so the if statement would be skipped.
<?php
if (isset($build[$region][$uuid]['content'][0]['#block_content'])) {
?>
I fixed that and added the "edit" option in the operation metadata.