Zen Cart Logo
Forums / General Questions / Questions related to database tables

Questions related to database tables

Locked

Views: 3,410

Results 1 to 20 of 26
This thread is locked. New replies are disabled.
10 Aug 2006, 4:07 PM
#1
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Questions related to database tables

Hi
I have few questions related to tables in zencart so I am creating a new thread for it

  1. There is a table zen_order_products_download. What is the use of it?
  2. What is the purpose of column admin_level in zen_admin?

Thanks

10 Aug 2006, 4:45 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Questions related to database tables

If you have a download in the Order ... it would be handy to be able to give it to the customer ...

The admin level was/is for different capabilities of an admin ...

This was designed originally for sites to be able to "show off" their admin to someone and not get their shop destroyed ...

Currently, there are a lot of things that should be "more secure" based on this admin _level so we do not encourage its use unless:

1 you have a real clue what and why you are using it

2 you go through the whole admin and add this feature to more areas as needed to prevent annihilation of your shop by someone playing or being malicious ... :blink:

13 Aug 2006, 7:26 AM
#3
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

Thanks Ajeh

Few more questions related to products etc tables:

In the table zen_products what are these columns used for:
products_virtual
products_status
products_quantity_order_min
products_quantity_order_units
products_priced_by_attribute
product_is_free
product_is_call
products_quantity_mixed

Also, products_discount_type field gets its value from products_discount_quantity table...Is that right? Is it a constraint set up on the table? Is there any way I can see in phpmyadmin the foreign key constraints?

Also, for same product_id say 178 I can see 8 different records in the products_discount_quantity table. Does that mean that I can apply these discounts from time to time?
Thanks

13 Aug 2006, 8:50 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Questions related to database tables

Almost the entire database schema is documented in the wiki:
http://www.zen-cart.com/wiki/index.php/Developers_-_Database_Schema

The products table fields you asked about are here:
http://www.zen-cart.com/wiki/index.php/Table_products

for same product_id say 178 I can see 8 different records in the products_discount_quantity table. Does that mean that I can apply these discounts from time to time?if you look at the individual records, you will see the different prices which may be applied as discounts when the different quantity levels are reached. These are built using the Products Price Manager in the admin.

13 Aug 2006, 9:06 AM
#5
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

Thanks for the links
By 'different quantity levels', do you mean if the value of
discount_qty=3 it means that if customer buys three products, he will get a discount as stated in the products_discount_quantity table?
Thanks

13 Aug 2006, 9:11 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Questions related to database tables

superprg:

By 'different quantity levels', do you mean if the value of
discount_qty=3 it means that if customer buys three products, he will get a discount as stated in the products_discount_quantity table?
Thanks
Yes

Are you writing a book ?

13 Aug 2006, 9:14 AM
#7
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

DrByte:

Yes

Are you writing a book ?

Not as of now :)

PS: Would you like if I attempt to write one? :)

13 Aug 2006, 9:28 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Questions related to database tables

superprg:

Not as of now :)

PS: Would you like if I attempt to write one? :)
Was just wondering what the basis behind all your technical questions was...

13 Aug 2006, 10:14 AM
#9
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

I stil havent understood how sorting works in Categories:
Let us I have this for Category 'Hardware'
Hardware-> (6)
|_ CDROM Drives
|_ Graphics Cards (2)
|_ Keyboards (1)
|_ Memory
|_ Mice (2)
|_ Monitors
|_ Printers (1)
|_ Speakers

Now, in the database I have for category hardware, sort_order=1( and therefore it came on the top in the box)

But for let us say sub categories CDROM Drives, Graphics Cards, sort_order=0

What do I do in order to bring 'Graphics Cards' to top in the Hardware category?
Thanks
San

13 Aug 2006, 10:49 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Questions related to database tables

superprg:

I stil havent understood how sorting works in Categories:

Now, in the database I have for category hardware, sort_order=1( and therefore it came on the top in the box)

But for let us say sub categories CDROM Drives, Graphics Cards, sort_order=0

What do I do in order to bring 'Graphics Cards' to top in the Hardware category?
Give it a lower sort order to bring it up higher in the list.
This might require renumbering other categories to re-arrange sort orders.
NOTE: Blank (null) values come before numbered values. But normally you should not have any null values in sort order, so this is normally not an issue.

13 Aug 2006, 11:20 AM
#11
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

DrByte:

