Skip to main content
deleted 4 characters in body
Source Link
Marius
  • 198.9k
  • 55
  • 431
  • 837

can you help me? i train make rewrite controller on magento 1.9.2.4 and i'm using php 7, my code like this Lesson/Test/controllers/CartController.php

<?php require_once "Mage/Checkout/controllers/CartController.php"; class Lesson_Test_CartController extends Mage_Checkout_CartController { # Rewrite of indexAction public function indexAction() { die('your method has been rewrited !!'); } } 

Lesson/Test/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Lesson_Test> <version>1.0.0</version> </Lesson_Test> </modules> <frontend> <routers> <checkout> <args> <modules> <Lesson_Test before="Mage_Checkout">Lesson_Test</Lesson_Test> </modules> </args> </checkout> </routers> </frontend> </config> 

etc/modules/Lesson_allLesson_All.xml

 <?xml version="1.0"?> <config> <modules> <Lesson_Test> <active>true</active> <codePool>local</codePool> </Lesson_Test> </modules> </config> 

but it not work, 404 not found, i acces http://127.0.0.1/magento/magento-tutorial/index.php/lesson thank you magento :) i'm learn from this

can you help me? i train make rewrite controller on magento 1.9.2.4 and i'm using php 7, my code like this Lesson/Test/controllers/CartController.php

<?php require_once "Mage/Checkout/controllers/CartController.php"; class Lesson_Test_CartController extends Mage_Checkout_CartController { # Rewrite of indexAction public function indexAction() { die('your method has been rewrited !!'); } } 

Lesson/Test/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Lesson_Test> <version>1.0.0</version> </Lesson_Test> </modules> <frontend> <routers> <checkout> <args> <modules> <Lesson_Test before="Mage_Checkout">Lesson_Test</Lesson_Test> </modules> </args> </checkout> </routers> </frontend> </config> 

etc/modules/Lesson_all.xml

 <?xml version="1.0"?> <config> <modules> <Lesson_Test> <active>true</active> <codePool>local</codePool> </Lesson_Test> </modules> </config> 

but it not work, 404 not found, i acces http://127.0.0.1/magento/magento-tutorial/index.php/lesson thank you magento :) i'm learn from this

can you help me? i train make rewrite controller on magento 1.9.2.4 and i'm using php 7, my code like this Lesson/Test/controllers/CartController.php

<?php require_once "Mage/Checkout/controllers/CartController.php"; class Lesson_Test_CartController extends Mage_Checkout_CartController { # Rewrite of indexAction public function indexAction() { die('your method has been rewrited !!'); } } 

Lesson/Test/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Lesson_Test> <version>1.0.0</version> </Lesson_Test> </modules> <frontend> <routers> <checkout> <args> <modules> <Lesson_Test before="Mage_Checkout">Lesson_Test</Lesson_Test> </modules> </args> </checkout> </routers> </frontend> </config> 

etc/modules/Lesson_All.xml

<?xml version="1.0"?> <config> <modules> <Lesson_Test> <active>true</active> <codePool>local</codePool> </Lesson_Test> </modules> </config> 

but it not work, 404 not found, i acces http://127.0.0.1/magento/magento-tutorial/index.php/lesson thank you magento :) i'm learn from this

Source Link
gufran
  • 81
  • 1
  • 10

rewrite controller not working

can you help me? i train make rewrite controller on magento 1.9.2.4 and i'm using php 7, my code like this Lesson/Test/controllers/CartController.php

<?php require_once "Mage/Checkout/controllers/CartController.php"; class Lesson_Test_CartController extends Mage_Checkout_CartController { # Rewrite of indexAction public function indexAction() { die('your method has been rewrited !!'); } } 

Lesson/Test/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Lesson_Test> <version>1.0.0</version> </Lesson_Test> </modules> <frontend> <routers> <checkout> <args> <modules> <Lesson_Test before="Mage_Checkout">Lesson_Test</Lesson_Test> </modules> </args> </checkout> </routers> </frontend> </config> 

etc/modules/Lesson_all.xml

 <?xml version="1.0"?> <config> <modules> <Lesson_Test> <active>true</active> <codePool>local</codePool> </Lesson_Test> </modules> </config> 

but it not work, 404 not found, i acces http://127.0.0.1/magento/magento-tutorial/index.php/lesson thank you magento :) i'm learn from this