Jump to content

BretSpark

Members
  • Content count

    32
  • Joined

  • Last visited

Everything posted by BretSpark

  1. BretSpark

    [Contribution] Products Specifications

    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. BretSpark

    [Contribution] Products Specifications

    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. BretSpark

    [Contribution] Products Specifications

    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. BretSpark

    [Contribution] Products Specifications

    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. BretSpark

    [Contribution] Products Specifications

    what about the not saving problem on the other tabs?
  6. BretSpark

    [Contribution] Products Specifications

    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. BretSpark

    [Contribution] Products Specifications

    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. BretSpark

    [Contribution] Products Specifications

    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. BretSpark

    [Contribution] Documents Manager

    Hi Jim, all seems to be working now. I am using the Document manager to upload the documents and associate them to the product. when i go to the product the attachments are displayed under the 'More Info' TAB. Just a quick question . In the catalog/includes/modules/documents_tab.php file on line 323 <?php // The Documents tab if ($documents_tab == true) { echo ' <div id="tabs-12">'; include( DIR_WS_MODULES . FILENAME_DOCUMENTS ); echo ' </div>'; } ?> </div> i have changed to <?php // The Documents tab if (DOCUMENTS_SHOW_PRODUCT_INFO == 'True') { echo ' <div id="tabs-12">'; include( DIR_WS_MODULES . FILENAME_DOCUMENTS ); echo ' </div>'; } ?> </div> Will this code be ok??? Regards Bret
  10. BretSpark

    [Contribution] Documents Manager

    thanks, i will have a go
  11. 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
  12. BretSpark

    [Contribution] Documents Manager

    Hi Jim, Just a quick question. i scrapped the previous version i had because i was having problems with the ckeditor addon. I have now downloaded oscommerce 2.3. Is it possible to include this document manager addon (version 2.2) my website that is version 2.3?? From what i can see the only page that will give me issues is the product_info.php? do you think it is possible ? If so where about do i change the code in the product_info page? If it is not possible do you know of any other addons where i can add product manuals etc to my site? Regards Bret
  13. BretSpark

    [Contribution] Products Specifications

    hahaha, you must have read my mind... I will try again from scratch
  14. BretSpark

    [Contribution] Products Specifications

    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
  15. BretSpark

    [Contribution] Products Specifications

    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
  16. BretSpark

    [Contribution] Products Specifications

    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???
  17. BretSpark

    [Contribution] Products Specifications

    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
  18. BretSpark

    [Contribution] Products Specifications

    Thanks, I downloaded the ckeditor addon, just having one issue. The installation document tell me to find <script language="javascript" src="includes/general.js"></script> in the admin/categories.php file. There is no line in the file like this? Any ideas where i need to add the reference to the ckeditor.js file ? Regards Bret
  19. BretSpark

    [Contribution] Products Specifications

    Hi Jim, Just a quick one. How do i get the product description to keep the same formatting when it is displayed. When i enter it it looks ok, but when you look at the website it does not seem to do the crlf. it just makes it into one complete sentence. Also do you know how i may show the technical specs of my products in a table format? Regards Bret
  20. BretSpark

    [Contribution] Documents Manager

    it worked thanks
  21. BretSpark

    [Contribution] Documents Manager

    Hi Jim, I am haveing a small problem with this addon. I have installed and tested locally and everything works fine. Once i uploaded to the remote server it gives me the following error when i try and open the pdf files associated with the products. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. i have looked at the htaccess file but i am not really sure what i should be looking for. Regards Bret
  22. BretSpark

    [Contribution] Documents Manager

    Sorry my bad, i did not see that you already posted this bug earlier..
  23. BretSpark

    [Contribution] Documents Manager

    Hi Jim, I think i found a bug. When i tried to open a brochure i attached to a product, the path to the file was a missing "/". In the file "catalog/includes/modules/documents.php" on line 60 old echo '<span class="document"><a href="' . tep_href_link (DIR_WS_DOCUMENTS . $products_documents['type_name'] .'/' . $products_documents['documents_name']) . '" target="_new">'; new echo '<span class="document"><a href="' . tep_href_link (DIR_WS_DOCUMENTS . $products_documents['type_name'] . $products_documents['documents_name']) . '" target="_new">'; regards bret
  24. BretSpark

    [Contribution] Products Specifications

    if you look at 'catalog/admin/includes/modules/products_specifications.php' line 42 sg2c.categories_id = '" . (int) $current_category_id . "' I am using zend 8.0 and it tells me that "$current_category_id" is undefined. There are numerous others like line 66,67,69 where it says that "$languages" is also undefined. There are also warnings such as Multiple annotations found at this line: - Undefined variable '$i' - Occurrence of '$i' Is this error or warning anything to worry about?
×