Fix "Warning: end(): Argument #1 ($array) must be passed by reference, value given" error in Prestashop

This error is displayed on your Prestashop store due to a bug in Prestashop on versions 8.x.

To fix this error, simply update your Prestashop online store to version 8.0.5 or 8.1.1.

If you do not want to update your Prestashop store, you can apply the following patch:

# Open the file : /ROOT/config/

# Locate this line of code in the file :

smartyRegisterFunction($smarty, 'modifier', 'end','end');# Replace it with the following code :

smartyRegisterFunction($smarty, 'modifier', 'end','smarty_endWithoutReference');# Add the following code at the end of the file :

function smarty_endWithoutReference($arrayValue) {
      return end($arrayValue);
# Save the file.