Notable changes in PrestaShop 1.7.7

PHP support

PrestaShop 1.7.7 adds supports for PHP 7.3 and requires at least PHP 7.1.3. Older PHP versions are no longer supported.

Updated dependencies

The following dependencies have been updated in order to provide support for PHP 7.3:

Extension Old version New version
beberlei/doctrineextensions v1.1.9 v1.2.6
behat/transliterator v1.2.0 v1.3.0
composer/ca-bundle 1.1.4 1.2.6
composer/installers v1.6.0 v1.7.0
composer/semver 1.5.0 1.5.1
composer/xdebug-handler 1.3.2 1.4.0
doctrine/annotations v1.4.0 v1.8.0
doctrine/cache v1.6.2 1.10.0
doctrine/collections v1.4.0 1.6.4
doctrine/common v2.5.3 2.12.0
doctrine/dbal v2.5.13 v2.9.3
doctrine/doctrine-bundle 1.10.2 1.12.16
doctrine/doctrine-cache-bundle 1.3.5 1.4.0
doctrine/inflector v1.1.0 1.3.1
doctrine/instantiator 1.0.5 1.3.0
doctrine/lexer v1.0.1 1.0.2
doctrine/orm v2.5.14 v2.7.0
ezyang/htmlpurifier v4.10.0 v4.12.0
fig/link-util 1.0.0 1.1.0
friendsofphp/php-cs-fixer v2.15.1 v2.16.1
friendsofsymfony/jsrouting-bundle 2.4.0 2.5.3
greenlion/php-sql-parser 4.2.1 4.3.0
guzzlehttp/guzzle 5.3.3 5.3.4
johnkary/phpunit-speedtrap v1.1.0 v3.1.0
league/tactician-bundle v0.4.1 v1.2.0
markbaker/matrix 1.1.4 1.2.0
maxmind-db/reader v1.4.1 v1.6.0
maxmind/web-service-common v0.5.0 v0.6.0
mikey179/vfsstream v1.6.5 v1.6.8
mobiledetect/mobiledetectlib 2.8.33 2.8.34
monolog/monolog 1.24.0 1.25.3
myclabs/deep-copy 1.7.0 1.9.4
nikic/php-parser v3.1.5 v4.3.0
pear/archive_tar 1.4.6 1.4.9
pear/console_getopt v1.4.2 v1.4.3
pear/pear-core-minimal v1.10.9 v1.10.10
pear/pear_exception v1.0.0 v1.0.1
pelago/emogrifier v2.1.1 v2.2.0
phpdocumentor/reflection-common 1.0.1 2.0.0
phpdocumentor/reflection-docblock 3.3.2 4.3.4
phpdocumentor/type-resolver 0.4.0 1.0.1
phpoffice/phpspreadsheet 1.7.0 1.10.1
phpspec/prophecy 1.8.0 1.10.1
phpunit/php-code-coverage 4.0.8 6.1.4
phpunit/php-file-iterator 1.4.5 2.0.2
phpunit/php-timer 1.0.9 2.1.2
phpunit/php-token-stream 1.4.12 3.1.1
phpunit/phpunit 5.7.27 7.5.20
psr/log 1.1.0 1.1.2
sebastian/comparator 1.2.4 3.0.2
sebastian/diff 1.4.3 3.0.2
sebastian/environment 2.0.0 4.2.3
sebastian/exporter 2.0.0 3.1.2
sebastian/global-state 1.1.1 2.0.0
sebastian/object-enumerator 2.0.1 3.0.3
sebastian/recursion-context 2.0.0 3.0.0
sebastian/resource-operations 1.0.0 2.0.1
sensio/distribution-bundle v5.0.24 v5.0.25
sensio/framework-extra-bundle v5.2.4 v5.4.1
sensiolabs/security-checker v5.0.3 v6.0.3
smarty/smarty v3.1.33 v3.1.34
swiftmailer/swiftmailer v5.4.12 v6.2.3
symfony/monolog-bundle v3.3.1 v3.5.0
symfony/phpunit-bridge v3.4.31 v3.4.36
symfony/swiftmailer-bundle v2.6.7 v3.2.6
symfony/symfony v3.4.26 v3.4.37
tecnickcom/tcpdf v6.2.26 6.3.2
tijsverkoyen/css- -inline-styles 2.2.1
twig/twig v1.38.4 v1.42.4
webmozart/assert 1.4.0 1.6.0

New hooks

The following hooks have been added:

  • displayAdditionalCustomerAddressFields
  • displayFooterCategory
  • actionAdminAdminPreferencesControllerPostProcessBefore
  • actionAdminLoginControllerBefore
  • actionAdminLoginControllerLoginBefore
  • actionAdminLoginControllerLoginAfter
  • actionAdminLoginControllerForgotBefore
  • actionAdminLoginControllerForgotAfter
  • actionAdminLoginControllerResetBefore
  • actionAdminLoginControllerResetAfter

Changes in AdminController hooks

In Pull Request #19712 hooks displayBackOfficeTop and displayBackOfficeHeader calls have been moved from AdminController::init() to AdminController::initHeader().

However in certain situations, these hooks were the only extension points available. To overcome this, the Pull Request #21435 introduced new hooks in AdminController::init() as well as in other abstract Controller classes:

  • actionFrontControllerInitBefore
  • actionFrontControllerInitAfter
  • actionAdminControllerInitBefore
  • actionAdminControllerInitAfter
  • actionControllerInitAfter
  • actionControllerInitBefore

