Skip to content

Commit

Permalink
adding product attribute availableForPurchase to the attributes for v…
Browse files Browse the repository at this point in the history
…arients
  • Loading branch information
markmiddleton committed Nov 27, 2023
1 parent 575bcb0 commit 82eb175
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/AlgoliaSyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ public function prepareAlgoliaSyncElement($element, $action = 'save', $algoliaMe
if (!empty($element->ProductType)) {
$recordUpdate['attributes']['ProductType'] = $element->ProductType;
}
$recordUpdate['attributes']['availableForPurchase'] = (bool)$myProduct->availableForPurchase;
$recordUpdate['attributes']['isDefault'] = (bool)$element->isDefault;
$recordUpdate['attributes']['price'] = (float)$element->price;
$recordUpdate['attributes']['salePrice'] = (float)$element->salePrice;
Expand All @@ -554,7 +555,7 @@ public function prepareAlgoliaSyncElement($element, $action = 'save', $algoliaMe
$recordUpdate['attributes']['hasUnlimitedStock'] = (bool)$element->hasUnlimitedStock;
$recordUpdate['attributes']['minQty'] = (float)$element->minQty;
$recordUpdate['attributes']['maxQty'] = (float)$element->maxQty;

break;

}
Expand Down

0 comments on commit 82eb175

Please sign in to comment.