@bktrain @marrrecki
THANK YOU SO MUCH GUYS I FIXED IT, THANKS FOR EVERYTHING!!!!
- osCommerce Support Forum
- → Viewing Profile: Posts: Hani1188
Latest News: (loading..)
Community Stats
- Group Members
- Active Posts 16
- Profile Views 1,109
- Age Age Unknown
- Birthday Birthday Unknown
-
Real Name
Hani Kharufeh
-
Gender
Not Telling
Contact Information
0
Neutral
User Tools
Latest Visitors
Posts I've Made
In Topic: Error when trying to edit a product
18 June 2012 - 06:22 AM
In Topic: Error when trying to edit a product
18 June 2012 - 05:07 AM
@bktrain
Hey thats for the tip, but still can't located that. I should mention that I have yym installed as well.. but no problems with that..
bktrain, on 17 June 2012 - 03:15 PM, said:
Check the file where the error comes up, categories.php.
Look around line 400 or so for $product_query,
Look around line 400 or so for $product_query,
Hey thats for the tip, but still can't located that. I should mention that I have yym installed as well.. but no problems with that..
$product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
$dup_products_id = tep_db_insert_id();
// year make model
$q = mysql_query("select * from products_ymm where products_id=$products_id");
if (mysql_num_rows($q) > 0){
while ($r = mysql_fetch_assoc($q)){
mysql_query("insert into products_ymm set products_id=$dup_products_id , products_car_make = '".$r['products_car_make']."', products_car_model = '".$r['products_car_model']."', products_car_year_bof = '".$r['products_car_year_bof']."', products_car_year_eof = '".$r['products_car_year_eof']."' ");
}
}
$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
while ($description = tep_db_fetch_array($description_query)) {
tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
}
$product_images_query = tep_db_query("select image, htmlcontent, sort_order from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$products_id . "'");
while ($product_images = tep_db_fetch_array($product_images_query)) {
tep_db_query("insert into " . TABLE_PRODUCTS_IMAGES . " (products_id, image, htmlcontent, sort_order) values ('" . (int)$dup_products_id . "', '" . tep_db_input($product_images['image']) . "', '" . tep_db_input($product_images['htmlcontent']) . "', '" . tep_db_input($product_images['sort_order']) . "')");
}
tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
$products_id = $dup_products_id;
}
if (USE_CACHE == 'true') {
tep_reset_cache_block('categories');
tep_reset_cache_block('also_purchased');
}
}
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));
break;
}
}
// check if the catalog image directory exists
if (is_dir(DIR_FS_CATALOG_IMAGES)) {
if (!tep_is_writable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
} else {
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
}
require(DIR_WS_INCLUDES . 'template_top.php');
if ($action == 'new_product') {
$parameters = array('products_name' => '',
'products_description' => '',
'products_url' => '',
'products_id' => '',
'products_quantity' => '',
'products_model' => '',
'products_image' => '',
'products_larger_images' => array(),
'products_price' => '',
'products_weight' => '',
'products_date_added' => '',
'products_last_modified' => '',
'products_date_available' => '',
'products_status' => '',
'products_ship_sep' => '',
'manufacturers_id' => '');
$pInfo = new objectInfo($parameters);
if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {
$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.products_ship_sep, p.manufacturers_id " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);
$pInfo->objectInfo($product);
$product_images_query = tep_db_query("select id, image, htmlcontent, sort_order from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product['products_id'] . "' order by sort_order");
while ($product_images = tep_db_fetch_array($product_images_query)) {
$pInfo->products_larger_images[] = array('id' => $product_images['id'],
'image' => $product_images['image'],
'htmlcontent' => $product_images['htmlcontent'],
'sort_order' => $product_images['sort_order']);
}
}
$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
'text' => $manufacturers['manufacturers_name']);
}
$tax_class_array = array(array('id' => '0', 'text' => TEXT_NONE));
$tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
while ($tax_class = tep_db_fetch_array($tax_class_query)) {
$tax_class_array[] = array('id' => $tax_class['tax_class_id'],
'text' => $tax_class['tax_class_title']);
}
In Topic: Error when trying to edit a product
17 June 2012 - 09:06 AM
@marrrecki
Thank you so much for the reply.. I searched for the above code but I could not find it. I assume is would be in index.php or categories.php. I looked could not find an exact match. Can you point me in the right direction please?
Thank you so much for the reply.. I searched for the above code but I could not find it. I assume is would be in index.php or categories.php. I looked could not find an exact match. Can you point me in the right direction please?
- osCommerce Support Forum
- → Viewing Profile: Posts: Hani1188
- Privacy Policy
- Forum Rules ·



Find content