Database table charset updated

All database tables have been switched to the utf8mb4 charset in order to provide support for emojis.

Because of this, the size for some indexes have been reduced to 191:

  • Field alias in alias table
  • Field slug in authorization_role table
  • Field module in module_preference table
  • Field module in tab_module_preference table
  • Field cache_id in smarty_lazy_cache table

Updated jQuery to latest version

jQuery has been updated to 3.4.1 in Back office (up from 1.11 in legacy pages) and Core theme (up from 2.1.4).

jQuery has changed a lot between v1.11 / v2.1.4 and v3.4.1. This is why jquery migrate was enabled in order to provide a layer of compatibility, but this does not preserve all jQuery capabilities for such old versions.

Modules relying on these old capabilities may experience problems, including but not limited to:

  • context property has been removed
  • Using dataType in an ajax request won’t trigger the success / done methods if the type of content returned does not match
  • jQuery.attr() behavior has evolved, most of the time, you should use jQuery.prop() instead.

Order view page layout modifications

In this version the order page has been migrated with Symfony. We used this migration as an opportunity to improve the page layout to meet the merchants' needs. You can see a representation of these new hooks in the page here:

Order view page hooks layout

Modified hooks

The following hooks have been moved and have new names. Even though they are very similar to their former equivalents the layout has changed and thus the modules need to adapt their rendering.

Removed hook New hook Modification
displayAdminOrderRight displayAdminOrderSideBottom It is now displayed on the left which is why it was renamed based on its context not its position, since the layout is completely different it has no alias
displayAdminOrderLeft displayAdminOrderMainBottom It is now displayed on the right which is why it was renamed based on its context not its position, since the layout is completely different it has no alias
displayAdminOrderTabOrder and displayAdminOrderTabShip displayAdminOrderTabLink Both hooks are now combined in a single generic hook that allows you to include tab links the order view page, it only has the id_order as a parameter
displayAdminOrderContentOrder and displayAdminOrderContentShip displayAdminOrderTabContent Both hooks are now combined in a single generic hook that allows you to include tab contents the order view page, it only has the id_order as a parameter

These hooks have been aliased, although we recommend migrating to the new hooks and check that it integrates correctly with the new layout:

Deprecated hook New aliased hook Modification
displayBackOfficeOrderActions displayAdminOrderSide Although it has been aliased for convenience, the new hook is not displayed at the same place at all (it is now in the side column), so we suggest to verify how your code integrates into the new layout. If you need to add action buttons, use the new actionGetAdminOrderButtons hook
displayInvoice displayAdminOrderTop This hook has the same placement and parameters

These hooks have been added on the order view page:

New hook Function
displayAdminOrderSide It is displayed in the side column (similar to displayAdminOrderSideBottom) but right under the customer view
displayAdminOrderMain It is displayed in the side column (similar to displayAdminOrderMainBottom) but right under the details view
actionGetAdminOrderButtons It is used to build a collection of buttons in the order thanks to an ActionsBarButtonsCollection which is automatically rendered

These hooks have been added on the order list page:

New hook Function
displayOrderPreview It is displayed at the bottom of the order’s preview on the order’s listing page.

Product cover

A major bug has been fixed in product listing, for products with combinations the image displayed was the first one from the default combination, and the cover was ignored. This behaviour has been fixed but in order to allow modules to override this cover a new cover_image_id has been introduced. This image ID is then used to populate the product.cover field usable in the templates, if you want the default image for the combination (which was the previous behaviour) you can use the new product.default_image field.

If your theme overrides some of the classic theme templates and uses the $product.cover property you should check that it still matches the expected behaviour, especially in the themes/classic/templates/catalog/_partials/product-cover-thumbnails.tpl used in the product page where $product.default_image should be used.
You can read this FAQ if you want to know how to override the Product cover.

Product - quick view mode

In previous 1.7 versions if you wanted to check whether people are displaying product page using quick view, in a module hooked into displayProductAdditionalInfo, you could use this code:

$quickView = (Tools::getValue('action') == 'quickview)

From v1.7.7 due to changes related to dynamic refresh of displayProductAdditionalInfo in quick view modal, it’s no longer possible to do that this way.

From now on, you can always ask ProductController to tell you if customer is using quick view, using this code:

if ($this->context->controller instanceof ProductController && $this->context->controller->isQuickView()) {
    // We're in quick view mode
}

or directly in .tpl file:

{if $page.page_name == 'product' && Context::getContext()->controller->isQuickView()}
    We're in quick view mode for {$product.id_product} and attribute {$product.id_product_attribute}
{/if}

Modern Tabs for modern modules

Modern modules that use Symfony controller and routing can now use the $tabs property in their module class to automatically register Tabs in the BackOffice menu.

Also new in this version, when a module is enabled/disabled all its related Tab links are automatically shown/hidden.

Other changes

  • CLDR Specification\Number is now immutable
  • Configuration forms have been split up for security reasons
  • New alias for webpack namespace app -> @app
  • The clickable_row option on Grids' LinkRowAction now uses .clickable as a selector, modules that rely on this feature should make sure that their templates use the appropriate class
  • CLDR data has been updated to v36
  • Smarty has been updated to v3.1.34