/** * 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('field_my_field')->getValue(); // 예: 각 라인아이템 별로 값 저장. $result[$item->id()] = $values; } $variables['my_custom_fields'] = $result; } 청년단우와 3회장 간담회 | 시민정치마당 주요 콘텐츠로 건너뛰기
사이드바

청년단우와 3회장 간담회

화, 2019/04/09- 00:21admin 에 의해 제출됨
관련 개인/그룹
지역
카테고리



 흥사단은 3월 26일 오후 7시부터 9시까지 흥사단 강당에서 청년들과 교감하며 소통하기 위한 ‘청년단우와 3회장 간담회’를 진행했다. 간담회에는 흥사단 3회장(류종열 이사장, 채영수 공의회 의장, 나종목 대표감사)과 원유준 전국청년위원회 회장, 박건률 전국대학생아카데미 회장, 나희진 흥민통 대학생통일아카데미 회장 등 흥사단에서 활동하고 있는 청년단우들이 참여했다.


 청년 단우들은 흥사단이 청년들에게 다가오는 의미와 청년과 선배 단우들이 함께 만들어 가는 흥사단의 모습에 대해 3회장과 의견을 나누었다. 간담회 참여자들은 과거의 청년 단우들이 지금의 흥사단을 일구어온 노력과 의미를 새기고 청년활동 활성화를 다짐했다.


..

댓글 달기