Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Can I use existing database

Can I use existing database

Locked

Views: 780

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
29 Jun 2009, 8:25 AM
#1
thorn101 avatar

thorn101

New Zenner

Join Date:
Jun 2009
Posts:
1
Plugin Contributions:
0

Can I use existing database

Hi everyone,
After messing around with a commercial shopping cart solution for about 4 weeks now, I finally gave up on it. It just didn't have the features I needed and also the support was abysmal.

So ,I decided to try zen cart, since I like the features it has and this forum.

I have the following questions:

  1. Can I create product links that add the product to the cart.
  2. Also can I use an existing database to create the product links.

The following situation now,
I have a function that returns a url with the database variables like this

return  "http://".$URL."/cart.php?action=add&descr=".$var["name"]."&id=".$var["id"]."&price=".$var["price"];

This is one feature that made me decide to use the commercial shopping cart, but without support it's unworkable :(

Can I use a similar construction with zen cart?

Help will be greatly appreciated.

Alex

29 Jun 2009, 8:47 AM
#2
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Can I use existing database

Your existing database is likely to be structured very differently from the stracture used by zencart, so the answer is "no, you cannot use your existing database".

When you install zencart for the first time, the installation procedure constructs the database in the (complex) format that zc php code requires in order to function.

If you already have data (product data for example) in your current database, that you would like to use in your zencart installation, you will first have to EXPORT that data (content) in a format that can then be "re-shaped" to comply with the zencart dbase structure.

One way (probably the easiest) to do this, is to export your current product data as a CSV file.

Then, using a spreadsheet program (such as MSExcel) you re-format the organisation of the data so that it is organised in a way that is compatible with the zc database.

Then, using the EASY POPULATE MODULE (version 1.2.5.4) you can IMPORT that data into your zc database.

This would require that your FIRST install Easy Populate into your zc system: (there is a good wiki HERE)

Use the SAMPLE FILE in the module to help you determine the structure and organisation of the data, then, re-format your CSV spreadsheet to comply with that structure.

When your CSV (or TAB-DELIMITED) file is formatted correctly, you can use Easy Populate to bring that product data into your zencart setup.

29 Jun 2009, 8:53 AM
#3
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Can I use existing database

If you mean can you create links outside of what the cart normally creates, then yes. Make your links like this:

http://www.YOUR-DOMAIN.com/index.php?main_page=index&action=buy_now&products_id=420

replace YOUR-DOMAIN with your own and 420 with one of your own product IDs.
That will put an item right into the shoppers cart.

29 Jun 2009, 9:38 AM
#4
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Can I use existing database

Hey Kiddo... Thanks for the clarity! I wasn't seeing the wood for the trees on this one...