Hi,
The call stack is indeed precious to understand what's going on.
The first two lines of the stack
1 () JROOT/libraries/src/Language/Text.php:281
2 sprintf() JROOT/libraries/src/Language/Text.php:281
Indicate that there is a problem with a translation.
The next line
3 Joomla\CMS\Language\Text::sprintf() JROOT/administrator/components/com_hikashop/classes/cart.php:3731
indicates that the issue is with the translation key used on the line 3731 of the file administrator/components/com_hikashop/classes/cart.php
If I look at this line number of this file in HikaShop 5.1.1 it is this line:
$cart->messages[] = array('msg' => JText::sprintf('PRODUCT_NOT_AVAILABLE', $errorMessagesProductNames[$cart_product_id]), 'product_id' => $product->product_id, 'type' => 'notice');
So this points at the translation for the key PRODUCT_NOT_AVAILABLE.
Finally, the error message
Unknown format specifier "i"
indicates that you must have a translation override for that translation key, and in it you have the text "%i". When there is a "%" with something else following, Joomla's translation system interprets it as a variable which needs to be replaced.
So, for example, the default translation for this key in english is:
PRODUCT_NOT_AVAILABLE="The product %s is not available"
There, you can see a %s and "s" stands for "string". So Joomla will replace that %s by the variable in
$errorMessagesProductNames[$cart_product_id]
and it expects it to be a string.
Here, you can see the details of formatting of translations:
docs.joomla.org/Formatted_fields_in_lang..._translation_strings
And as you can see, there is no %i so that's why you get this error.
If you want to output the character %, then either double it (like so: "%%"), or use the HTML code for it:
And you need to have one %s in that translation override to match with the code in HikaShop. Anything else and Joomla will complain.