/** * 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; } 탈원전, ‘바다 에너지’가 앞당길까... | 시민정치마당 주요 콘텐츠로 건너뛰기
사이드바

탈원전, ‘바다 에너지’가 앞당길까...

목, 2017/08/24- 10:25익명 (미확인) 에 의해 제출됨
관련 개인/그룹
지역
탈원전, ‘바다 에너지’가 앞당길까 http://weekly.khan.co.kr/khnm.html?mode=view&code=114&artid=20170821182… [주간경향] 해양신재생에너지도 한계는 있다. 해양환경문제와 어민들의 어업권과 충돌하는 일이 잦기 때문이다. 예컨대 제주 대정앞바다에 추진 중인 해상풍력발전단지는 멸종위기종인 남방큰돌고래 서식지와 겹쳐 환경단체가 난색을 표하고 있다. 해상풍력 가동 때 블레이드(날개)·기어·타워 등에서 발생하는 소음과 진동, 그리고 저주파와 자기장은 남방큰돌고래에게 위협이 될 수 있다. 송상근 해수부 대변인은 “영국은 해양공간계획을 마련해 사전에 해양을 이용할 권역을 지정하고, 이에 따라 해양을 개발한다”며 “우리도 2022년까지 전 해안을 조사해 해양공간계획을 수립하고 ‘에너지개발구역’에서 신재생에너지 개발에 나서면 이 같은 충돌은 상당부분 줄어들 것”이라고 말했다. 해양수산개발원 성장동력실 관계자는 “해양에너지 보급을 위해서는 정책적 뒷받침이 반드시 필요하다”며 “연안해역의 이용밀도가 높고, 다양한 사업이 이뤄지는 한국의 해양공간 특성을 고려할 때 개발지역의 위치와 규모, 해양생태계 현황 등 개발 관련 정보를 투명하게 공개하고 이를 검증할 수 있는 시스템을 마련해 주민들의 공감대를 높이는 것이 무엇보다 필요하다”고 말했다.


ㆍ“우리나라 서해안은 청정에너지의 보고”… 조력, 파력 등 복합발전 기대세계 최대의 조력발전소는 어디에 있을까? 정답은 한국 시화호다. 2001년 건설을···

Tags

댓글 달기

CAPTCHA
스펨 사용자 차단 질문