PDA

View Full Version : Help setting up custom e-commerce connection to My.Shiprush



gcate
09-02-2015, 11:58 AM
Hi
I am trying to set up a connection from my custom e-commerce site to shiprush. Following steps in Custom-Development-Readme.txt.
I did get ShippingZSimulator.php working but can't get my own php to work.
Current messages I see in My.shiprush custom web store is this:

(Today, 07:39 PM) Error: The URL provided does not seem to connect to an ecommerce system (or perhaps the web store is not configured properly). Please check the URL and configuration for this web store. ERROR (33836A: Access denied for user 'root'@'localhost' (using password: NO)

Questions
1. where do I tell shiprush about my database?
In ShippingZZencart.pnp example file I see:
$cart_db_link = mysql_connect($db->host, $db->user, $db->password) OR die(mysql_error());
but don't see where host, user, and password get set.

2. Also where do all of these get set?
TABLE_ORDERS, TABLE_ORDERS_STATUS_HISTORY, DB_PREFIX

Thanks for any help!!
Genelle

SYSOPP
09-02-2015, 05:16 PM
Genelle,

There are two ways to hook.

You can "post in" to My.ShipRush

or

You write a piece of php to simulate what ShippingZMagento.php, ShippingZZencart.php etc do (I suggest looking at ShippingZZencart.php,, because it is closest to generic).

Does that help?

(If you want to post in to my.shiprush, let us know and we will send you the docs)

gcate
09-02-2015, 08:23 PM
I don't know what "post in" to My.ShipRush means. Can you point me to more info?

As far as the 2nd option...
That is what I have been trying to do. What I don't understand is when I look at ShippingZZencart.php I don't see how/where the specifics of my db would get set (host, dbuser, dbpassword, dbname).
What I have done in past to connect to a db is something like this:
$dbhost = "mysite.com";
$dbuser = "username";
$dbpass = "somepassword";
$dbname = "my_cart";
$connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);

I see in this in ShippingZZencart.php: $cart_db_link = mysql_connect($db->host, $db->user, $db->password) OR die(mysql_error());
which looks very similar to my example but where does $db->host get set? I don't see it.

thanks!
Genelle

SYSOPR
09-03-2015, 06:38 AM
I don't know what "post in" to My.ShipRush means. Can you point me to more info?

Here is the question to ask yourself:

Is it easier to:

1) In my system, send a post out to a web site when I get a new order or have data to send

or

2) In my system, it is easier to implement a php kit, a customized version of ShippingZZencart.php // the conversation we are having now

Whichever is easier is the path to take!



As far as the 2nd option...
That is what I have been trying to do. What I don't understand is when I look at ShippingZZencart.php I don't see how/where the specifics of my db would get set (host, dbuser, dbpassword, dbname).

The ShippingZZencart.php actually pulls in code from zen cart, so it gets its db connection from zen cart itself (includes/application_top.php).

So you have a choice to either (a) make your ShippingZMyCart.php pull in your existing php code, or to (b) make it stand alone and access the db directly.



What I have done in past to connect to a db is something like this:
$dbhost = "mysite.com";
$dbuser = "username";
$dbpass = "somepassword";
$dbname = "my_cart";
$connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);

That is fine. That is the 'b' approach: (make your ShippingZMyCart.php stand alone and access the db directly).


I see in this in ShippingZZencart.php: $cart_db_link = mysql_connect($db->host, $db->user, $db->password) OR die(mysql_error());
which looks very similar to my example but where does $db->host get set? I don't see it.

As mentioned, it is pulled in from the zen cart env.

gcate
09-03-2015, 07:08 AM
Thanks. That helps. For some reason I thought the example would be stand-alone. I will see what I can do with that.

Can you also send me info on how to "post in"?
thanks!
G

SYSOPR
09-03-2015, 09:00 AM
Can you also send me info on how to "post in"?

Sent your way.

gcate
09-03-2015, 03:04 PM
Thanks. Question answered. I have more questions but will post as new thread. :)

CrazyCoder
11-10-2015, 04:31 PM
Hi would it be possible to get an example of post-in?

SYSOPP
11-10-2015, 07:17 PM
Hi would it be possible to get an example of post-in?

We emailed the kit to you.

gcate
11-10-2015, 07:45 PM
Yes. Thank you.