0

I have an application which is supposed to share same database with another application ...Basically the customers are supposed to share among these two applications..Example.. www.test.com wants to read the customers of www.test1.com...So my question is ....

1)Can it be done by sharing same cookies on both the applications

2)I have tried connecting the core customer module with external db but unable to do the same....The core connection is always from the main db witten in local.xml file of the application...hOW IT CAN BE DONE

2 Answers 2

1

You can try connecting with an external database in the local.xml in the following way:

<database identifier>
                <connection>
                    <host><![CDATA[hostname]]></host>
                    <username><![CDATA[username]]></username>
                    <password><![CDATA[password]]></password>
                    <dbname><![CDATA[database name]]></dbname>
                    <model>mysql4</model>
                    <type>pdo_mysql</type>
                    <active>1</active>
                </connection>
 </database identifier>
3
  • but that ways it will connect the whole application with that databse..I just want that customer module to be connected with the external database.......Which I have tried by changing the connection in app/code/core/Mage/Customer/etc/config.xml but no effects..It is still showing the collection from the same db as in local.xml Commented Jun 4, 2014 at 10:22
  • anyoneee....please Commented Jun 4, 2014 at 10:35
  • HAs anyone got any answer till nowwwwwww Commented Jun 4, 2014 at 11:51
1

You can set-up your own connections via a module's xml or in the local.xml and use the connection identifiers for customer. These should look like customer_* and then there will be the normal, write, read and setup.

If you look into the file Mage_Core_Model_Resource you can see the function getConnection which loads the connection for each resource.

A note that this will work out of the box if your database structure is the same as Magento, if it is not the same then you will have to extend the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.