Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to get rid of Script errors?


shayrgob

Recommended Posts

Ive finally got the indiv shipping contribution working but now ive 2 script errors when i go into the admin area to adjust a price of a product or to do anything pertaining to products or adjusting the price of them. These script errors are happening in admin/categories.php on lines 156 and 257.

 

Here is line 156:

 

 }

 

Its saying that this is expected: ')'

 

Here is line 257:

 

$insert_sql_data = array('products_id' => $products_id,

 

The error says that: Object expected.

 

I would really appreciate if someone can help me out w/ these errors. THanks

Link to comment
Share on other sites

Here is lines 151-162:

 

 $product_categories_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "'");
         $product_categories = tep_db_fetch_array($product_categories_query);

         if ($product_categories['total'] == '0') {
           tep_remove_product($product_id);
         }                              
       }

       if (USE_CACHE == 'true') {
         tep_reset_cache_block('categories');
         tep_reset_cache_block('also_purchased');
       }

 

Here is 252-266:

 

$sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),
                                   'products_description' => tep_db_prepare_input($HTTP_POST_VARS['products_description'][$language_id]),
                                   'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));

           if ($action == 'insert_product') {
             $insert_sql_data = array('products_id' => $products_id,
                                      'language_id' => $language_id);

             $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

             tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array);
           } elseif ($action == 'update_product') {
             tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
           }
         }

 

I really hope someone can help me out w/ this. THanks

Link to comment
Share on other sites

The "}" is a closing tag. You must have either too many or not enough. There must be one "}" for every "{" throughout the script. My first guess would be to delete or comment out the one on line 156. If that does not work start reading through and make sure that you have a closing tag for every opining tag. They can be grouped at the end of an instruction line like this:

where products_id = '" . (int)$product_id . "'");

$product_categories = tep_db_fetch_array($product_categories_query);

 

if ($product_categories['total'] == '0') {

tep_remove_product($product_id);

* }

* }

so don't worry if there seem to be spaces that have a lot, as long as open/close are equal. Good Luck!

Happy Coding!

Craig Garrison Sr

Anything worth having, is worth working for.

Multi Vendor Shipping V1.1 Demo Catalog

3 Vendors, each category, "buy" a product from each category to see how MVS works during checkout.

Multi Vendor Shipping V1.1 Demo Admin

login: [email protected]

pass: mvs_demo

MVS Thread:

Multi-Vendor Shipping

My contribs:

Download Multi Vendor Shipping V1.1

Vendor Email

Vendor Info in easypopulate

EZ Price Updater

And more to come!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...