Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Documentation and How To's:
STORE - how to integrate the Zen-cart with store
stella



Joined: 06 Jun 2006
Posts: 495
Location: sweden

Posted: 07/25/06 15:09 
I searched the entire forum and could not find any step by step how to integrate the zencart or cubecart with store. Therefore I wrote down this thread and recorde how difficult it is to have a cart in jamroom. If anyone here has done this before, please help me out. Thank you in advance.

1. Why cart and why Zen-cart
Cart let the user to select a bunch of mp3 from different artists,
cons and pros: it will let the user pay for one single account, and this single account need to forward the money to the artists.

why zen-cart, becuase it is free.

Payment pack, it certainly very good. The only problem is "it is not available" yet.

Start point,
1. install the Zen-cart to the server.

The zen-cart is provided as an install option from the web hosting cpanel, so one click, then I have Zencart installed. I do not have the SSH function. I am only allowed to do FTP.

2. login as admin to ZenCart, and set up a mp3 file and make it a downloadable item.
Instruction on how to do this? please read this

http://www.zen-cart.com/forum/showthread.php?t=40900&highlight=%22add+cart%22



Last edited by stella on 07/25/06 15:18; edited 1 time in total
Back to top
stella



Joined: 06 Jun 2006
Posts: 495
Location: sweden

Posted: 07/25/06 15:15 
3.
read this thread
http://www.zen-cart.com/forum/showthread.php?t=35682&highlight=%22add+cart%22

and replace the default classic template in Zen-cart with this very simplate template. How to replace the template in zen-cart, well, it is very well written in the install.txt in the package.

Why install this template, because this template only consists of just 11 files, 8 of which are images. And this template has all the funtions needed for a cart.

4. then I will study this simple cart.
the main things that I need to find out is the script for the
- "add to cart" button
- "continue"
- "checkout" button.

5. For the zen-cart login, I guess it can use the bridge.php that comes with jr3.06b.

I am now at step 4. Anyone has done this before, can point me a direction. Thanks in advance.

Back to top
stella



Joined: 06 Jun 2006
Posts: 495
Location: sweden

Posted: 07/25/06 15:36 
http://www.zen-cart.com/forum/showthread.php?t=36567
here summerized up some material for reading.

I am reading now how to customizing the ZC.

The zencart operate on the database through this file
Calling custom database tables - /includes/database_tables.php

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 07/25/06 15:54 
Stella -

I've moved this over to User Documentation and How-To's.. Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
stella



Joined: 06 Jun 2006
Posts: 495
Location: sweden

Posted: 07/25/06 16:07 
I can not figure this zen-cart out within 2 hours, so decided
- stop digging in Zen-cart for a while.
- disable the store function on the jr3.06b in my installation
- put time in tuning the skin and theme design
- waiting for the payment pack to be released by Brian.

Back to top
truebluewc



Joined: 24 Jan 2007
Posts: 27

Posted: 07/04/07 06:52 
I've developed a jamroom bridge script to bridge jamroom user signups to zencart. But when users sign up, no new entry is made into the zencart database. I checked the jamroom activity log, it says:

[signup.php] ****** has signed up for a new account (****@hotmail.com)
[signup.php] jrRunBridge() zencart: check user successful

Can anyone help me out?


Code
<?php
/**
 * zencart Jamroom Bridge Plugin
 * @package Talldude_Library
 * @subpackage Jamroom_Bridges
 * @copyright 2006 by Brian Johnson / Talldude Networks LLC
 * @author Brian Johnson - bigguy@talldude.net
 * @filesource
 * $Id: zencart.php,v 3.11 2006/12/05 16:57:26 bigguy Exp $
 */
defined('IN_JAMROOM') or exit();

