Magento Forum

Problem with own simple custom module: class is not included (Im very new with magento)
 
illo_sdrawkcab
Member
 
Total Posts:  63
Joined:  2008-10-23
 

Hello Magento Community,

i´m starting to learn magento. So after reading the documentaiions (User Guide and Designer Guide) i read the chapter about creating own modules in the book “php|architects guide to programming magento”.

I did exactly the same way it is described until i had to change the file app/design/frontend/default/default/template/catalog/product/view/type/simple.phtml. There, concerning the book, should be the template for the part where you can enter the Quantity. But all i have found was the template to display “in stock/ not in stock”.

So i searched logically other templates and found very quick what i needed.
Instead of simple.phtml i took the file addtocart.phtml one level higher. There i build my new template an wrote my new methods in - for my output.

my methods are in my method folder in app/code/local/Name/ModuleName/Block.

Additional i activated it in the config in root/etc/modules/Name_Module.xml and in my Methods´config i included the class with:

<?xml version="1.0" ?> 
- <config>
- <!--  
turn on our modulerequired for install support 
  
--> 
- <
modules>
- <
Name_Module>
  <
version>0.0.1</version
- <
depends>
- <!--  
no dependencies 
  
--> 
  </
depends>
  </
Name_Module>
  </
modules>
- <
blocks>
- <
catalog>
- <
rewrite>
  <
product_view_abstract>Name_Module_Block_ProductViewCase</product_view_abstract
  </
rewrite>
  </
catalog>
  </
blocks>
  </
config>

If i write hardcoded simply test in my template it is displayed in the frontend but if i try to call the method theres no reaction.

Can anybody tell me why? Did i forgot something ?

Thanks for help!

Greets from Germany
Oliver

PS.
I tried to get an simple string output from another class which i just included an i got this error:

Invalid method Mage_Catalog_Block_Product_View::doOutput(Array
(
)
)
Trace:
#0 [internal function]: Varien_Object->__call(’doOutput’, Array)
#1 C:\Programme\xampp\htdocs\magento\app\design\frontend\default\default\template\newproduct\product_view_addtocart.phtml(30): Mage_Catalog_Block_Product_View->doOutput()
#2 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(144): include(’C:\Programme\xa...’)
#3 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView(’frontend\defaul...’)
#4 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#5 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#6 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#7 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml(’addtocart’, true)
#8 C:\Programme\xampp\htdocs\magento\app\design\frontend\default\default\template\catalog\product\view.phtml(68): Mage_Core_Block_Abstract->getChildHtml(’addtocart’)
#9 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(144): include(’C:\Programme\xa...’)
#10 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView(’frontend\defaul...’)
#11 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#12 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Template->_toHtml()
#13 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Text\List.php(43): Mage_Core_Block_Abstract->toHtml()
#14 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): Mage_Core_Block_Text_List->_toHtml()
#15 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(503): Mage_Core_Block_Abstract->toHtml()
#16 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(454): Mage_Core_Block_Abstract->_getChildHtml(’content’, true)
#17 C:\Programme\xampp\htdocs\magento\app\design\frontend\default\default\template\page\2columns-right.phtml(56): Mage_Core_Block_Abstract->getChildHtml(’content’)
#18 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(144): include(’C:\Programme\xa...’)
#19 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(176): Mage_Core_Block_Template->fetchView(’frontend\defaul...’)
#20 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Template.php(193): Mage_Core_Block_Template->renderView()
#21 C:\Programme\xampp\htdocs\magento\app\code\core\Mage\Core\Block\Abstract.php(643): ....

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top