Skip to content

Commit

Permalink
Fix product serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Feb 18, 2023
1 parent af4d11f commit 3412abf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Subject.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getItemByKey($key)
switch ($matches['type']) {
case 'p':
$product = $em->find(Product::class, (int) $matches['id']);
if ($$product === null) {
if ($product === null) {
throw new UserMessageException(t('Unable to find the requested product (has it been deleted?).'));
}

Expand Down Expand Up @@ -202,15 +202,15 @@ abstract protected function updateProductVariationData(ProductVariation $product
*
* @return array
*/
protected function serializeProductForSearch($subject, Product $product)
protected function serializeProductForSearch(Product $product)
{
return [
'key' => "p:{$product->getID()}",
'name' => $product->getName(),
'sku' => (string) $product->getSKU(),
'quantitySteps' => $product->getQtySteps() ?: 1,
'quantityLabel' => (string) $product->getQtyLabel(),
'subjectData' => $this->serializeProductData($subject, $product),
'subjectData' => $this->serializeProductData($product),
];
}

Expand Down

0 comments on commit 3412abf

Please sign in to comment.