2011-02-18 2 views
4

파일 $MAGENTO_PATHapp/design/frontend/base/default/template/catalog/product/view/options/wrapper.phtml에서 다음 코드 줄을 볼 수 있습니다.Magento - 제품 옵션보기 또는 컨트롤러 파일

<?php echo $this->getChildHtml('', true, true);?> 

이것은 제품 페이지에 제품 옵션을 인쇄 할 책임이 있습니다. 이 코드 라인이 생성하는 html 콘텐츠를 이해하고 수정하고 싶지만 관련 뷰 또는 컨트롤러를 찾지 못하는 것 같습니다. 예를 들어 프로그래밍 방식으로 문자 & nbsp를 추가하려고한다고 가정 해 보겠습니다. phtml, php 또는 html 파일을 편집하려면 드롭 다운의 각 옵션 요소 innerHTML에?

이 질문에 대한 답은 제품 옵션을 검색하는 방법을 이해하는 데 도움이 될 것이라는 기대감이 있습니다. 그러면 다음과 같이 즉각적인 문제를 해결하는 데 도움이 될 것입니다.

Magento - Query for Product Options

답변

7

에 빈 값을 전달 모든 getChild 함수 중 하나가 사용됩니다. 이 경우 getChildHtml(''...은 각각의 toHtml 출력 결과를 반환합니다.

<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label"> 
    <label>Info Column Options Wrapper</label> 
    <block type="core/template" name="options_js" template="catalog/product/view/options/js.phtml"/> 
     <block type="catalog/product_view_options" name="product.info.options" as="product_options" template="catalog/product/view/options.phtml"> 
      <action method="addOptionRenderer"><type>text</type><block>catalog/product_view_options_type_text</block><template>catalog/product/view/options/type/text.phtml</template></action> 
      <action method="addOptionRenderer"><type>file</type><block>catalog/product_view_options_type_file</block><template>catalog/product/view/options/type/file.phtml</template></action> 
      <action method="addOptionRenderer"><type>select</type><block>catalog/product_view_options_type_select</block><template>catalog/product/view/options/type/select.phtml</template></action> 
      <action method="addOptionRenderer"><type>date</type><block>catalog/product_view_options_type_date</block><template>catalog/product/view/options/type/date.phtml</template></action> 
     </block> 
    <block type="core/html_calendar" name="html_calendar" as="html_calendar" template="page/js/calendar.phtml"/> 
</block> 

당신은 래퍼 블록이있는 '옵션'손자를 가지 뒤죽박죽 엉망에서 볼 수 있습니다

는 아이들이 우리가 catalog.xml 레이아웃 파일을 참조 할 필요가있는 무엇을 찾으려면 가능한 옵션의 여러 유형에 대한 여러 렌더러. 드롭 다운의 경우 catalog/product/view/options/type/select.phtml을 편집해야 할 수 있습니다.