If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Questions related to database tables

Questions related to database tables

Locked

Started by superprg on 10 Aug 2006, 4:07 PM · Views: 3,426

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

Post #1 by superprg

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

ajeh

Oba-san

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

Post #2 by ajeh

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:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

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

superprg

Totally Zenned

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

Post #3 by superprg

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

drbyte

Sensei

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

Post #4 by drbyte

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

superprg

Totally Zenned

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

Post #5 by superprg

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

drbyte

Sensei

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

Post #6 by drbyte

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 ?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

superprg

Totally Zenned

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

Post #7 by superprg

DrByte:

Yes

Are you writing a book ?

Not as of now :)

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

drbyte

Sensei

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

Post #8 by drbyte

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...

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

superprg

Totally Zenned

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

Post #9 by superprg

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

drbyte

Sensei

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

Post #10 by drbyte

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

superprg

Totally Zenned

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

Post #11 by superprg

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?

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

kobra

Black Belt

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

Post #12 by kobra

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...

Zen-Venom Get Bitten

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

superprg

Totally Zenned

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

Post #13 by superprg

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!

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

ajeh

Oba-san

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

Post #14 by ajeh

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

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

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

ajeh

Oba-san

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

Post #16 by ajeh

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

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

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

kobra

Black Belt

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

Post #17 by kobra

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???

Zen-Venom Get Bitten

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

superprg

Totally Zenned

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

Post #18 by superprg

kobra:

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

superprg

Totally Zenned

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

Post #19 by superprg

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

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

ajeh

Oba-san

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

Post #20 by ajeh

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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!