Magento customer can't log in - magento

I just migrated my website. But I got a problem.
My customers can't log in to their account. When click log in on log-in page.
http://www.mywebsite.com/customer/account/login/
It should be log in on their account but it redirects the same page.
Please Help me how to fix that?

After upgrading to Magento 1.8.1 you need to edit your existing template files.
The files listed below need te be change in order to be compatible with Magento 1.8.1. If they exist in your custom theme, compare them to the original base/default/template files.
your_package/your_theme/template/customer/form/newsletter.phtml
your_package/your_theme/template/customer/form/login.phtml
your_package/your_theme/template/customer/form/edit.phtml
your_package/your_theme/template/customer/address/edit.phtml
your_package/your_theme/template/whishlist/view.phtml
your_package/your_theme/template/whishlist/sharing.phtml
your_package/your_theme/template/review/form.phtml
your_package/your_theme/template/persistent/customer/form/login.phtml
your_package/your_theme/template/persistent/checkout/onepage/login.phtml
your_package/your_theme/template/checkout/onepage/login.phtml
your_package/your_theme/template/checkout/multishipping/overview.phtml
your_package/your_theme/template/checkout/cart.phtml
your_package/your_theme/template/catalog/product/view.phtml
your_package/your_theme/template/sendfriend/send.phtml
your_package/your_theme/template/sales/reorder/sidebar.phtml
Edit these files and add <?php echo $this->getBlockHtml('formkey'); ?> after the <form ...> open tag

Step 1: Web_Customer.xml - Enabling custom module:
<?xml version=”1.0″?>
<config>
<modules>
<Web_Customer>
<active>true</active>
<codePool>local</codePool>
</Web_Customer>
</modules>
</config>
Step 2: config.xml – Configuration for our module:
<?xml version=”1.0″?>
<config>
<modules>
<Web_Customer>
<version>0.0.1</version>
</Web_Customer>
</modules>
<frontend>
<routers>
<customer><!– Name of core module to be overridden–>
<args>
<modules>
<Web_Customer before=”Mage_Customer”>Web_Customer</Web_Customer><!– Tell Magento to call our custom module before the Mage/Checkout module –>
</modules>
</args>
</customer>
</routers>
</frontend>
</config>
Step 3: Add the following code to line 139 just after the opening of loginPostAction() in AccountController.php
<?php
require_once(“Mage/Customer/controllers/AccountController.php”);
class Web_Customer_AccountController extends Mage_CUstomer_AccountController{
public function loginPostAction()
{
// generate form_key if missing or invalid
if (!($formKey = $this->getRequest()->getParam(‘form_key’, null)) || $formKey != Mage::getSingleton(‘core/session’)->getFormKey()) {
$this->getRequest()->setParams(array(‘form_key’ =>Mage::getSingleton(‘core/session’)->getFormKey()));
}
//Note*
// rest code is same as from Mage/Customer/controllers/AccountController.php
}
}
?>
After completing, don’t forget to clear Magento cache.

Go to template/customer/form/login.phtml and template/persistent/customer/form/login.phtml and under
<ul class="form-list">
Add the following code in the login form
<input type="hidden" name="form_key" value="<? echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
OR, if you are using the login form in several places with different template files
Copy app/code/core/Mage/Customer/controllers/AccountController.php to app/code/local/Mage/Customer/controllers/AccountController.php
Open the AccountController.php that you have copied to local and add the following code to line 139 just after the opening of loginPostAction()
// generate form_key if missing or invalid
if (!($formKey = $this->getRequest()->getParam('form_key', null)) || $formKey != Mage::getSingleton('core/session')->getFormKey()) {
$this->getRequest()->setParams(array('form_key' =>Mage::getSingleton('core/session')->getFormKey()));
}
http://www.blueclawsearch.co.uk/blog/2013/12/12/fix-customer-cannot-login-to-magento-1-8-1/

Related

Magento 1.9.X add product with custom options to cart from external site

