Skip to content

Commit

Permalink
Make sure the type is ProductLazyArray
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre RAMBAUD committed Dec 11, 2020
1 parent c560603 commit e4bfc32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/front/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
use PrestaShop\PrestaShop\Adapter\Image\ImageRetriever;
use PrestaShop\PrestaShop\Adapter\Presenter\AbstractLazyArray;
use PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductLazyArray;
use PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductListingPresenter;
use PrestaShop\PrestaShop\Adapter\Product\PriceFormatter;
use PrestaShop\PrestaShop\Adapter\Product\ProductColorsRetriever;
Expand Down Expand Up @@ -83,11 +84,11 @@ public function canonicalRedirection($canonical_url = '')
}
}

public function getCanonicalUrl(): string
public function getCanonicalURL(): string
{
$product = $this->context->smarty->getTemplateVars('product');

if (!($product instanceof Product)) {
if (!($product instanceof ProductLazyArray)) {
return '';
}

Expand Down

0 comments on commit e4bfc32

Please sign in to comment.