Give it a lower sort order to bring it up higher in the list.
This might require renumbering other categories to re-arrange sort orders.
NOTE: Blank (null) values come before numbered values. But normally you should not have any null values in sort order, so this is normally not an issue.
All the sub-categories
|_ CDROM Drives
|_ Graphics Cards (2)
|_ Keyboards (1)
|_ Memory
|_ Mice (2)
|_ Monitors
|_ Printers (1)
|_ Speakers

currently have sort order of 0
But in the database, there is no such order
How or why are they coming in this particular order?

13 Aug 2006, 12:00 PM
#12
kobra avatar

kobra

Black Belt

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

Re: Questions related to database tables

Superprg:

All of this is in the admin and you do not need to mess with the DB at all...

Admin > catalog > select categories/products > you will have a list of the categories and at the right under "sort" the order...if you want to change it select the green circle with the "E" inside at at the bottom of the page displayed you can set the order. Same for the products. In your shop...the order can be set back in the admin for the view that you are looking at in the store. Alpha or the order that is set in the catalog, or price and so forth.

For a basic shop.; 90%+ of all the settings are in the admin...no requirement to dig into the DB...

May I suggest that instead of posting your questions about the DB that you post what it is that you want to do...and you will be assisted as to how to accomplish what it is that you want to do.

I would have expected that one with 300+ posts would have that figured out by now...

13 Aug 2006, 12:53 PM
#13
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

Thanks kobra very much for the reply

kobra:

All of this is in the admin and you do not need to mess with the DB at all...
The reason why I am doing this is to understand databases better

kobra:

For a basic shop.; 90%+ of all the settings are in the admin...no requirement to dig into the DB...

Most of the times, yes I know how to do things from Admin and thats what user is supposed to do. Any changes should be done from the Admin I agree

kobra:

Superprg:

Admin > catalog > select categories/products > you will have a list of the categories and at the right under "sort" the order...if you want to change it select the green circle with the "E" inside at at the bottom of the page displayed you can set the order. Same for the products. In your shop...the order can be set back in the admin for the view that you are looking at in the store. Alpha or the order that is set in the catalog, or price and so forth.

Let me explain clearly
Currently sort order value for all these sub categories is 0:

|_ CDROM Drives
|_ Graphics Cards (2)
|_ Keyboards (1)
|_ Memory
|_ Mice (2)
|_ Monitors
|_ Printers (1)
|_ Speakers

That means whichever category they fall in they will be in top
Now, I changed the sort order for Graphics cards to 1
then I got this

|_ CDROM Drives
|_ Keyboards (1)
|_ Memory
|_ Mice (2)
|_ Monitors
|_ Printers (1)
|_ Speakers
|_ Graphics Cards (2)

Fine enough...
But what I dint understand is that for all categories except Graphics cards sort_order is 0 then who is deciding this particular order as I can see now( CD Rom, Keyboards etc) or is it just random?

Hope the question is clear

And sorry if my question is coming like a newbie question, but I want to be very clear
Thanks again!

13 Aug 2006, 1:20 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Questions related to database tables

0 is less than 1 so Graphics Cards at 1 comes after the other categories set at 0 ... :smile:

13 Aug 2006, 1:27 PM
#15
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

Thanks Ajeh
I got the answer here also :)
http://www.zen-cart.com/forum/showthread.php?t=43265

May be I have a long way to go before I understand zen cart! :)

13 Aug 2006, 1:40 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Questions related to database tables

one of those days ... see other thread for a way to do alpha/numeric text

13 Aug 2006, 1:40 PM
#17
kobra avatar

kobra

Black Belt

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

Re: Questions related to database tables

Fine enough...
But what I dint understand is that for all categories except Graphics cards sort_order is 0 then who is deciding this particular order as I can see now( CD Rom, Keyboards etc) or is it just random?
Looks to be alpha to me???

13 Aug 2006, 1:42 PM
#18
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

kobra:

Looks to be alpha to me???
Thats right kobra
Stupid me, took so much time to figure it out! :(

13 Aug 2006, 2:29 PM
#19
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: Questions related to database tables

Can someone in layman terms explain to me the relevance of these tables

zen_products_options
zen_products_options_types
zen_products_options_values
zen_products_options_values_to_products_options

Went through few records in my database but could not get much the purpose
Thanks

13 Aug 2006, 2:46 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Questions related to database tables

They manage the attribtues ...

If you do not have a shop set up with the demo data, perhaps it would be a good idea so you can see how the tables work with data in them and their relationships to one another ...