Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Aug 2007
    Posts
    92
    Plugin Contributions
    0

    help question Adding a column to one of the database tables

    I'm needing to change the zen cart database slightly for stock choosing really. I need to be able to allocate a location reference to all the items in my stocklist. The way I want this to work is via the orders page in the admin panel. I want to add a text box next to each item in the order which will allow me to enter a location reference for that item. This ref no. will then allow my staff to find the items much easier in our warehouse.

    Before I change anything I was looking for your input with this please. I was wanting to know whether it is as simple as adding another column to the orders table in the mysql database or if its more complicated and id I'd need to change more tables than just that one.

    If anyone could give me some advice on this it would be much appreciated.

    Thanks in advance.

  2. #2
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Adding a column to one of the database tables

    follow this and you will have what you are looking for. it takes some time but is well worth it.

    http://www.zen-cart.com/forum/showth...+field+invoice

  3. #3
    Join Date
    Aug 2007
    Posts
    92
    Plugin Contributions
    0

    help question Re: Adding a column to one of the database tables

    Thanks for the quick reply. I've had a look at the link you posted. Before I start this I just wanted to clarify a few things.

    1. Which table would I be better adding the new column to, orders or orders_prducts?

    2. If I add a new column to any of the tables will it cause problems with my shop running as this site is still live and I can't afford for it to screw sutff up on the front of the site or stop customers placing orders.

    3. If I can get this to work with one extra column there's nothing really to stop my adding another few, right?

    Thanks for the help

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Adding a column to one of the database tables

    1. Which table would I be better adding the new column to, orders or orders_prducts?
    If you are not using the mdl# entry you could make this the location code
    2. If I add a new column to any of the tables will it cause problems with my shop running as this site is still live and I can't afford for it to screw sutff up on the front of the site or stop customers placing orders.
    Never do development work on your live shop - - make a test shop with it's own DB for this and keep good notes/steps to repeat a successful alteration
    3. If I can get this to work with one extra column there's nothing really to stop my adding another few, right?
    Adding "records" to a table is the easy part - - using the data and displaying the data becomes the code writing step(s)

  5. #5
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Adding a column to one of the database tables

    Quote Originally Posted by sketchhgal View Post
    Thanks for the quick reply. I've had a look at the link you posted. Before I start this I just wanted to clarify a few things.

    1. Which table would I be better adding the new column to, orders or orders_prducts?

    2. If I add a new column to any of the tables will it cause problems with my shop running as this site is still live and I can't afford for it to screw sutff up on the front of the site or stop customers placing orders.

    3. If I can get this to work with one extra column there's nothing really to stop my adding another few, right?

    Thanks for the help
    1. You should read the link that I gave you and follow those instructions. You should be adding it to the zen_products table. Which is what I did.

    2. Although its not recommended to do anything on live site, I was able to do this while my site was live and it did not have any problems affecting my site. Just be careful.

    3. You can as much as you want or do whatever you like if you are good enough. Thats the beauty of zen and open source.

  6. #6
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Adding a column to one of the database tables

    Quote Originally Posted by ebaobao View Post
    1. You should read the link that I gave you and follow those instructions. You should be adding it to the zen_products table. Which is what I did.

    2. Although its not recommended to do anything on live site, I was able to do this while my site was live and it did not have any problems affecting my site. Just be careful.

    3. You can as much as you want or do whatever you like if you are good enough. Thats the beauty of zen and open source.
    this link with crazy_chris info and my previous link will get you going.
    https://www.zen-cart.com/forum/showthread.php?t=57924

  7. #7
    Join Date
    Jan 2010
    Posts
    189
    Plugin Contributions
    1

    Default Re: Adding a column to one of the database tables

    The way I understood it, sketchhgal wanted to track extra information associated with each order, not each product, since the intent was to track warehouse locations. Also because an order can have many associated products. So wouldn't it make more sense to add the field to the orders table, not the products table? Or perhaps I misunderstood?

    Apsona
    http://apsona.com

  8. #8
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Adding a column to one of the database tables

    As stated sketchhgal's aim is to display the new information with each order, but the data itself is associated with each product (or sku), so adding it to the products table would appear more logical than adding it to orders.

    But the requirement does seem a little confused. The suggestion of a text box on the orders page for entering the information seems a little backwards, better to do a lookup on the product when it appears in an order.

    Also it's not clear once the information has been entered or looked up what is to be done with it. Presumably it's intended to go on the packing slip, but if this is the intention, then it's the packing slip that needs to change and not the order page.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  9. #9
    Join Date
    Aug 2008
    Posts
    448
    Plugin Contributions
    0

    Default Re: Adding a column to one of the database tables

    maybe sketchgal can be more clear with what she wants.

    the way I have mines setup is like this.
    1. able to enter location via admin > catalog > cats/products. the location field is like another field for the products attributes, etc.
    2. then when order comes in and order is printed out via packing slip, the order is printed out with the location next to each product.

  10. #10
    Join Date
    Jan 2010
    Posts
    189
    Plugin Contributions
    1

    Default Re: Adding a column to one of the database tables

    Ok, but if you put the field in the products table, what happens in the case where you have (say) five different orders pending for the same product? Each order would presumably need a different location for that product, but you can only have one location attached to the product.

    Or maybe I completely misunderstood?

    Apsona
    http://apsona.com

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Adding prefix to database tables
    By RyanKent in forum General Questions
    Replies: 3
    Last Post: 11 Sep 2011, 10:48 PM
  2. adding an image to the top corners of the center column
    By ilsita in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Oct 2009, 11:47 PM
  3. Create Database, Tables and Drop Database or Tables
    By elwood cordery in forum General Questions
    Replies: 3
    Last Post: 17 Aug 2009, 04:03 PM
  4. Replies: 2
    Last Post: 20 Feb 2009, 03:02 AM
  5. Adding new tables to the database
    By ChrisTenn in forum General Questions
    Replies: 2
    Last Post: 1 Feb 2007, 05:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg