Skip to content

Commit

Permalink
Merge pull request #23 from Bdg0o/fix/product-first-image
Browse files Browse the repository at this point in the history
fix: php notice getting first entry of collection
  • Loading branch information
zawaze authored Sep 29, 2023
2 parents cecb1a8 + fb18dee commit f2df7ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Smarty/Plugins/BetterSeoMicroDataPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected function getStoreMicroData()
protected function getProductMicroData(Product $product, Lang $lang, $relatedProducts = [])
{
$product->setLocale($lang->getLocale());
$image = ProductImageQuery::create()->filterByProductId($product->getId())->orderByPosition()->find()[0];
$image = ProductImageQuery::create()->filterByProductId($product->getId())->orderByPosition()->find()->getFirst();
$pse = ProductSaleElementsQuery::create()->filterByProductId($product->getId())->filterByIsDefault(1)->findOne();
$psePrice = ProductPriceQuery::create()->filterByProductSaleElementsId($pse->getId())->findOne();
$taxCountry = $this->taxEngine->getDeliveryCountry();
Expand Down

0 comments on commit f2df7ce

Please sign in to comment.