Forums / General Questions / Integrating ZenCart with a custom database

Integrating ZenCart with a custom database

Locked

Views: 709

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
19 Oct 2009, 2:34 AM
#1
tangiblelime avatar

tangiblelime

New Zenner

Join Date:
Oct 2009
Posts:
2
Plugin Contributions:
0

Integrating ZenCart with a custom database

I have a custom database of some 2.5k+ products that is currently completely separate from ZenCart. I need to use ZenCart with the merchant service to allow customers to pay with credit cards online.

So I need to figure out how to integrate the ZenCart database with my custom database, or at least get ZenCart to simply pull data from mine.

I do not want to:

  1. Duplicate the records in my database so both ZenCart and the original have the products.
  2. Use only the ZenCart database.

The db specs for my database:
Table: products
pid -- int(11)
productNumber -- tinytext
type -- int(11)
brand -- tinytext
color -- tinytext
category -- tinytext
description -- text
price -- double(10,2)
(pid is primary key)

I looked through the API and didn't find much.

Any ideas?

19 Oct 2009, 2:58 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Integrating ZenCart with a custom database

I do not want to:

  1. Duplicate the records in my database so both ZenCart and the original have the products.
  2. Use only the ZenCart database.To do this would require a complete re-write of the code to talk to a different DB Structure

Zen-Venom Get Bitten

19 Oct 2009, 3:02 AM
#3
tangiblelime avatar

tangiblelime

New Zenner

Join Date:
Oct 2009
Posts:
2
Plugin Contributions:
0

Re: Integrating ZenCart with a custom database

Would it be possible to use only a payment module in zencart? In other words, send the price of an item to zencart and have it process that amount?

19 Oct 2009, 3:04 AM
#4
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Location:
Melbourne, Australia
Posts:
532
Plugin Contributions:
0

Re: Integrating ZenCart with a custom database

Your table does looks more like an excel file and not like a DB schema. If this is the only table in your database i dont think you should use the Zencart database, export all you data to a CSV file and import it with EZ Populate to Zencart.

However, if you wish to try your modification, you would have to modify all SQL statements that access the zencart database to change it to your structure.

Here is an excerpt from database_tables.php that are concerned with product tables. However there are more tables for orders and customers and and and...

define('TABLE_PRODUCTS', DB_PREFIX . 'products');
define('TABLE_PRODUCT_TYPES', DB_PREFIX . 'product_types');
define('TABLE_PRODUCT_TYPE_LAYOUT', DB_PREFIX . 'product_type_layout');
define('TABLE_PRODUCT_TYPES_TO_CATEGORY', DB_PREFIX . 'product_types_to_category');
define('TABLE_PRODUCTS_ATTRIBUTES', DB_PREFIX . 'products_attributes');
define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', DB_PREFIX . 'products_attributes_download');
define('TABLE_PRODUCTS_DESCRIPTION', DB_PREFIX . 'products_description');
define('TABLE_PRODUCTS_DISCOUNT_QUANTITY', DB_PREFIX . 'products_discount_quantity');
define('TABLE_PRODUCTS_NOTIFICATIONS', DB_PREFIX . 'products_notifications');
define('TABLE_PRODUCTS_OPTIONS', DB_PREFIX . 'products_options');
define('TABLE_PRODUCTS_OPTIONS_VALUES', DB_PREFIX . 'products_options_values');
define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', DB_PREFIX . 'products_options_values_to_products_options');
define('TABLE_PRODUCTS_OPTIONS_TYPES', DB_PREFIX . 'products_options_types');
define('TABLE_PRODUCTS_TO_CATEGORIES', DB_PREFIX . 'products_to_categories');

Look for all files that use these tables and modify the statements to suit your needs. You definitely have to expand your current database if this is the only table that you currently have in your database.

19 Oct 2009, 3:05 AM
#5
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,845
Plugin Contributions:
0

Re: Integrating ZenCart with a custom database

Zen Cart is a shopping cart, not a checkout module.

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

19 Oct 2009, 3:07 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Integrating ZenCart with a custom database

Would it be possible to use only a payment module in zencart? In other words, send the price of an item to zencart and have it process that amount?
ZenCart is not designed to be used in pieces as you have described.

Zen-Venom Get Bitten