/** * Get checkout gift card options. * * @param GiftCardProduct $product * @return array */ protected function getCheckoutGiftCardOptions(GiftCardProduct $product) { $checkoutGiftCardOptions = []; $giftcardAmounts = $product->getGiftcardAmounts(); $checkoutData = $product->getCheckoutData(); if (isset($checkoutData['options']['giftcard_options'])) { $checkoutGiftCardOptions = $checkoutData['options']['giftcard_options']; // Replace option key to value $amountOptionKey = str_replace('option_key_', '', $checkoutGiftCardOptions['giftcard_amount']); $checkoutGiftCardOptions['giftcard_amount'] = $giftcardAmounts[$amountOptionKey]['price']; } return $checkoutGiftCardOptions; }