I have an external website which allows a customer to design a product, then uses an HTML form to post this data. I need to take this information and add this product (with custom options) to the customer's cart in our Magento website, but I'm not sure how to go about this.
I tried something simple at first using URL redirect, but Magento 1.9.X no longer supports adding to cart like this:
$cart_url = "website.com/checkout/cart/add/product=" . $product_id . "&qty=1" //Include custom options somehow
<form action=<?php echo $cart_url?>>
<input type="hidden" value="pid"> product id </input>
<input type="hidden" value="option1"> custom option 1</input>
</form>
Doing research shows that I can also add an item with custom options through either writing a custom Controller or Events/Observers to add the item, but as I'm new to Magento I'm not sure how to trigger events and observer functions from outside of Magento.
Any help to point me in the right direction would be appreciated.
You will have to create a custom module in magento.
Create a file app/etc/MyExtension_AddProductFromUrl.xml
<config>
<modules>
<MyExtension_AddProductFromUrl>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Checkout/>
</depends>
</MyExtension_AddProductFromUrl>
</modules>
</config>
Create a file app/code/local/MyExtension/AddProductFromUrl/etc/config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<MyExtension_AddProductFromUrl>
<version>0.1.0</version>
</MyExtension_AddProductFromUrl>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<MyExtension_AddProductFromUrl before="Mage_Checkout">MyExtension_AddProductFromUrl</MyExtension_AddProductFromUrl>
</modules>
</args>
</checkout>
</routers>
</frontend>
</config>
Create a file app/code/local/MyExtension/AddProductFromUrl/controllers/CartController.php
<?php
require_once 'Mage/Checkout/controllers/CartController.php';
class MyExtension_AddProductFromUrl_Checkout_CartController extends Mage_Checkout_CartController {
# overloaded addAction
public function addAction() {
// generate form_key if missing or invalid
if (!($formKey = $this->getRequest()->getParam('form_key', null)) || $formKey != Mage::getSingleton('core/session')->getFormKey()) {
$this->getRequest()->setParams(array('form_key' =>Mage::getSingleton('core/session')->getFormKey()));
}
// do parent actions
parent::addAction();
}
}
?>
Also see
Magento - Add a product to the cart via query string without form_key parameter
https://magento.stackexchange.com/questions/37779/i-want-to-use-add-to-cart-via-url-in-magento-1-8-but-dont-know-which-files-to-c
I fought with this for a bit in 1.9.0.1, but St0iK's solution above worked with the following changes:
1) place the module .xml file in app/etc/modules (as opposed to app/etc)
2) In the controller file - i had to remove _Checkout_
class MyExtension_AddProductFromUrl_Checkout_CartController extends Mage_Checkout_CartController {
to
class MyExtension_AddProductFromUrl_CartController extends Mage_Checkout_CartController {
After these minor edits, it works perfectly. Not sure if these were only necessary for 1.9.0.1, but for whatever reason, they were.
To add a product to the cart, i just use the URL format
YOURSTORE.com/checkout/cart/add/product/123/qty/1
Great solution for external PPC or SEO landing pages that need a simple "buy now" button that drops right into your magento cart.

Magento Action Controller going to 404

For a custom module I created a new actioncontroller. But it doesn't execute. It's returns only a 404.
I tried already some solutions from stackoverflow, but no one is working for me. :(
Urls I tried to call my action:
http://pharmaprofit.dev/index.php/medipim/sync/
http://pharmaprofit.dev/medipim/sync/
http://pharmaprofit.dev/medipim/sync/index
Can you take a look in my code? Maybe it's just a typo I didn't see.
Crmart/Medipim/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Crmart_Medipim>
<version>0.1.0</version>
</Crmart_Medipim>
</modules>
<frontend>
<routers>
<medipim>
<use>standard</use>
<args>
<module>Crmart_Medipim</module>
<frontName>medipim</frontName>
</args>
</medipim>
</routers>
</frontend>
</config>
Crmart/Medipim/controllers/SyncController.php
class Crmart_Medipim_SyncController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
//
echo 'hello world!';
}
public function nowAction()
{
// ...
}
}
app/etc/modules/Crmart_Medipim.xml
<?xml version="1.0"?>
<config>
<modules>
<Crmart_Medipim>
<active>true</active>
<codePool>local</codePool>
</Crmart_Medipim>
</modules>
</config>
Ok. Fixed!
I had enabled to view storecodes in my url.
So when I enter http://pharmaprofit.dev/nl/medipim/sync/now instead of http://pharmaprofit.dev/medipim/sync/now , it's working!
Plug-in files created correctly check once below steps for you plug-in works.
Check that plugin is successfully registered or not form admin section
Admin ->System->configuration->Advance
check plugin is listed here
open the app/etc/local.xml and check the below line
<disable_local_modules>false</disable_local_modules>
the value must be false otherwise plugin will not work

Magento 1.9 redirect customer after registration

I would like to redirect all customers to a custom page after successful registration in Magento 1.9.
I have tried many things. Firstly, I am successfully overriding the core customer account controller.
I have attempted to customize the following actions:
createPostAction
_successProcessRegistration
_welcomeCustomer
By trying to set redirect url or by setting BeforeAuthUrl
//$successUrl = $this->_getUrl('*/*/index', array('_secure' => true));
$successUrl = $this->_getUrl('*/*/success');
$this->_getSession()->setBeforeAuthUrl('http://test.local/customer/account/success/');
if ($this->_getSession()->getBeforeAuthUrl()) {
$successUrl = $this->_getSession()->getBeforeAuthUrl(true);
}
return $successUrl;
Please note at this point, $successUrl is correct when it returns here. I see there are some post Dispatch methods that I am assuming are destorying this url and always returning to customer/account/index.
I have read several posts on this topic and cannot find a definitive answer that solves this question.
I have even set hidden form element 'success_url' in attempts to follow steps presented elsewhere as solutions to this.
What is the full, correct process that one needs to follow in order to be able to show a one time registration success page?
I know this is an old thread maybe this will help someone else out trying to accomplish the same thing. You can set the redirect URL in the register.phtml template directly without having to modify controllers or create a module. You can set success and error URLs with hidden inputs like this.
<input type="hidden" name="success_url" value="my-custom-success-url.html" />
<input type="hidden" name="error_url" value="my-custom-error-url.html" />
I used this to redirect the user back to where they entered the login/register process like this:
<?php $ref = $this->getRequest()->getParam('referer');?>
<input type="hidden" name="success_url" value="<?php echo !empty($ref)?Mage::helper('core')->urlDecode($ref):$this->getSuccessUrl(); ?>" />
if you want to do this for customer successfully then you can do this using event observer
after customer successfully magento trigger an event customer_register_success
This call an observer which will reequestion to custtom page
Mage::app()->getResponse()->setRedirct($Yourdreicurll);
Details:
Step1:
create config.xml is app/code/community/Amit/Custommodule/etc/ - See more at: http://www.amitbera.com/create-an-magento-extension-with-custom-database-table/#sthash.JSktrUD0.dpuf
and it code
<?xml version="1.0" ?>
<config>
<modules>
<Amit_Custommodule>
<version>1.0.0</version>
</Amit_Custommodule>
</modules>
<global>
<models>
<custommodule>
<class>Amit_Custommodule_Model</class>
</custommodule>
</models>
</global>
<frontend>
<events>
<customer_register_success>
<observers>
<notify_user>
<class>custommodule/observer</class>
<method>myredirection</method>
</notify_user>
</observers>
</customer_register_success>
</events>
</frontend>
</config>
Step2:
create module control file Module name as Amit_Custommodule.xml at app/etc/modules/
it code is
<?xml version="1.0"?>
<config>
<modules>
<Amit_Custommodule>
<codePool>community</codePool>
<active>true</active>
</Amit_Custommodule>
</modules>
</config>
Step3:
Create observer.php at Amit>Custommodule>Model
code is
<?php
class Amit_Custommodule_Model_Observer {
public function myredirection(Varien_Event_Observer $observer) {
$AccountController = $observer->getEvent()->getAccountController();
$Customer = $observer->getEvent()->getCustomer();
$response1 = Mage::app()->getResponse(); // observers have event args
$url = 'http://www.example.com/';
$response1->setRedirect($url);
Mage::app()->getFrontController()->sendResponse();
return;
}
}
You are doing this in right way, this is the best way to redirect customer to custom URL.
Go to customer accountcontroller find _welcomeCustomer method.
Search for $successUrl = $this->_getUrl('*/*/index', array('_secure' => true)); replace this code with your custom URL $successUrl = $this->_getUrl('costomURL', array('_secure' => true));
It works fine for me.

How to show user name of which user created a comment on an order in Magento 1.7

When one of us admins on our team creates a comment on an order, I'd like to show their name right their with the comment they wrote.
This will help us know who's commenting when we see a comment has been made.
I found somewhat of a solution for this for 1.4, but we're using 1.7, and I feel using the 1.4 solution would fail us here.
If anyone could help, that would be much appreciated. Thanks all!
SOLVED:
I listened to the answer by R.S, in his earlier, shorter edit, which said to simply add this code to:
/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php
public function addCommentAction(){
......
// get the login info of current user
$_user = Mage::getSingleton('admin/session');
$user['email'] = $_user->getUser()->getEmail();
$user['firstname'] = $_user->getUser()->getFirstname();
$user['lastname'] = $_user->getUser()->getLastname();
$order->addStatusHistoryComment($data['comment'] . " Add by {$user['firstname']}", $data['status'])
->setIsVisibleOnFront($visible)
->setIsCustomerNotified($notify);
And this works perfectly!
If you want to make it easier you could append the username of who write the comment to before or after the comment, instead of creating new fields in the database and less code. (eg. "This is my comment - added by xxxx yyyyy)
By creating a custom module that extend admin order controller. (see 'Overriding Frontend Core Controllers' http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/)
Create /app/code/local/RWS/OrderComment/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<RWS_OrderComment>
<version>0.1.0</version>
</RWS_OrderComment>
</modules>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<RWS_OrderComment before="Mage_Adminhtml">RWS_OrderComment_Adminhtml</RWS_OrderComment>
</modules>
</args>
</adminhtml>
</routers>
</admin>
</config>
Create
/app/code/local/RWS/OrderComment/controllers/Adminhtml/Sales/OrderController.php
(copy addCommentAction method from /app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php)
<?php
include_once Mage::getModuleDir('controllers', 'Mage_Adminhtml') . DS . 'Sales' . DS . 'OrderController.php';
class RWS_OrderComment_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Sales_OrderController
{
public function addCommentAction(){
......
// get the login info of current user
$_user = Mage::getSingleton('admin/session');
$user['email'] = $_user->getUser()->getEmail();
$user['firstname'] = $_user->getUser()->getFirstname();
$user['lastname'] = $_user->getUser()->getLastname();
$order->addStatusHistoryComment($data['comment'] . " Added by {$user['firstname']}", $data['status'])
->setIsVisibleOnFront($visible)
->setIsCustomerNotified($notify);
}
}
Create app/etc/modules/RWS_OrderComment.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<RWS_OrderComment>
<active>true</active>
<codePool>local</codePool>
</RWS_OrderComment>
</modules>
</config>

Magento override controller

I would like to do the above.
Ive overridden many files in the past...block, model, helper....but this one eludes me.
Can anyone see what im doing wrong here:
(ive edited this code...to include some of the recomendations now...)
Heres my folder structure (2 controller locations as a test):
/Idigital/Idgeneral/etc/config.xml
/Idigital/Idgeneral/controllers/Checkout/CartController.php
/Idigital/Idgeneral/controllers/CartController.php
Heres my config.xml:
<?xml version="1.0"?>
<config>
<modules>
<idigital_idgeneral>
<version>0.1.0</version>
</idigital_idgeneral>
</modules>
<global>
<blocks>
<idgeneral><class>Idigital_Idgeneral_Block</class></idgeneral>
</blocks>
</global>
<frontend>
<routers>
<checkout>
<use>standard</use>
<args>
<modules>
<Idigital_Idgeneral before="Mage_Checkout">Idigital_Idgeneral_Checkout</Idigital_Idgeneral>
</modules>
</args>
</checkout>
</routers>
<layout>
<updates>
<idgeneral>
<file>idigital.xml</file>
</idgeneral>
</updates>
</layout>
</frontend>
</config>
Ihave placed my controller file in 2 locations to test.
And heres the top of my FIRST controller file:
require_once 'Mage/Checkout/controllers/CartController.php';
class Idigital_Idgeneral_Checkout_CartController extends Mage_Checkout_CartController
{
public function testAction()
{
var_dump('inside checkout/cart/test');exit;
}
/**
* Add product to shopping cart action
*/
public function addAction()
{
blah...
}
Ans my second controller:
require_once 'Mage/Checkout/controllers/CartController.php';
class Idigital_Idgeneral_CartController extends Mage_Checkout_CartController
{
public function testAction()
{
var_dump('inside cart/test');exit;
}
/**
* Add product to shopping cart action
*/
public function addAction()
{
blah...
}
When i visit: /checkout/cart/add
Im directed to the mage controller...not my local. (i have var_dump stmts in each..so i can see which is ran).
When i visit /checkout/cart/test - i get a 404
When i visit /cart/add or cart/test - i get a 404
when i visit idgeneral/cart/test or idgeneral/cart/add - i get a 404
Create your module folders and files
app/code/local/MyNameSpace/MyModule/etc/config.xml
app/code/local/MyNameSpace/MyModule/controllers/Checkout/CartController.php
app/etc/modules/MyNameSpace_All.xml
Edit /etc/config.xml and Create app/code/local/MyNameSpace/MyModule/etc/config.xml with the following content:
<?xml version="1.0"?>
<config>
<modules>
<MyNameSpace_MyModule>
<version>0.1.0</version>
</MyNameSpace_MyModule>
</modules>
<global>
<!-- This rewrite rule could be added to the database instead -->
<rewrite>
<!-- This is an identifier for your rewrite that should be unique -->
<!-- THIS IS THE CLASSNAME IN YOUR OWN CONTROLLER -->
<mynamespace_mymodule_checkout_cart>
<from><![CDATA[#^/checkout/cart/#]]></from>
<!--
- mymodule matches the router frontname below
- checkout_cart matches the path to your controller
Considering the router below, "/mymodule/checkout_cart/" will be
"translated" to "/MyNameSpace/MyModule/controllers/Checkout/CartController.php" (?)
-->
<to>/mymodule/checkout_cart/</to>
</mynamespace_mymodule_checkout_cart>
</rewrite>
</global>
<!--
If you want to overload an admin controller this tag should be <admin> instead,
or <adminhtml> if youre overloading such stuff (?)
-->
<frontend>
<routers>
<mynamespace_mymodule>
<!-- should be set to "admin" when overloading admin stuff (?) -->
<use>standard</use>
<args>
<module>MyNameSpace_MyModule</module>
<!-- This is used when "catching" the rewrite above -->
<frontName>mymodule</frontName>
</args>
</mynamespace_mymodule>
</routers>
</frontend>
Note: The above didn’t work for me when I override catalog/product controller. I had to use:
<from><![CDATA[#^catalog/product/#]]></from>
<to>mymodule/mycontroller</to>
(notice the missing leading slash)
Since Magento 1.3 you can simply add your module to the frontend router. Rewrites are not neccessary any more:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<MyNameSpace_MyModule>
<version>0.1.0</version>
</MyNameSpace_MyModule>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<MyNameSpace_MyModule before="Mage_Checkout">MyNameSpace_MyModule</MyNameSpace_MyModule>
</modules>
</args>
</checkout>
</routers>
</frontend>
Please note that before=”Mage_Checkout” will load your controller first if available and fall back to Magento’s if not.
If the controller is in another folder, you’ll have to modify the code:
app/code/local/MyNameSpace/MyModule/controllers/Checkout/CartController.php.
Replace
<MyNameSpace_MyModule before="Mage_Checkout">MyNameSpace_MyModule</MyNameSpace_MyModule>
with
<MyNameSpace_MyModule before="Mage_Checkout">MyNameSpace_MyModule_Checkout</MyNameSpace_MyModule>
Edit 'controllers/Checkout/CartController.php'
Create app/code/local/MyNameSpace/MyModule/controllers/Checkout/CartController.php with the following content: (the only change to indexAction() is adding an error_log() call):
<?php
# Controllers are not autoloaded so we will have to do it manually:
require_once 'Mage/Checkout/controllers/CartController.php';
class MyNameSpace_MyModule_Checkout_CartController extends
Mage_Checkout_CartController
{
# Overloaded indexAction
public function indexAction() {
# Just to make sure
error_log('Yes, I did it!');
parent::indexAction();
}
}
Edit 'app/etc/modules/MyNameSpace_All.xml'
(This is to activate your module)
true
local
Edit 'app/design/frontend/[myinterface]/[mytheme]/layout/checkout.xml' and add the following to use the same update handle as before:
<mynamespace_mymodule_checkout_cart_index>
<update handle="checkout_cart_index"/>
</mynamespace_mymodule_checkout_cart_index>
(Note that these tags seem to be case sensitive. Try using all lowercase if this isn’t working for you)
[by Hendy: When I override catalog/product/view using the method described in this Wiki or here, I didn’t have to do the above. However, when using the 'cms way', I had to update the handle manually.]
The above item did not work for me (2009-02-19 by Jonathan M Carvalho)
I discovered that the file to change is app/design/frontend/[myinterface]/[mytheme]/layout/mymodule.xml
Add the following lines:
Point your browser to /checkout/cart/
In your PHP error log, you should find ‘Yes, I did it!’.
You need to be extra precise with the rewrite regular expression because errors are very hard to find.
<Idigital_Idgeneral before="Mage_Checkout">Idgeneral_Checkout</Idigital_Idgeneral>
Should be
<Idigital_Idgeneral before="Mage_Checkout">Idigital_Idgeneral_Checkout</Idigital_Idgeneral>
or try moving your custom controller up to
../Idigital/Idgeneral/controllers/CartController.php
and use
<Idigital_Idgeneral before="Mage_Checkout">Idigital_Idgeneral</Idigital_Idgeneral>
There is also an error in your <modules> tag location. It should be:
<config>
<modules>
<idigital_idgeneral>
<version>0.1.0</version>
</idigital_idgeneral>
</modules>
<global>
...
</global>
<frontend>
....
</frontend>
...
</config>
i.e <modules> shouldn't be inside <global>
Here's a good tutorial on how to dump the config tree that Magento sees as XML: http://alanstorm.com/magento_config
I'm leaving this here for the next poor developer forced to work with this jalopy. Much of the instructions here are pasted from the magento docs which like its source, is a twisted labyrinth of misdirection. Okay enough complaints...
This worked for me in version 1.8
Create your namespace and module:
/app/code/local/MyNameSpace/MyModule
Create your module config:
/app/code/local/MyNameSpace/MyModule/etc/config.xml
<?xml version="1.0" ?>
<config>
<modules>
<MyNameSpace_MyModule>
<version>0.1.0</version>
</MyNameSpace_MyModule>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<MyNameSpace_MyModule before="Mage_Checkout">MyNameSpace_MyModule_Checkout</MyNameSpace_MyModule>
</modules>
</args>
</checkout>
</routers>
</frontend>
Create your controller:
/app/code/local/MyNameSpace/MyModule/controllers/Checkout/CartController.php
<?php
require_once Mage::getModuleDir('controllers', 'Mage_Checkout').DS.'CartController.php';
class MyNameSpace_MyModule_Checkout_CartController extends Mage_Checkout_CartController
{
public function indexAction() {
// /var/log/debug.log should log the output
Mage::log('cart index override', null, 'debug.log');
// Call the parent class
parent::indexAction();
}
}
Enable your new module:
/app/etc/modules/MyNameSpace_All.xml
<?xml version="1.0" ?>
<config>
<modules>
<MyNameSpace_MyModule>
<active>true</active>
<codePool>local</codePool>
</MyNameSpace_MyModule>
</modules>
</config>
That's all thats needed. Now go celebrate, you just polished a turd! ;)
This is a little notification on the include path of the controller.
This include path can cause errors if the Magento Compiler mode is turned on.
require_once 'Mage/Checkout/controllers/CartController.php';
Instead of that it is good to use
require_once Mage::getModuleDir('controllers', 'Mage_Checkout').DS.'CartController.php';
It will be safer.
Well...it WONT override the checkout cart controller.
So i used the URL REWRITE in the PRODUCT VIEW...from this link...near the bottom of the article. They say its a proper method...
http://www.excellencemagentoblog.com/magento-add-product-to-cart-ajax
if(!url){
url = jQuery('#product_addtocart_form').attr('action');
}
url = url.replace("checkout/cart","idgeneral/cart");
That worked for me. Allows me to get cracking. Basically calls MY controller..instead of checkout controller.
Thanks for the help ROSCIUS...appreciated.
I also had to change my config....my routers section now looks like this:
<routers>
<!-- THIS PART REGISTERS OUR CONTROLLERS FOLDER FOR USE -->
<idgeneral>
<use>standard</use>
<args>
<module>Idigital_Idgeneral</module>
<frontName>idgeneral</frontName>
</args>
</idgeneral>
<!-- THIS PART WONT WORK TO OVERWRITE OUR MAGE CONTROLLER -->
<checkout>
<use>standard</use>
<args>
<modules>
<Idigital_Idgeneral before="Mage_Checkout">Idigital_Idgeneral_Checkout</Idigital_Idgeneral>
</modules>
</args>
</checkout>
</routers>

Resources