/** * 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; } [모집]겨울 새소리탐조 자원봉사자 모집 _12/9(토) | 시민정치마당 주요 콘텐츠로 건너뛰기
사이드바

[모집]겨울 새소리탐조 자원봉사자 모집 _12/9(토)

금, 2017/11/24- 18:26익명 (미확인) 에 의해 제출됨
관련 개인/그룹
지역

인쇄

인쇄   겨울 새소리탐조, 자원봉사자를 찾습니다.   시각장애 청소년들의 도우미가 되는 뿌듯한 일도 하고, 뚜루룩~ 두루미 소리를 듣는 즐거운 체험도 함께 해요! -일시 : 12/9 오전9시 -장소 : 철원 두루미 도래지 -모집인원 : 성인 5명 -하는일 : 시각장애 청소년들의 탐조 도우미 -출발장소 : 종로복지관 앞 -신청 및 문의 : 02-735-7060 / 010-2328-8361 (환경운동연합 시민참여팀)   *당일프로그램 9:00 철원으로 출발 11:30 점심 13:00 두루미 소리듣기 및 먹이주기, 박제체험 16:00 서울로 출발

댓글 달기

CAPTCHA
스펨 사용자 차단 질문