1

I try to implement a modul, which adds a textarea at the end of the checkoutprocess in "Order Review", but the textarea is nowhere to be seen, when i enable the "Template Path Hints"-Debugoption, i can see that it load my customized .phtml file, but there isnt a textarea.

Setupscript works fine

"Terms and Conditions" are enabled

Module is enabled

Here is the code:

app/code/local/Practice/CheckoutComments/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Practice_CheckoutComments> <version>0.0.1</version> </Practice_CheckoutComments> </modules> <global> <resources> <checkoutcomments_setup> <setup> <module>Practice_CheckoutComments</module> </setup> </checkoutcomments_setup> </resources> <models> <checkoutcomments> <class>Practice_CheckoutComments_Model</class> <resourceModel>checkoutcomments_resource</resourceModel> </checkoutcomments> <checkoutcomments_resource> <class>Practice_CheckoutComments_Model_Resource</class> <entities> <comments_table> <table>checkout_comments</table> </comments_table> </entities> </checkoutcomments_resource> </models> </global> <frontend> <layout> <updates> <checkoutcomments> <file>practice/checkoutcomments.xml</file> </checkoutcomments> </updates> </layout> </frontend> </config> 

app/design/frontend/base/default/layout/practice/checkoutcomments.xml

<?xml version="1.0" encoding="UTF-8"?> <layout> <checkout_onepage_review translate="label"> <reference name="checkout.onepage.agreements"> <action method="setTemplate"> <template>practice/checkoutcomments/onepage/comment-agreements.phtml </template> </action> </reference> </checkout_onepage_review> </layout> 

app/design/frontend/base/default/template/practice/checkoutcomments/onepage/comment-agreements.phtml

<!-- Start of CheckoutComments module code --> <form action="" id="checkout-agreements" onsubmit="return false;"> <ol class="checkout-agreements"> <div> <br /><label for="checkoutcomments"><?php echo Mage::helper('core')->__('Add your Comment for this Order') ?></label> <textarea name="checkoutcomments" id="checkoutcomments" style="width: 450px; height: 100px;"></textarea> </div> <?php if ($this->getAgreements()) : ?> <!-- End of CheckoutComment module --> <?php foreach ($this->getAgreements() as $_a): ?> <li> <div class="agreement-content" <?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>> <?php if ($_a->getIsHtml()):?> <?php echo $_a->getContent()?> <?php else:?> <?php echo nl2br($this->escapeHtml($_a->getContent()))?> <?php endif; ?> </div> <p class="agree"> <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" /><label for="agreement-<?php echo $_a->getId()?>"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?></label> </p> </li> <?php endforeach ?> <?php endif; ?> </ol> </form> 
2
  • Is the rest of the form rendering? Commented Apr 22, 2015 at 7:24
  • here is Roland again (i forgot my password and i'm on a different computer right now) Yes,besides the first lines and the last line > <?php endif; ?> everything else is copied from the checkout/onepage/agreements.phtml Commented Apr 22, 2015 at 8:01

2 Answers 2

2

You want to know whether your layout.xml file is loaded:

  1. Turn on Developer mode
  2. make a typo in your layout.xml
  3. clear cache
  4. there should be an error. If there is no error, your layout.xml is not loaded

You want to know whether your template is set:

  1. Install xdebug
  2. check whether the setTemplate method is called on the right block

Make sure nothing else changes your template!

0

The Textarea html code should be inside <li> tag

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.