//------------------------------------------------------------
// configuration
//------------------------------------------------------------
$GLOBALS['zencart']['server']   = 'localhost';     // machine zencart is running on
$GLOBALS['zencart']['dbname']   = '*********';        // zencart Database name
$GLOBALS['zencart']['dbuser']   = '*********';              // database user name
$GLOBALS['zencart']['dbpass']   = '*********';              // database user password
$GLOBALS['zencart']['prefix']   = 'zen_';        // default zencart table prefix
$GLOBALS['zencart']['language'] = 'english';       // default zencart user language

//------------------------------------------------------------
// You should not need to edit below here
//------------------------------------------------------------

/**
 * The jrBridge_check function is used before the "create" function
 * as a way to "precheck" the zencart forum and see if a user account
 * name already exists - this allows an error to be returned in
 * Jamroom so name duplication does not occur.
 *
 * @param array Incoming array of User Info
 *
 * @return bool Returns true/false on success/fail
 */
function jrBridge_zencart_check($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_create() Input _data array is empty!');
    }
    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    $user = dbEscapeString($_data['user_nickname']);
    // check to see if the user account already exists
    $req = "SELECT username
              FROM ".$GLOBALS['zencart']['prefix']."customers
             WHERE customers_nick = '".$user."'";
    $res = mysql_query($req,$con);
    if (mysql_num_rows($res) > 0) {
        return("ERROR: username ".$user." already exists in zencart user table!");
    }
    return(true);
}
function jrBridge_zencart_encrypt_password($plain) {
    $password = '';

    for ($i=0; $i<10; $i++) {
      $password .= zen_rand();
    }

    $salt = substr(md5($password), 0, 2);

    $password = md5($salt . $plain) . ':' . $salt;

    return $password;
  }
