PHP Programming

BryantH

Junior Member
Jan 3, 2008
5
0
0
I'm just getting started using PHP and am using OSCommerce PHP web program. The issue I'm having is that I need to install over 2200 products and really don't want to do it by hand. Does anyone here know how to automate this?

It would save me days of down time every six months while I remove the previous season's items and install the next.

The software being used is on a Linux box...PHPMYADMIN, MYSql, APACHE-2, OSCommerce.
 

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
gotta be a way to import all of it into the table using csv or someting. the problem comes into play when u need to have 1-many relationships in various tables.
i highly doubt theres 1 table just for products, it probably has category tables and what not
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Did you try a Google search using "OSCommerce database import" ? that sounds like what you're trying to do.
 

LuckyTaxi

Diamond Member
Dec 24, 2000
6,044
23
81
i think your best bet is to see how you add a product into the db and look at the various table and see what gets entered. you would think it all goes into one table and you can manipulate your data prior to import, but it's probably not as straight forward. if it's anything like the cart we use, it'll have categories, a table for pricing, skus, etc ...
 

BryantH

Junior Member
Jan 3, 2008
5
0
0
hmmm....not entirely sure how I can make it clear without muddying it up. The product line I have has different sections, ie....Bath and Body, Outdoor, etc. over 2200 products, and if I do each one individually, I copy the jpg's over to my linux box, go into OSCommerce admin and add one item at a time. From description to price. Then I have to go into PHPMYADMIN to make each one not a null value. Just seems to me that there is a way to automate it so all I have to do is copy it over, pics, descriptions, prices.

And I think it can be done via a CSV. The item numbers, pricing and descriptions are sent in an Excel file.

Also, I'm still trying to figure out where somethings are kept in OSCommerce as far as color values and other cosmetic values.
 

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
i've done it myself (building a automation tool that grabs data from a csv file (let's say from excel) and upload it to the database by coded sql calls.)

Just to note.

OS Commerce is a nightmare to code in. Spagetti code (no freaking structure to speak of).

It's based on PHP3 which had no classes at that time (if I recall)

Database tables aren't that bad though. Could be better, but it's not that bad.

 

BryantH

Junior Member
Jan 3, 2008
5
0
0
Oh tell me it's got no structure. I'm pulling my hair out trying to find the codes that allow me to change the default colors and a few other things. No rhyme or reason to where stuff is put. If I could have found an easier "free" PHP e-commerce website setup I would have used it. Unfortunately with almost no startup capital I'm having to do this on the cheap. Linux box was built with spare parts between me and a friend. I remote in with putty from my main computer and send files via FileZilla.

Also (and I apologize to those who are responding to this) I keep forgetting details for this. The products as I said earlier are separated by category but also individually numbered. But not in sequence. But each numbered item jpg has a corresponding number in the Excel file.

So anyway Hyperblaze, if you have an idea I'd love to hear/see it. Thanks for the response.

 

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
Originally posted by: BryantH
Oh tell me it's got no structure. I'm pulling my hair out trying to find the codes that allow me to change the default colors and a few other things. No rhyme or reason to where stuff is put. If I could have found an easier "free" PHP e-commerce website setup I would have used it. Unfortunately with almost no startup capital I'm having to do this on the cheap. Linux box was built with spare parts between me and a friend. I remote in with putty from my main computer and send files via FileZilla.

Also (and I apologize to those who are responding to this) I keep forgetting details for this. The products as I said earlier are separated by category but also individually numbered. But not in sequence. But each numbered item jpg has a corresponding number in the Excel file.

So anyway Hyperblaze, if you have an idea I'd love to hear/see it. Thanks for the response.

what does your template look like in excel?

there are a few tables to be concerned with in oscommerce when working with product items.

products
productstocategories
products_description

you can build a script, or an application for it.

The difference (in my opinion).

A script is one php page. an application consisting of several php pages part of a framework.
 

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
by the way, there are other e-stores out there.....

code structure was, zcart is very similar to oscommerce.

magneto however, they believe in classes! have not yet studied the code for it though.
 

NiKeFiDO

Diamond Member
May 21, 2004
3,901
1
76
Originally posted by: Hyperblaze
i've done it myself (building a automation tool that grabs data from a csv file (let's say from excel) and upload it to the database by coded sql calls.)

Just to note.

OS Commerce is a nightmare to code in. Spagetti code (no freaking structure to speak of).

It's based on PHP3 which had no classes at that time (if I recall)

Database tables aren't that bad though. Could be better, but it's not that bad.

They have implemented a better structure since then. They are using classes now-a-days.
Their structure is a bit hard to follow, but it's there. (have to run back to all the include files all the time to see what this or that function is really doing, which is annoying)
 

BryantH

Junior Member
Jan 3, 2008
5
0
0
Well I found an add-on for osCommerce, but even though it's called Easy Populate. It ain't all that easy. Instructions are pretty clear at the start on what files need copied over, what files need edited, etc. But as to actually implementing it. I'm lost. Thought I followed it's instructions clearly, but nothing happened. No new product showed up in my database.

What really is bad at this point, is I need to go LIVE with this website by the end of this month. And I'm getting nowhere fast.
 

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
Originally posted by: BryantH
Well I found an add-on for osCommerce, but even though it's called Easy Populate. It ain't all that easy. Instructions are pretty clear at the start on what files need copied over, what files need edited, etc. But as to actually implementing it. I'm lost. Thought I followed it's instructions clearly, but nothing happened. No new product showed up in my database.

What really is bad at this point, is I need to go LIVE with this website by the end of this month. And I'm getting nowhere fast.

I'm still waiting for you to answer my PM on certain questions.

If you want to have help, we can provide help.

 

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
Originally posted by: NiKeFiDO
Originally posted by: Hyperblaze
i've done it myself (building a automation tool that grabs data from a csv file (let's say from excel) and upload it to the database by coded sql calls.)

Just to note.

OS Commerce is a nightmare to code in. Spagetti code (no freaking structure to speak of).

It's based on PHP3 which had no classes at that time (if I recall)

Database tables aren't that bad though. Could be better, but it's not that bad.

They have implemented a better structure since then. They are using classes now-a-days.
Their structure is a bit hard to follow, but it's there. (have to run back to all the include files all the time to see what this or that function is really doing, which is annoying)

I actually noticed some of the classes today.

I'll redeem it a few points for that.

It's gone from "Absolutely Horrible" to "Could be better".

I wish they integrated classes more globally through the application.
 

BryantH

Junior Member
Jan 3, 2008
5
0
0
Sorry Hyperblaze, I didn't notice the PM. Responding to it now. Forgive me....I didn't have my glasses on the other day and did my best to read the boards. :)
 

thirtythree

Diamond Member
Aug 7, 2001
8,680
3
0
As far as the colors go, you may just have to modify the css file (just stylesheet.css in the root oscommerce folder I believe). I've only looked at oscommerce briefly but I couldn't find any options for changing colors in the admin side of it.