Post by lalitsharma1607 » Tue May 08, 2012 9:53 pm

Hi guys,
is it possible to access another database's tables through opencart?


Posts

Joined
Tue May 08, 2012 9:30 pm

Post by straightlight » Wed May 09, 2012 9:32 am


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by lalitsharma1607 » Wed May 09, 2012 12:59 pm

Thanks a lot,
but for testing is there any free version?


Posts

Joined
Tue May 08, 2012 9:30 pm

Post by straightlight » Wed May 09, 2012 6:47 pm

No.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kabatza » Thu May 10, 2012 10:43 pm

I try to do the opposite!
I have another script which needs to access the OC database, and that side of the job is done.
Where I'm stuck is on the OC side.

Basically I need OC to fill 2 fields (customer email, and purchased product model) in a new table within the OC database.
Obviously I need this done only if the payment is confirmed, or if I change the status to complete manually.

Can somebody point me to the correct direction please?

Which files I need to edit?
Could I use session data for this? or do i need to do a database query?

Thanks in advance :)

Newbie

Posts

Joined
Wed Jun 15, 2011 10:59 pm

Post by straightlight » Fri May 11, 2012 12:34 am

Since this request seem to be about two fields, importing the data from CSV would be the most easiest solution.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by kabatza » Fri May 11, 2012 2:58 am

Hi,
Thanks for the reply
I'm not really looking for the easiest solution, and dealing with the CSV annoy me a bit .
I prefer an automatic unattended option. ::)

How about

Code: Select all

$this->db->query(INSERT INTO my_custom_table (email,model) VALUES ((select email from oc_order where oc_order.order_id='oc_order_product.order_id),(select model from oc_order_product where oc_order.order_id=oc_order_product.order_id)));
placed in catalog\model\checkout\order.php inside the "confirm" function?

will this also work when changing the order status to "complete" manually fro the admin?

I guess I'll have to give it a try while I'm waiting for a reply[/s]


No that was definitely the wrong file to edit..... I will keep trying :crazy:

Newbie

Posts

Joined
Wed Jun 15, 2011 10:59 pm
Who is online

Users browsing this forum: No registered users and 4 guests