Jump to content

access cookies from another domain


viper_tkd

Recommended Posts

Hi.

I have installed prestastashop 1.6.0.4.

For testing, until the stable release is done I want to enstablish a DB connection from outside the prestashop and collect some info from the PS DB.

 

For ex: I have PS installed in store.mywebsite.com/ and I want to have access to its DB (colect some data) from exterior (mywebsite.com/customer).

 

How can I do that?

 

I tried some examples like adding this:

include_once('path_to_prestashop/config/config.inc.php');
include_once('path_to_prestashop/config/settings.inc.php');
include_once('path_to_prestashop/classes/Cookie.php');
$cookie = new Cookie('ps');
my website crashes and in LOGS iit says: 
Unable to autoload class Tools: "tools.php" not found

This is just an example to collect data.I want to collect more data like: manufacturer, sold products, etc

 

Anyone do that before?

 

Thx

 

Link to comment
Share on other sites

Hi,

 

'Outside prestashop' is also a prestashop or something else

 

You want :

- Ps DB access to do sql queries ?

- Ps DB + prestashop classes ?

 

For first case you can connect directly to database if 'something else' is not prestashop.

For second, best answer would be webservice or a 'cron module' like, inside prestashop that would deliver data.

 

Regards

Edited by math_php (see edit history)
Link to comment
Share on other sites

Hi,

 

'Outside prestashop' is also a prestashop or something else

 

You want :

- Ps DB access to do sql queries ?

- Ps DB + prestashop classes ?

 

For first case you can connect directly to database if 'something else' is not prestashop.

For second, best answer would be webservice or a 'cron module' like, inside prestashop that would deliver data.

 

Regards

Hey,

Thx for the quick response.

I had connection to the database and I successfully pick any data I wanted.

 

But now, I have another problem.

 

For example someone uses my register.php to register on www.site.com.

In this case I've made an duplicate insert into the both databases(mine and prestashop's).

What I want to do is...

 

When someone logged in site.com(independent platform) when is typing store.site.com(the prestashop) also be logged in the store.

And vice versa.

 

Thx

Link to comment
Share on other sites

  • 7 months later...

Hey,

Thx for the quick response.

I had connection to the database and I successfully pick any data I wanted.

 

But now, I have another problem.

 

For example someone uses my register.php to register on www.site.com.

In this case I've made an duplicate insert into the both databases(mine and prestashop's).

What I want to do is...

 

When someone logged in site.com(independent platform) when is typing store.site.com(the prestashop) also be logged in the store.

And vice versa.

 

Thx

 

Hey, did you got it work how to stay user logged in when he changes store?

Link to comment
Share on other sites

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...