/**
 * The jrBridge_create function is used for "creating" a new
 * entry in the zencart forum.
 *
 * @param array Incoming array of User Info
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_create($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_create() Input _data array is empty!');
    }
    // our user password comes in unencrypted - lets MD5 it
    $pass = jrBridge_zencart_encrypt_password($_data['user_password']);
    $user = dbEscapeString($_data['user_nickname']);
    $req1 = "SELECT * FROM jamroom_user WHERE user_id='".$_data['user_id']."'";
   $res1 = mysql_query($req1,$con);
   $req2 = "SELECT * FROM jamroom_band_info WHERE band_id='".$res1['user_band_id']."'";
   $res2 = mysql_query($req1,$con);
    $grouppricing = dbEscapeString($res2['band_quota']);
    $mail = dbEscapeString($_data['user_emailadr']);

    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    // get what our next customers_id is going to be
    $req = "SELECT MAX(customers_id + 1) AS new_id FROM ".$GLOBALS['zencart']['prefix']."customers";
    $res = mysql_query($req,$con);
    if (mysql_num_rows($res) > 0) {
        $_row = mysql_fetch_assoc($res);
        $new_id = $_row['new_id'];
    }
    mysql_free_result($res);
    if (!is_numeric($new_id) || $new_id <= 1) {
        mysql_close($con);
        return("ERROR: unable to determine the incremental user_id value from zencart - verify database connectivity");
    }
    // Insert our User account
    $req = "INSERT INTO ".$GLOBALS['zencart']['prefix']."customers (customers_id,customers_gender,customers_nick,customers_default_address_id,customers__password,customers_email_address,customers_group_pricing)
            VALUES (".$new_id.",'m','".$user."',".$new_id.",'".$pass."','".$mail."',".$grouppricing.")";
    mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (isset($err)) {
        mysql_close($con);
        return("ERROR: failed to insert new user into the zencart customers table - MySQL error: ".$err."");
    }
    // Insert group account
    $req = "INSERT INTO ".$GLOBALS['zencart']['prefix']."address_book (address_book_id,customers_id,entry_gender,entry_country_id,entry_zone_id)
            VALUES (".$new_id.",".$new_id.",'m',223,57)";
    mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (isset($err)) {
        mysql_close($con);
        return("ERROR: failed to insert new user into the zencart address_book table<br>MySQL error: ".$err."");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_create function is used for "creating" a new
 * entry in the zencart forum.
 *
 * @param array Incoming array of User Info
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_update($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_create() Input _data array is empty!');
    }
    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    // Update User account
    $req = "UPDATE ".$GLOBALS['zencart']['prefix']."customers SET ";
    if (strlen($_data['user_password']) > 0) {
        $req .= "customers_password = '".jrBridge_zencart_encrypt_password($_data['user_password'])."',
                 customers_email_address    = '".dbEscapeString($_data['user_emailadr'])."' ";
    }
    else {
        $req .= "customers_email_address = '".dbEscapeString($_data['user_emailadr'])."' ";
    }
    $req .= "WHERE customers_nick = '".dbEscapeString($_data['user_nickname'])."'
             LIMIT 1";
    $res = mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (mysql_affected_rows($con) == 0) {
        mysql_close($con);
        return("ERROR: failed to update user ".$_data['user_nickname']." in zencart user table - MySQL error: ".$err."");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_delete function is used for "deleting" an entry
 * in the zencart forum.
 *
 * @param string Username to remove from forum
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_delete($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_delete() Input _data array is empty!');
    }
    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    // Delete User account
    $req = "DELETE FROM ".$GLOBALS['zencart']['prefix']."customers
             WHERE customers_nick = '".dbEscapeString($_data['user_nickname'])."'
             LIMIT 1";
    $res = mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (mysql_affected_rows($con) == 0) {
        mysql_close($con);
        return("ERROR: failed to delete user ".$_data['user_nickname']." from zencart user table - MySQL error: ".$err."");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_test function is used for "testing" the Bridge Plugin.
 * Any "checks" can be added to this function
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_test()
{
    // Test Database connection
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }

    // Test incremental USER ID select
    $req = "SELECT MAX(customers_id + 1) AS new_id FROM ".$GLOBALS['zencart']['prefix']."customers";
    $res = mysql_query($req,$con);
    if (mysql_num_rows($res) > 0) {
        $_row = mysql_fetch_assoc($res);
        $new_id = $_row['new_id'];
    }
    mysql_free_result($res);
    if (!is_numeric($new_id) || $new_id <= 1) {
        mysql_close($con);
        return("ERROR: unable to determine the incremental user_id value from zencart - verify database connectivity");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_login function is executed upon a successful login by
 * a Jamroom User Account.
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_login($_data)
{
    return(true);
}

/**
 * The jrBridge_logout function is executed upon a successful logout by
 * a Jamroom User Account.
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_logout($_data)
{
    return(true);
}

/**
 * The jrBridge_create function is used for "creating" a new
 * entry in the zencart forum.
 *
 * @param array Incoming array of User Info
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_connect()
{
    // Now connect up to the zencart database and do our work
    $con = mysql_connect($GLOBALS['zencart']['server'],$GLOBALS['zencart']['dbuser'],$GLOBALS['zencart']['dbpass']) or $err = mysql_errno() .' - '. mysql_error();
    if (isset($err)) {
        return('Invalid MySQL Server Name, Username or Password');
    }
    mysql_select_db($GLOBALS['zencart']['dbname'],$con) or $err = mysql_errno() .' - '. mysql_error();
    if (isset($err)) {
        return('Invalid MySQL Database');
    }
    return($con);
}
?>


Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 07/04/07 10:42 
Did you copy something like the phpBB2 bridge and just search and replace "phpBB2" with "zencart"? If you did, it's not that easy. You need to find out where the database schema of jamroom lines up with the database schema of zencart.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
truebluewc



Joined: 24 Jan 2007
Posts: 27

Posted: 07/04/07 11:12 
I based it on the phpBB2 jrbridge. I did as you said, but also checked into the zencart user creation and I've translated the phpBB2 fields into what the zencart fields need to be. This is where I am at now and that's the code used above. For some reason it's not correctly inserting the user into the database. I tested it inside the jamroom config area and it said it was fine and I'm not receiving errors in the activity logs.. so I'm just sort of reaching out for help incase I've missed something somewhere in my initial coding.

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 07/04/07 11:16 
The php code is right, or else it would be kicking out an error (actually, have you checked your php error log in the jamroom tools > server check?). It's hard to say without seeing the database schema.


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
truebluewc



Joined: 24 Jan 2007
Posts: 27

Posted: 07/04/07 11:50 
Okay I fixed the issue I was having. If anyone needs to know what the bridge looks like for Zencart, here it is. Feel free to add more fields if needed.


Code
<?php
/**
 * zencart Jamroom Bridge Plugin
 * @package Talldude_Library
 * @subpackage Jamroom_Bridges
 * @copyright 2006 by Brian Johnson / Talldude Networks LLC
 * @author Brian Johnson - bigguy@talldude.net
 * @filesource
 * $Id: zencart.php,v 3.11 2006/12/05 16:57:26 bigguy Exp $
 */
