2011-07-29 4 views
0

Magento를 처음 사용합니다. 모든 제품 페이지에 표시 할 양식을 만들었습니다. 가격이 바뀌면 알림 이메일과 가격을 묻는 것입니다. 그것은 작동하지만 문제는 내 블록이 <reference name="content"> 탭 안에있는 경우에만 작동합니다. 만약 내가 그것을 어디에 배치 할 수있는 다른 곳에서는 볼 수 있지만 양식은 작동하지 않습니다. 레이아웃 파일에 대한 내 코드는 다음과 같습니다. 난 그냥 내가 뭐하는 거지 만약 거기에 아무것도 알 필요가 잘못이를 붙여 넣어야 여기 magento 블록이 제품 페이지에서 작동하지 않습니다.

<layout> 

<catalog_product_view> 

    <reference name="content"> 
    <!-- <reference name="product.info"> 
      <reference name="alert.urls"> --> 
       <block type="catalog/product_view" before="-" name="ecom_pricenotify.temp" template="ecom_pricenotify/temp.phtml" /> 
     <!--  </reference> 
     </reference> --> 
    </reference> 
</catalog_product_view> 
catalog/product/view.phtml 템플릿에서

<div style="border:0px solid red; margin:0px auto;"> 

<?php $_product = $this->getProduct(); ?> 


<form id="test" action="<?php echo Mage::getUrl('pricenotify/pricenotify/db') ?>" method="post"> 

      <label for="price">Price *</label> 
      <input type="text" id="price" name="price" value="" class="required-entry validate-number"/><br /> 
      <label for="email">Email Address *</label> 
      <input type="text" id="email" name="email" value="" class="required-entry validate-email"/> 
      <input type="hidden" id="id" name="id" value="<?php echo $_product->getId() ?>" /> 
      <input type="hidden" id="propri" name="propri" value="<?php echo $_product->getPrice() ?>" /> 

      <input type="submit" name="submit" value="<?php echo $this->__('Submit') ?>" onclick="if(customForm.validator && customForm.validator.validate()) this.form.request(); return false;" /> 

</form> 

<script type="text/javascript"> 
//< ![CDATA[ 
var customForm = new VarienForm('test',false); 
//]]> 
</script> 

답변

0

내 templat의로 .phtml 코드 템플릿을 렌더링해야합니다.

+0

코어 파일을 잘못 편집하는 것은 아닙니다. –

+0

음, 그렇습니다. 자신 만의 테마를 만들어야합니다. [이 가이드] 참조 (http://www.magentocommerce.com/design_guide/articles/working-with-magento-themes) – vsushkov

+0

나는 magento 테마를 사용하여 작동하는지 확인하려고합니다. 내가 필요하다고 생각하지 않습니다. 내에서 테스트 할 테마 만들기 –