Jump to content

VJ

Members
  • Content count

    170
  • Joined

  • Last visited

Everything posted by VJ

  1. Hello, I'd been working on getting easypopulate to handle product attribs, and managed to achieve something functional. I haven't tested the code extensively yet, but it should theoretically be capable of handling any number of product options, option values, and languages. This is still beta code, and I haven't put it up as a contribution yet. If anyone is interested in giving this a try (at their own risk!), you can download my easypopulate.php file, and a sample tab-limited file (from an 'out-of-the-box' osc product list), here. Please try this on a test osc setup, before you even think about using it in your "live" store. And in any case, BACKUP your database. This code was developed and tested with EP version '2.62-MS2' on oscommerce 2.2-MS2. Here's an overview of the system. Hope its not confusing as it looks, and makes some sense :). FIELD STRUCTURE ----------------------- 1. v_attribute_options_id_1 ? ? ? ?v_attribute_options_name_1_1 ? ? ? ?v_attribute_options_name_1_2 ? ? ? ?. ? ? ? ?. ? ? ? ?. ? ? ? ?v_attribute_values_id_1_1 ? ? ? ?v_attribute_values_price_1_1 ? ? ? ? ? ?v_attribute_values_name_1_1_1 ? ? ? ? ? ?v_attribute_values_name_1_1_2 ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ?v_attribute_values_id_1_2 ? ? ? ?v_attribute_values_price_1_2 ? ? ? ? ? ?v_attribute_values_name_1_2_1 ? ? ? ? ? ?v_attribute_values_name_1_2_2 ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ?. ? ? ? ?. ? ? ? ?. 2. v_attribute_options_id_2 ? ? ? ?v_attribute_options_name_2_1 ? ? ? ?v_attribute_options_name_2_2 ? ? ? ?. ? ? ? ?. ? ? ? ?. ? ? ? ?v_attribute_values_id_2_1 ? ? ? ?v_attribute_values_price_2_1 ? ? ? ? ? ?v_attribute_values_name_2_1_1 ? ? ? ? ? ?v_attribute_values_name_2_1_2 ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ?v_attribute_values_id_2_2 ? ? ? ?v_attribute_values_price_2_2 ? ? ? ? ? ?v_attribute_values_name_2_2_1 ? ? ? ? ? ?v_attribute_values_name_2_2_2 ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ? ? ?. ? ? ? ?. ? ? ? ?. ? ? ? ?. . . . ? ? where, 1. v_attribute_options_id_x ?x = a count, beginning from 1, and incrementing by 1 This column contains the options ID (each option ID must be unique). 2. v_attribute_options_name_x_y ?x = count (same as above) ?y = count and language id . This means, language id must correspond to the count, begin on 1, and increment by 1. For example, correct language id structures include, ?English (ID = 1), German (ID = 2) and Spanish (ID = 3) ?English (ID = 1) and French (ID = 2) and the system most likely won't work with the following language id structures, ?English (ID = 2) and German (ID = 3) ?French (ID = 2) So basically, if you're using 3 languages (say, English, German and French) make sure their language ids begin with 1, and increment by 1, without jumping values. This column contains the option name (in each language). 3. v_attribute_values_id_x_y ?x = corresponding option count ?y = option values count, beginning from 1, and incrementing by 1 This column contains the option value ID (each option value ID must be unique). 4. v_attribute_values_price_x_y ?x = corresponding option count ?y = option values count This column contains the "signed" price. If non-empty, attribute value is added to the product. 5. v_attribute_values_name_x_y_z ?x = corresponding option count ?y = corresponding option values count ?z = count and language id . This means, language id must correspond to the count, begin on 1, and increment by 1 (please see description for v_attribute_options_name_x_y). HOW IT WORKS -------------------- Basically, if the field "v_attribute_values_price_x_y" is not empty for a product row, the corresponding attribute is added to that product. Example non-empty values include, 0 (zero) = just the attribute is added (there's no special price) 11.50 = attribute is added, with price value 11.50, and price prefix '+' -9.30 = attribute is added, with price value 9.30, and price prefix '-' You'll also be able to add product options/option values, modify option/option value names. VJ
  2. Hello, The new version of Links Manager for osC (v1.00) is now available for download, here. This new version is almost entirely written from scratch, to include newer features. IMPORTANT: This contribution was developed for, and tested on OSC v2.2MS2. I haven't tested it on previous OSC releases, so please take care when you install it in pre-MS2 OSC versions. In any case, please BACKUP your programs!!! Features include, * multi-language support * spider friendly links click count * links/link category images support * split page views for links * link partners contact options * integrated links checker (thanks to Greame Conkie) * admin configuration options * "semi-automated" install ;-) * notification on link status change and more... You can see this program in action in my demo store, here. Thanks to the OSC team and all those wonderful helpful folks at the OSC forums!!! VJ
  3. Guestbook for OSC(MS2) v1.0 is now available at http://www.oscommerce.com/community/contributions,1349. This add-on was developed and tested on OSC 2.2MS2. You can find this add-on in action, at http://www.vjdom.com. VJ
  4. This program enables display and management of a categorized list of links to other websites. You can add/edit/delete/enable/disable links and categories from the admin interface. It also includes a link submit form, where users can submit links and request you to add them to your list. http://www.oscommerce.com/community/contributions,1256 Please give it a try and send in your comments and suggestions. This is my first ever contribution for OSC. Hope I've done a fair enough job. VJ -- http://www.salehut.com
  5. Hello, I have this code in place to better handle special characters, and it seems to work fine. In file admin/easypopulate.php replace, // make sure all non-set things are set to ''; // and strip the quotes from the start and end of the stings. // escape any special chars for the database. foreach( $filelayout as $key=> $value){ $i = $filelayout[$key]; if (isset($items[$i]) == false) { $items[$i]=''; } else { // Check to see if either of the magic_quotes are turned on or off; // And apply filtering accordingly. if (function_exists('ini_get')) { //echo "Getting ready to check magic quotes<br>"; if (ini_get('magic_quotes_runtime') == 1){ // The magic_quotes_runtime are on, so lets account for them // check if the last character is a quote; // if it is, chop off the quotes. if (substr($items[$i],-1) == '"'){ $items[$i] = substr($items[$i],2,strlen($items[$i])-4); } // now any remaining doubled double quotes should be converted to one doublequote $items[$i] = str_replace('\"\"',""",$items[$i]); if ($replace_quotes){ $items[$i] = str_replace('\"',""",$items[$i]); $items[$i] = str_replace("\'","'",$items[$i]); } } else { // no magic_quotes are on // check if the last character is a quote; // if it is, chop off the 1st and last character of the string. if (substr($items[$i],-1) == '"'){ $items[$i] = substr($items[$i],1,strlen($items[$i])-2); } // now any remaining doubled double quotes should be converted to one doublequote $items[$i] = str_replace('""',""",$items[$i]); if ($replace_quotes){ $items[$i] = str_replace('"',""",$items[$i]); $items[$i] = str_replace("'","'",$items[$i]); } } } } } with, foreach( $filelayout as $key=> $value){ $i = $filelayout[$key]; if (isset($items[$i]) == false) { $items[$i]=''; } else { // strip enclosing quotes added by Excel $items[$i] = preg_replace('/^"(.*)"$/', '$1', $items[$i]); // doubled double quotes should be converted to one doublequote (for some reason Excel adds them) $items[$i] = preg_replace('/"{2,}/', '"', $items[$i]); // standard functions to clean db input $items[$i] = tep_db_input(tep_db_prepare_input($items[$i])); } } HTH, VJ
  6. WebSearch for OSC(MS2) v1.0 is now available at http://www.oscommerce.com/community/contributions,1360. This add-on lets you search the Web from a search infobox. And, it runs on Google API, producing the same matches as when you search Google. This add-on was developed and tested on OSC 2.2MS2. You can find this add-on in action, at http://www.vjdom.com. VJ
  7. Hello, I use index.php as my home page, and had a little hiccup getting the Linda's Header Tag Controller to work as it should. Just thought this "tip" could help, if you use Linda's Header Tag Controller contrib... especially for users who use "index.php" instead of the default "default.php" as their home page. In file /catalog/includes/header_tags.php, replace (at around line 20) // DEFAULT.PHP case (strstr($_SERVER['PHP_SELF'],'default.php') or strstr($PHP_SELF,'default.php') ): with, // DEFAULT.PHP case (strstr($_SERVER['PHP_SELF'],FILENAME_DEFAULT) or strstr($PHP_SELF,FILENAME_DEFAULT) ): HTH, VJ
  8. VJ

    Master Products - MS2

    In /catalog/index.php, replace, // show the products of a specified manufacturer if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } else { // We show them all //Master Products $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_listing_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; //Master Products EOF } } with, // show the products of a specified manufacturer if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } else { // We show them all //Master Products $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_listing_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; //Master Products EOF } } Also, I've noticed the same problem in the search results. I've managed to fix by making the following change. In /catalog/advanced_search_result.php (around line 238), replace, $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price "; with, $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price "; What I've basically done is just add products_master and products_master_status to the sql queries. VJ
  9. VJ

    Easy Populate

    Strange! Did you open/modify this file in a WYSIWYG editor like Dreamweaver? If so, I suspect that might've messed up your paths. You can try replacing it with a fresh new easypopulate.php (don't forget to backup your existing file!). If you have your store at, say, http://shop.yourdomain.com or http://www.yourdomain.com/shop, you'll most likely have to change the temp directory paths to something like, -- $tempdir = "/shop/temp/"; /* This is what really matters */ $tempdir2 = "/catalog/temp/"; /* This is a redundant variable, as far as I can see. Maybe you can use it to backup the original path. */ --- HTH, VJ
  10. VJ

    Easy populate problem

    I'm very new to this and I just can't figure it out. You're probably trying to get a newer EP version to work on a MS1 setup. You might find this thread here, useful. VJ
  11. I'm not really sure what those js runtime errors are about. Here's a "solution", though: Add this code to your /admin/includes/general.js, function rowOverEffect(object) { if (object.className == 'dataTableRow') object.className = 'dataTableRowOver'; } function rowOutEffect(object) { if (object.className == 'dataTableRowOver') object.className = 'dataTableRow'; } ... and keep your fingers crossed! :P Next time you get a js runtime error, try to note them down or capture a screenshot. VJ
  12. Hello, I've posted a code patch here, that should enable EP handle quotes better. VJ
  13. Hello, Are you sure you're using consistent product model numbers? VJ
  14. VJ

    Error Message, help?

    You'll most likely need to change this (in easypopulate.php): // **** Temp directory **** // if you changed your directory structure from stock and do not have /catalog/temp/, then you'll need to change this accordingly. // $tempdir = "/catalog/temp/"; $tempdir2 = "/catalog/temp/"; to, // **** Temp directory **** // if you changed your directory structure from stock and do not have /catalog/temp/, then you'll need to change this accordingly. // $tempdir = "/temp/"; $tempdir2 = "/temp/"; HTH, VJ
  15. Well, the links script doesn't involve changes to your index.php file, so its likely that something else has messed it up. Have you checked line 13, by the way? VJ
  16. Huh, here comes the tricky bit... 1. Copy /catalog/includes/spider.txt (if you haven't done so, earlier), and /catalog/includes/classes/split_page_results.php (rename it to split_page_results_new.php, before copying) from MS2. 2. In split_page_results_new.php, rename all instances of "splitPageResults" to "splitPageResultsNew" (you should find 2). 3. In /includes/modules/link_listing.php: replace, $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'l.links_id'); with, // split-page-results require(DIR_WS_CLASSES . 'split_page_results_new.php'); $listing_split = new splitPageResultsNew($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'l.links_id'); That should do it. Happy New Year! :) I remember going through this routine a couple of times, before. I'd appreciate if you could compile all the changes you'd needed to make (to get this working in MS1), and post it. VJ
  17. Missing semi-colon in, define('TABLE_ZONES', 'zones') :) VJ
  18. Oops, my mistake. I'd copied the function immediately above, along with tep_output_string, in my code. Just remove this code from the one I'd posted, and you'll be fine (hopefully!). function tep_parse_input_field_data($data, $parse) { return strtr(trim($data), $parse); } VJ
  19. Appears like you have stray code in your database_tables.php. Double-check the changes you've made to that file. VJ
  20. You can try copying the following code from your MS2 /catalog/includes/functions/general.php: //// // Parse the data used in the html tags to ensure the tags will not break function tep_parse_input_field_data($data, $parse) { return strtr(trim($data), $parse); } function tep_output_string($string, $translate = false, $protected = false) { if ($protected == true) { return htmlspecialchars($string); } else { if ($translate == false) { return tep_parse_input_field_data($string, array('"' => '"')); } else { return tep_parse_input_field_data($string, $translate); } } } HTH, VJ
  21. Hmm... not sure what those errors exactly are. Maybe you could copy/paste the lines where they occur, here (if you have a Javascript debugger integrated with your browser). VJ P.S. - If you're keen on donating money, please PM/IM/email me. Thank you :).
  22. You have probably tried to create an instance of messageStack class, before including the /includes/classes/boxes.php file (where tableBox class is defined), in your application_top.php. Try moving the lines you'd added, AFTER the following line, in application_top.php: // infobox require(DIR_WS_CLASSES . 'boxes.php'); HTH, VJ
  23. Hello, An updated version of Easypopulate (v2.72) is now available for download, here. This includes an option to turn off product attribute data when downloading the tab-delimited file. Support for this new version will continue in this thread. VJ
  24. Good. This should do the trick, require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack(); where, "messageStack" is the name of the class (in message_stack.php) and we use "$messageStack" just to be consistent with the variable name in links_submit.php. VJ
  25. In my links_submit.php, line 227 reads, if ($messageStack->size('submit_link') > 0) { You most likely have to copy the messageStack class (/catalog/includes/classes/message_stack.php) from MS2, and create an instance in /catalog/includes/application_top.php. HTH, VJ
×