defined('IN_JAMROOM') or exit();

//------------------------------------------------------------
// configuration
//------------------------------------------------------------
$GLOBALS['zencart']['server']   = 'localhost';      // machine zencart is running on
$GLOBALS['zencart']['dbname']   = '**************';   // zencart Database name
$GLOBALS['zencart']['dbuser']   = '**************';   // database user name
$GLOBALS['zencart']['dbpass']   = '**************';   // database user password
$GLOBALS['zencart']['prefix']   = 'zen_';         // default zencart table prefix
$GLOBALS['zencart']['language'] = 'english';      // default zencart user language

//------------------------------------------------------------
// You should not need to edit below here
//------------------------------------------------------------

/**
 * The jrBridge_check function is used before the "create" function
 * as a way to "precheck" the zencart forum and see if a user account
 * name already exists - this allows an error to be returned in
 * Jamroom so name duplication does not occur.
 *
 * @param array Incoming array of User Info
 *
 * @return bool Returns true/false on success/fail
 */
function jrBridge_zencart_check($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_create() Input _data array is empty!');
    }
    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    $user = dbEscapeString($_data['user_nickname']);
    // check to see if the user account already exists
    $req = "SELECT *
              FROM ".$GLOBALS['zencart']['prefix']."customers
             WHERE customers_nick='".$user."'";
    $res = mysql_query($req,$con);
    if ($res != "" && mysql_num_rows($res) > 0) {
        return("ERROR: username ".$user." already exists in zencart user table!");
    }
    return(true);
}
function zen_rand($min = NULL, $max = NULL) {
   static $seeded;

   if (!$seeded) {
      mt_srand((double)microtime()*1000000);
      $seeded = true;
   }

   if (isset($min) && isset($max)) {
      if ($min >= $max) {
         return $min;
      } else {
         return mt_rand($min, $max);
      }
   } else {
      return mt_rand();
   }
}
function jrBridge_zencart_encrypt_password($plain) {
    $password = '';

    for ($i=0;$i<10;$i++) {
      $password .= zen_rand();
    }

    $salt = substr(md5($password), 0, 2);

    $password = md5($salt . $plain) . ':' . $salt;

    return $password;
  }
