From 82eb175eb17677b9b8cfe7bbc43457fa253880a9 Mon Sep 17 00:00:00 2001 From: Mark Middleton Date: Mon, 27 Nov 2023 13:38:58 -0800 Subject: [PATCH] adding product attribute availableForPurchase to the attributes for varients --- src/services/AlgoliaSyncService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/AlgoliaSyncService.php b/src/services/AlgoliaSyncService.php index 88dc8a2..dc900f6 100644 --- a/src/services/AlgoliaSyncService.php +++ b/src/services/AlgoliaSyncService.php @@ -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; @@ -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; }