Manikandan Era โ made their first commit to this issueโs fork.
Manikandan Era โ created an issue.
Manikandan Era โ created an issue.
Manikandan Era โ created an issue.
The error "Undefined array key 2" typically occurs when you're trying to access an array element using a key that doesn't exist. In your case, it seems like the $arg array doesn't have a key with index 2, and you're trying to access it.
Here's a safer way to check if the key exists before accessing it:
if (isset($arg[1]) && $arg[1] == "checkout" && isset($arg[2]) && !(is_numeric($arg[2]))) {
$path = $this->commerceUrlProcess($path, $arg, EncryptDecrypt::DECRYPT);
}
This code uses the isset() function to check if the keys $arg[1] and $arg[2] exist before comparing or using their values. This should help prevent the "Undefined array key" error.
Make sure to adapt this to your specific needs and context. If $arg is expected to have certain keys under different conditions, you may need to adjust the conditions accordingly.
Add the following patch to your composer.json.
Manikandan Era โ created an issue.
Manikandan Era โ created an issue.
Manikandan Era โ created an issue.