/**
 * The jrBridge_create function is used for "creating" a new
 * entry in the zencart forum.
 *
 * @param array Incoming array of User Info
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_create($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_create() Input _data array is empty!');
    }
    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    // our user password comes in unencrypted - lets MD5 it
    $pass = jrBridge_zencart_encrypt_password($_data['user_password']);
    $user = dbEscapeString($_data['user_nickname']);
    $req1 = "SELECT * FROM jamroom_user WHERE user_id='".$_data['user_id']."'";
   $res1 = mysql_query($req1,$con);
   $arr1 = mysql_fetch_array($res1);
   $req2 = "SELECT * FROM jamroom_band_info WHERE band_id='".$arr1['user_band_id']."'";
   $res2 = mysql_query($req1,$con);
   $arr2 = mysql_fetch_array($res2);
    $grouppricing = dbEscapeString($arr2['band_quota']);
    $mail = dbEscapeString($_data['user_emailadr']);

    // get what our next customers_id is going to be
    $req = "SELECT MAX(customers_id + 1) AS new_id FROM ".$GLOBALS['zencart']['prefix']."customers";
    $res = mysql_query($req,$con);
    if (mysql_num_rows($res) > 0) {
        $_row = mysql_fetch_assoc($res);
        $new_id = $_row['new_id'];
    }
    mysql_free_result($res);
    if (!is_numeric($new_id) || $new_id <= 1) {
        mysql_close($con);
        return("ERROR: unable to determine the incremental user_id value from zencart - verify database connectivity");
    }
    // Insert our User account
    $req = "INSERT INTO ".$GLOBALS['zencart']['prefix']."customers (customers_id,customers_gender,customers_nick,customers_default_address_id,customers_password,customers_email_address,customers_group_pricing)
            VALUES ('".$new_id."','m','".$user."','".$new_id."','".$pass."','".$mail."','".$grouppricing."')";
    mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (isset($err)) {
        mysql_close($con);
        return("ERROR: failed to insert new user into the zencart customers table - MySQL error: ".$err."");
    }
    // Insert group account
    $req = "INSERT INTO ".$GLOBALS['zencart']['prefix']."address_book (address_book_id,customers_id,entry_gender,entry_country_id,entry_zone_id)
            VALUES ('".$new_id."','".$new_id."','m','223','57')";
    mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (isset($err)) {
        mysql_close($con);
        return("ERROR: failed to insert new user into the zencart address_book table<br>MySQL error: ".$err."");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_create function is used for "creating" a new
 * entry in the zencart forum.
 *
 * @param array Incoming array of User Info
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_update($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_create() Input _data array is empty!');
    }
    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    // Update User account
    $req = "UPDATE ".$GLOBALS['zencart']['prefix']."customers SET ";
    if (strlen($_data['user_password']) > 0) {
        $req .= "customers_password = '".jrBridge_zencart_encrypt_password($_data['user_password'])."',
                 customers_email_address    = '".dbEscapeString($_data['user_emailadr'])."' ";
    }
    else {
        $req .= "customers_email_address = '".dbEscapeString($_data['user_emailadr'])."' ";
    }
    $req .= "WHERE customers_nick = '".dbEscapeString($_data['user_nickname'])."'
             LIMIT 1";
    $res = mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (mysql_affected_rows($con) == 0) {
        mysql_close($con);
        return("ERROR: failed to update user ".$_data['user_nickname']." in zencart user table - MySQL error: ".$err."");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_delete function is used for "deleting" an entry
 * in the zencart forum.
 *
 * @param string Username to remove from forum
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_delete($_data)
{
    // Verify we recieved our input array
    if (!is_array($_data)) {
        return('ERROR: jrBridge_delete() Input _data array is empty!');
    }
    // Now connect up to the zencart database and do our work
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }
    // Delete User account
    $req = "DELETE FROM ".$GLOBALS['zencart']['prefix']."customers
             WHERE customers_nick = '".dbEscapeString($_data['user_nickname'])."'
             LIMIT 1";
    $res = mysql_query($req,$con) or $err = mysql_errno() ."-". mysql_error();
    if (mysql_affected_rows($con) == 0) {
        mysql_close($con);
        return("ERROR: failed to delete user ".$_data['user_nickname']." from zencart user table - MySQL error: ".$err."");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_test function is used for "testing" the Bridge Plugin.
 * Any "checks" can be added to this function
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_test()
{
    // Test Database connection
    $con = jrBridge_zencart_connect();
    if (!is_resource($con)) {
        return("ERROR: unable to open the zencart database - MySQL error: ".$con."");
    }

    // Test incremental USER ID select
    $req = "SELECT MAX(customers_id + 1) AS new_id FROM ".$GLOBALS['zencart']['prefix']."customers";
    $res = mysql_query($req,$con);
    if (mysql_num_rows($res) > 0) {
        $_row = mysql_fetch_assoc($res);
        $new_id = $_row['new_id'];
    }
    mysql_free_result($res);
    if (!is_numeric($new_id) || $new_id <= 1) {
        mysql_close($con);
        return("ERROR: unable to determine the incremental user_id value from zencart - verify database connectivity");
    }
    mysql_close($con);
    return(true);
}

/**
 * The jrBridge_login function is executed upon a successful login by
 * a Jamroom User Account.
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_login($_data)
{
    return(true);
}

/**
 * The jrBridge_logout function is executed upon a successful logout by
 * a Jamroom User Account.
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_logout($_data)
{
    return(true);
}

/**
 * The jrBridge_create function is used for "creating" a new
 * entry in the zencart forum.
 *
 * @param array Incoming array of User Info
 *
 * @return mixed Returns error string on failure, bool true on success
 */
