Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

BretSpark

Pioneers
  • Posts

    32
  • Joined

  • Last visited

Profile Information

  • Real Name
    Bret Spark

BretSpark's Achievements

  1. Hi Jim, i understand now thanks. Is there any particular reason why you dont add the slashes to the other product tabs "text" data? Regards Bret
  2. Hi Jim, Thanks for the bug fix. it is now saving the other tabs. I am still having the strange \r\n characters being saved under the description when i use the CK editor. The strange thing is all the other tabs save the data perfectly and reload it perfectly. I noticed that you are adding slashes products_description' => addslashes( tep_db_input( $_POST['products_description'][$language_id] ) ), during the product update section you just fixed for us. What is the reason for adding the slashes? please excuse my ignorance if this is a silly question. I removed the "addslashes" section and is still does strange things to the "description" data Any thoughts? Regards Bret
  3. I have had a look in the admin/categories file and the does not seem to be any reference to getting the data from the different tabs before saving. i have pasted the code that i have below. it is the same file from the latest addon you posted. the only change i made was adding in the xsell addon case 'update_product': if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']); $products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']); $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null'; $sql_data_array = array('products_quantity' => (int)tep_db_prepare_input($HTTP_POST_VARS['products_quantity']), 'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']), 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']), 'products_date_available' => $products_date_available, 'products_weight' => (float)tep_db_prepare_input($HTTP_POST_VARS['products_weight']), 'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']), 'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']), 'manufacturers_id' => (int)tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id'])); $products_image = new upload('products_image'); $products_image->set_destination(DIR_FS_CATALOG_IMAGES); if ($products_image->parse() && $products_image->save()) { $sql_data_array['products_image'] = tep_db_prepare_input($products_image->filename); } if ($action == 'insert_product') { $insert_sql_data = array('products_date_added' => 'now()'); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); tep_db_perform(TABLE_PRODUCTS, $sql_data_array); $products_id = tep_db_insert_id(); tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')"); } elseif ($action == 'update_product') { $update_sql_data = array('products_last_modified' => 'now()'); $sql_data_array = array_merge($sql_data_array, $update_sql_data); tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'"); } $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $language_id = $languages[$i]['id']; // Products Specifications $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]), 'products_description' => addslashes( tep_db_input( $_POST['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 . "'"); } } $pi_sort_order = 0; $piArray = array(0); foreach ($HTTP_POST_FILES as $key => $value) { // Update existing large product images if (preg_match('/^products_image_large_([0-9]+)$/', $key, $matches)) { $pi_sort_order++; $sql_data_array = array('htmlcontent' => tep_db_prepare_input($HTTP_POST_VARS['products_image_htmlcontent_' . $matches[1]]), 'sort_order' => $pi_sort_order); $t = new upload($key); $t->set_destination(DIR_FS_CATALOG_IMAGES); if ($t->parse() && $t->save()) { $sql_data_array['image'] = tep_db_prepare_input($t->filename); } tep_db_perform(TABLE_PRODUCTS_IMAGES, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and id = '" . (int)$matches[1] . "'"); $piArray[] = (int)$matches[1]; } elseif (preg_match('/^products_image_large_new_([0-9]+)$/', $key, $matches)) { // Insert new large product images $sql_data_array = array('products_id' => (int)$products_id, 'htmlcontent' => tep_db_prepare_input($HTTP_POST_VARS['products_image_htmlcontent_new_' . $matches[1]])); $t = new upload($key); $t->set_destination(DIR_FS_CATALOG_IMAGES); if ($t->parse() && $t->save()) { $pi_sort_order++; $sql_data_array['image'] = tep_db_prepare_input($t->filename); $sql_data_array['sort_order'] = $pi_sort_order; tep_db_perform(TABLE_PRODUCTS_IMAGES, $sql_data_array); $piArray[] = tep_db_insert_id(); } } } $product_images_query = tep_db_query("select image from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$products_id . "' and id not in (" . implode(',', $piArray) . ")"); if (tep_db_num_rows($product_images_query)) { while ($product_images = tep_db_fetch_array($product_images_query)) { $duplicate_image_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_IMAGES . " where image = '" . tep_db_input($product_images['image']) . "'"); $duplicate_image = tep_db_fetch_array($duplicate_image_query); if ($duplicate_image['total'] < 2) { if (file_exists(DIR_FS_CATALOG_IMAGES . $product_images['image'])) { @unlink(DIR_FS_CATALOG_IMAGES . $product_images['image']); } } } tep_db_query("delete from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$products_id . "' and id not in (" . implode(',', $piArray) . ")"); } // Start Products Specifications for ($i=0, $n=sizeof($languages); $i<$n; $i++) { // print 'Current Category ID: ' . $current_category_id; die; $language_id = $languages[$i]['id']; $specifications_query_raw = " select s.specifications_id from " . TABLE_SPECIFICATION . " s join " . TABLE_SPECIFICATIONS_TO_CATEGORIES . " sg2c on (sg2c.specification_group_id = s.specification_group_id and sg2c.categories_id = '" . (int) $current_category_id . "') "; $specifications_query = tep_db_query ($specifications_query_raw); $count_specificatons = tep_db_num_rows ($specifications_query); if ($count_specificatons > 0) { // print 'Specifications Exist!'; die; while ($specifications = tep_db_fetch_array ($specifications_query) ) { $specifications_id = (int) $specifications['specifications_id']; tep_db_query ("delete from " . TABLE_PRODUCTS_SPECIFICATIONS . " where products_id = '" . (int) $products_id . "' and specifications_id = '" . $specifications_id . "' and language_id = '" . $language_id . "' "); $specification = $_POST['products_specification'][$specifications_id][$language_id]; if (is_array ($specification) ) { foreach ($specification as $each_specification) { $each_specification = tep_db_prepare_input ($each_specification); if ($each_specification != '') { $sql_data_array = array ('specification' => $each_specification, 'products_id' => $products_id, 'specifications_id' => $specifications_id, 'language_id' => $language_id ); tep_db_perform (TABLE_PRODUCTS_SPECIFICATIONS, $sql_data_array); } // if ($each_specification } // foreach ($specification } else { $specification = tep_db_prepare_input ($specification); if ($specification != '') { $sql_data_array = array ('specification' => $specification, 'products_id' => $products_id, 'specifications_id' => $specifications_id, 'language_id' => $language_id ); tep_db_perform (TABLE_PRODUCTS_SPECIFICATIONS, $sql_data_array); } // if ($specification } // if (is_array ... else ... } // while ($specifications } // if ($count_specificatons } // for ($i=0 // End Products Specifications if (USE_CACHE == 'true') { tep_reset_cache_block('categories'); tep_reset_cache_block('also_purchased'); // XSell tep_reset_cache_block('xsell_products'); } tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id)); break;
  4. Sorry My BAD. I must learn to read. It does not save the text that i enter for the product under any of the tabs except for the description tab
  5. what about the not saving problem on the other tabs?
  6. would have thought is obvious. If you dont have any specifications yet on the product then you should have a way of entering the product specifications. When i run the website in debug mode, because i dont have any specs saved for the product the "$count_specificatons " will be = "0" That is what i was trying to say in the above message. It does not load the ckeditor or any other fields for me to enter the specifications for the product. It jumps over the section of code that creates an instance of the text field or ckeditor depending on which you use. On all the other tabs it opens the ckeditor for you to enter data. Except the "Specifications Tab" If you enter data in any of the other tabs excluding the description tab it does not save what you type in........
  7. Hi Jim, I am having a problem with the "specifications tab". when it calls the "products_specifications_input.php" line 37 if ($count_specificatons > 0) { There are no specifications yet for the product so it jump straight over the code and does not call line 109 echo tep_draw_textarea_field ('products_specification[' . $id . '][' . $languages[$i]['id'] . ']', 'soft', '70', '3', $products_specification); Any ideas what may be going wrong? Also if i enter data under any of the tabs other than the description tab it does not save. If you reload the product there is not data Regards Bret
  8. Hi Jim, You must be sick of hearing from me by now. I still seem to be having that problem with the CK Editor addon,, I have completely started my entire website from scratch again. I have added the product specs and the CK Editor. If i create a new product and type some text into the ckeditor with formatting it displays if fine on my website until i go back to admin and open the product again. it does not seem to load the data correctly back into the ckeditor. if i then go back to the website it has change d back to the \\rn rubbish again. Any suggestions beside not using the CK editor?? regards Bret
  9. Hi Jim, Love this addon, Makes the website look so much better. Just one question. How easy will it be to make all the menus such as the manufactures, information etc use the accordion menu? Regards Bret
  10. hahaha, you must have read my mind... I will try again from scratch
  11. still no joy, If i keep going into the product description in admin and click save on the ckeditor it keeps added rubbish. This is after saving three times without changing any text \r\n \\\\r\\\\n \\\\\\\\\\\\\\\\r\\\\\\\\\\\\\\\\n test \r\n \r\n \\\\r\\\\n \r\n \r\n \\\\r\\\\n \\\\\\\\\\\\\\\\r\\\\\\\\\\\\\\\\n \r\n \r\n \\\\r\\\\n \r\n If i add another (larger image) and add text in the ckeditor there it saves fine???? I am really confused now. If i view the second image on the website , click it the popup shows perfectly
  12. No joy, this is what it is saving into the DB. '<p>\\r\\n testing this filter</p>\\r\\n' which is then displaying rn testing this filter rn
  13. The strange thing is i am not pasting anything. If i simply type the word "testing" it comes out as rn testing rn on the web page. do you have any idea where i should look in the code to see what is going wrong???
  14. Hi, I got the ckeditor up in the descriptions admin section. all works fine. but then i go to the web site and it is add extra characters "\r\n" If i then go back to the editor it also shows up the "\r\n" extras??? Any ideas? Bret
×
×
  • Create New...