Jump to content

[SOLVED] Where is the order-source table in the DB?


Recommended Posts

I would like to find out the source and keywords of all my orders.

Also ps_orders and ps_order_detail don't seem to have any references to other source tables.

I found the table ps_connections_source but this is a general list of all connections. I want it filtered by orders / conversions.

Anyone know where I can find this?

Link to comment
Share on other sites

The order sources are displayed on the order page. AdminOrders.php uses the following code to get the order sources:

$sources = ConnectionsSource::getOrderSources($order->id);



This function uses the following SQL query:

return Db::getInstance()->ExecuteS('
SELECT cos.http_referer, cos.request_uri, cos.keywords, cos.date_add
FROM '._DB_PREFIX_.'orders o
INNER JOIN '._DB_PREFIX_.'guest g ON g.id_customer = o.id_customer
INNER JOIN '._DB_PREFIX_.'connections co  ON co.id_guest = g.id_guest
INNER JOIN '._DB_PREFIX_.'connections_source cos ON cos.id_connections = co.id_connections
WHERE id_order = '.intval($id_order).'
ORDER BY cos.date_add DESC');

Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...