Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't Add Product to Cart-Error 1054 - Unknown column 'products_status' in 'field list'


sassychick0505

Recommended Posts

Hi,

 

I am not very familiar with osCommerce and I am trying to help a client's client with an issue. When we try to add a product to the cart, we are getting the following error:

 

1054 - Unknown column 'products_status' in 'field list'

select products_status from products where products_id = '1022'

[TEP STOP]

 

I've looked for the column "products_status" in the SQL databases using but I can't find it anywhere, so I'm wondering if it's been removed. But like I said, I'm not familiar at all with this ecommerce solution. 

 

The other issue is that it looks like it's an older version. The copyright is 2008 and it looks like it's wanting to use PHP version 4.0.4, but the server has recently been upgraded to 5.6, so I'm wondering if that's the issue.

 

If anyone could help shed some light on this I would be very grateful.

 

This is the website: http://reagentproteins.com/

 

Thank you so much!

Link to comment
Share on other sites

Hi,

this a standard column in oscommerces products table to show a product or not, you should use phpmyadmin and take a look at the structure of the table products first. Normally there should be a column products_weight and this Mysql statement should add products_status after products_weight where it belongs.

ALTER TABLE `products` ADD `products_status` TINYINT(1) NOT NULL DEFAULT '0' AFTER `products_weight`;

It is always better to do a DB backup first though.

 

Best regards

Christoph

Link to comment
Share on other sites

If the field 'products_status' is missing from db, you have just to create a new one :

products_status tinyint(1)

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Link to comment
Share on other sites

I don't know if this helps, but I've been reading that it could be the configure.php file, so here it is:

 

<?php
$HOST_NAME      = $_SERVER['SERVER_NAME'];
$DOCUMENT_ROOT  = $_SERVER['DOCUMENT_ROOT'].'/';
$BASE_URL          = "http://$HOST_NAME";
$SEARCH_PARAMETER = array('1'  =>'Entire site',
                              '2'  =>'Products',
                              '3'  =>'Knowledge Center',
                              '4'  =>'News & Events'
                              );
// for data import
$IMPORT_ERROR = array('1'=>'Number of column not matched.',
                      '2' => 'The uploaded File is not readable.',
                      '20' => 'No data found',
                      '1001'=>'Product Catalog is empty.'  ,
                      '1002'=>'Product Categories is empty.',
                      '1003'=>'Product Name is empty',
                      '1004'=>'Product SKU# is empty',
                      '1005'=>'Product Size is empty',
                      '1006'=>'Product Price is empty'

                     );
                          $FIX_CONTENT_ID = array(
                            '2' => 'About Us',
                          //  '3' => 'Technical Help',
                          //  '4' => 'What\'s New',
                            '5'  => 'Contact Us',
                            '6'  => 'Troubleshooting',
                         //   '7'  => 'Publications',
                         //   '8'  => 'FAQ',
                            '9'  => 'Help with Online Ordering',
                            '10'  => 'Log Off',
                            '11' => 'Register',
                            '12' => 'Refer a Colleague',
                            '13' => 'Registration Success',
                          //  '14' => 'Terms & Conditions' ,
                            '15' => 'News & Events'   ,
                            '16' => 'Calendar of Events'  ,
                            '17' => 'Knowledge Center' ,
                            '18' => 'Data Sheets',
                            '19' => 'Product Request',
                            '20' => 'Press Releases',
                            '21' => 'Journal Publications',
                            '22' => 'Terms of Use',
                            '23' => 'Privacy Policy',
                            '24' => 'Products'
                            );


                            define('HTTP_SERVER', $BASE_URL);
                            define('HTTP_CATALOG_SERVER', $BASE_URL);
                            define('HTTPS_CATALOG_SERVER', $BASE_URL);
                            define('ENABLE_SSL_CATALOG', 'false');
                            define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);
                            define('DIR_WS_ADMIN', '/admin/');
                            define('DIR_FS_ADMIN', $DOCUMENT_ROOT.'admin/');
                            define('DIR_WS_CATALOG', '/');
                            define('DIR_FS_CATALOG', $DOCUMENT_ROOT);
                            define('DIR_WS_IMAGES', '/images/');
                            define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
                            define('DIR_FS_IMPORT_DATA', DIR_FS_DOCUMENT_ROOT.'import_data/');

                            define('DIR_WS_INCLUDES', 'includes/');
                            define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
                            define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
                            define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
                            define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
                            define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
                            define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');
                            define('DIR_WS_BANNER_IMAGES', DIR_WS_CATALOG . 'images/banners/');

                            define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

                            define('DIR_WS_CATALOG_POFILE', DIR_WS_CATALOG . 'images/po_file/');
                            define('DIR_FS_CATALOG_POFILE', DIR_FS_CATALOG . 'images/po_file/');

                            define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
                            define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
                            define('DIR_FS_BANNER_IMAGES', DIR_FS_CATALOG . 'images/banners/');

                            define('IMAGE_WIDTH', '400');
                            define('IMAGE_HEIGHT', '400');
                            define('FILE_MAX_SIZE', '2MB');

                            define('STORE_SESSIONS', '');
                            define('USE_PCONNECT', 'false');
                            
                            if($HOST_NAME == 'reagentproteins.dis.com') {
                                define('DB_SERVER', 'localhost');
                                define('DB_SERVER_USERNAME', '');
                                define('DB_SERVER_PASSWORD', ');
                                define('DB_DATABASE', '');

                            }
                            else if($HOST_NAME == 'demo40.axxiem.com') {
                                define('DB_SERVER', 'localhost');
                                define('DB_SERVER_USERNAME', '');
                                define('DB_SERVER_PASSWORD', '');
                                define('DB_DATABASE', '');

                            }
                else
                 {
                define('DB_SERVER', 'localhost');
                define('DB_SERVER_USERNAME', '');
                define('DB_SERVER_PASSWORD', '');
                define('DB_DATABASE', 'reagent');
    
                 }
                 
                            ?>
 

Link to comment
Share on other sites

I'm guessing that you deleted the values for username and password in the above code. Otherwise, you will not get a database connect. And, there is a ' missing in the db_server_password which would also break things.

 

Otherwise, did you include a value for the products_status column or did you leave it at the default of 0? If you left it at zero then the code would likely not allow it to be added to the cart.

 

 

Mark

 

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...