2011-06-14 7 views
1

그래서 이벤트 등록을 위해 제품 페이지에 다른 레이아웃을 표시하기 위해 사용자 정의 view.phtml 파일을 만들었습니다. 디자인 탭의 XML 필드에 추가하면 해당 사용자 지정보기 파일을 표시 할 수 있습니다.Magento : 사용자 정의 view.phtml을 내 제품 유형에 추가

내가 원하는 것은 이미 새로운 view-events.phtml을 사용하는 magento로 사용자 정의 제품 유형을 만드는 것입니다. 사용자 정의 제품 유형을 만드는 방법을 알고 있지만 사용자 정의보기 파일을 사용하기 위해 새 제품 유형을 얻는 방법은 무엇입니까? 에서

답변

3

모듈의 config.xml에 : 단지 참조 your_module.xml 레이아웃 파일에서 다음

<config> 
    <global> 
    <catalog> 
     <product> 
     <type> 
      <!-- Change "custom" to your custom product type --> 
      <custom> 
      <!-- See app/code/core/Mage/Catalog/etc/config.xml for hints here --> 
      </custom> 
     </type> 
     </product> 
    </catalog> 
    </global> 

    <frontend> 
    <layout> 
     <updates> 
     <!-- Use your module's name here --> 
     <your_module> 
      <file>your_module.xml</file> 
     </your_module> 
     </updates> 
    </layout> 
    </frontend> 

:

<layout> 
    <PRODUCT_TYPE_custom> 
    <reference name="product.info"> 
     <action method="setTemplate"> 
     <template>path/to/your/view-events.phtml</template> 
     </action> 
    </reference> 
    </PRODUCT_TYPE_custom> 
</layout> 
+0

내가 나를 위해 일하는 그 코드를 사용하지만 돈 ' 제품 가격 및 모든 하위 html을 보여줍니다. 내가 뭘 잘못하고 있는지 도울 수있어? –