/** * Implements hook_preprocess_commerce_checkout_form(). */ function bootstrap_barrio_subtheme_preprocess_commerce_checkout_form(&$variables) { $form = &$variables['form']; $custom_fields = []; // 주문 엔터티 추출 시도 $order = NULL; $possible_keys = ['#order', 'order', '#entity', 'checkout']; foreach ($possible_keys as $key) { if (!empty($form[$key]) && $form[$key] instanceof \Drupal\commerce_order\Entity\OrderInterface) { $order = $form[$key]; \Drupal::logger('mytheme')->debug('Order found with key: @key', ['@key' => $key]); break; } } // 대체 방법: 현재 체크아웃 단계에서 주문 엔터티 로드 if (!$order) { $checkout_flow = \Drupal::routeMatch()->getParameter('commerce_checkout_flow'); if ($checkout_flow) { $order = \Drupal::routeMatch()->getParameter('commerce_order'); \Drupal::logger('mytheme')->debug('Order loaded from route: @order_id', ['@order_id' => $order ? $order->id() : 'none']); } } if ($order && $order instanceof \Drupal\commerce_order\Entity\OrderInterface) { foreach ($order->getItems() as $order_item) { $variation = $order_item->getPurchasedEntity(); $product = $variation ? $variation->getProduct() : NULL; if ($product) { $footer_block_value = $product->hasField('field_footer_block') && !$product->field_footer_block->isEmpty() ? $product->field_footer_block->value : 'N/A'; $custom_fields[] = [ 'footer_block' => $footer_block_value, ]; \Drupal::logger('mytheme')->debug('Field footer_block value: @value for product: @product_id', [ '@value' => $footer_block_value, '@product_id' => $product->id(), ]); } else { \Drupal::logger('mytheme')->debug('No product found for order item: @id', ['@id' => $order_item->id()]); } } } else { $custom_fields[] = ['footer_block' => '주문 엔터티를 찾을 수 없습니다.']; \Drupal::logger('mytheme')->debug('No order entity found. Form keys: @keys', ['@keys' => implode(', ', array_keys($form))]); } $variables['custom_fields'] = $custom_fields; $variables['form_keys'] = array_keys($form); } function bootstrap_barrio_subtheme_preprocess_commerce_checkout_order_summary(&$variables) { /** @var \Drupal\commerce_order\Entity\OrderInterface $order */ $order = $variables['order_entity']; $result = []; foreach ($order->getItems() as $item) { $variation = $item->getPurchasedEntity(); // 커스텀 필드값 가져오기 (배열 형태). $values = $variation->get('body')->getValue(); // 예: 각 라인아이템 별로 값 저장. $result[$item->id()] = $values; } $variables['body'] = $result; } 한살림 우리 아기 냠냠 - 7월 승현이의 동글동글 집어먹는 오징어볼 | 시민정치마당 주요 콘텐츠로 건너뛰기
사이드바

한살림 우리 아기 냠냠 - 7월 승현이의 동글동글 집어먹는 오징어볼

화, 2016/07/12- 09:59익명 (미확인) 에 의해 제출됨
관련 개인/그룹
다음 주면 돌을 맞이하는 우리 승현이는 지금껏 크게 아픈 적 없이 튼튼하고 건강하게 무럭무럭 자라고 있습니다. 승현이를 보는 모든 사람들은 “건강하게 생겼어요”, “아기가 크네요. 튼튼해 보여요”라고 이야기합니다. 임신 전부터 건강한 식습관을 유지해 왔던 덕분이 아닌가 합니다. 요즘은 먹을 수 있는 음식이 점점 더 많아진 승현이와 함께 매주 한살림 매장으로 장 보러 가는 것이 무척 즐겁습니다. 이유식 완료기에 접어든 11개월 승현이가 무척 좋아하는 오징어볼은 만들기도 간단하답니다. 손에 잡히는 작은 크기의 핑거푸드 형태로 만들면 아이가 집어먹는 즐거움을 느끼고 스스로 식사를 해 냈다는 뿌듯함을 느낀답니다. 김안나.......

댓글 달기

CAPTCHA
스펨 사용자 차단 질문