function jrBridge_zencart_connect()
{
    // Now connect up to the zencart database and do our work
    $con = mysql_connect($GLOBALS['zencart']['server'],$GLOBALS['zencart']['dbuser'],$GLOBALS['zencart']['dbpass']) or $err = mysql_errno() .' - '. mysql_error();
    if (isset($err)) {
        return('Invalid MySQL Server Name, Username or Password');
    }
    mysql_select_db($GLOBALS['zencart']['dbname'],$con) or $err = mysql_errno() .' - '. mysql_error();
    if (isset($err)) {
        return('Invalid MySQL Database');
    }
    return($con);
}
?>


Back to top
podarama



Joined: 17 May 2007
Posts: 264
Location: Long Island, NY

Posted: 07/19/07 10:59 
Looks like some nice code there. In a few simple steps what's the the sum of processes needed to use that script? *Where to put it, how to reference it and does any changes need to be done to the jamroom database?

Thanks Smile
M

Back to top
truebluewc



Joined: 24 Jan 2007
Posts: 27

Posted: 07/20/07 17:55 
1. Download code into zencart.php file you create and replace the default info with the database information to connect to your zencart.

2. Place zencart.php at YOUR_JAMROOM/include/plugins/jrBridges/zencart.php and upload to your web server.

3. Log into your Jamroom as Admin and navigate to Control Panel.

4. Go to "jamroom config"

5. Go to "System Settings"

6. Scroll down about 11 items down, you will see "Active Bridge Script", select zencart from there. A good idea would be to test the script also by hitting the "test" button next to it.

7. Update Settings; now you should be set!

Back to top
podarama



Joined: 17 May 2007
Posts: 264
Location: Long Island, NY

Posted: 07/25/07 12:44 
OK got the bridge working.. How can I make a link to an item in the zencart from jamroom. Any tips?

We bought the proton full template and wanted to change the BUY NOW buttons to link right into each item in the ZenCart

Back to top
WhyMan



Joined: 20 Mar 2007
Posts: 43
Location: Canada

Posted: 09/11/07 11:01 
Hi there,

Was wondering if anyone had this working with the latest release of zencart & the latest release of Jamroom (ver 3.1.3)? seems i get an error when trying to add the bridge..
Code
ERROR: unable to determine the incremental user_id value from zencart - verify database connectivity
Any Ideas or sugestions appreciated, thanks


_________________
Buck-Host.com Hosting that starts at Justa Buck!!
Back to top
therockgarage



Joined: 17 Oct 2007
Posts: 1

Posted: 10/19/07 14:31 
does anyone have a working example of the zencart integration into Jamroom?

thanks, i'd like to see one working.

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Documentation and How To's

12Next >
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.