Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

VJ

Pioneers
  • Posts

    170
  • Joined

  • Last visited

Everything posted by VJ

  1. Hello, Try copying the file /catalog/includes/functions/validations.php to /admin/includes/functions/ directory, and include the following line somewhere in your /admin/includes/application_top.php: // Include validation functions (right now only email address) require(DIR_WS_FUNCTIONS . 'validations.php'); HTH, VJ
  2. Hello, I'm afraid you have added the links code a couple of lines off-target. Here's the step where you've erred. ------------------------------------ /catalog/redirect.php ------------------------------------ after this, (around line 30) case 'manufacturer': if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $manufacturer_query = tep_db_query("select manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$languages_id . "'"); if (tep_db_num_rows($manufacturer_query)) { // url exists in selected language $manufacturer = tep_db_fetch_array($manufacturer_query); if (tep_not_null($manufacturer['manufacturers_url'])) { tep_db_query("update " . TABLE_MANUFACTURERS_INFO . " set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$languages_id . "'"); tep_redirect($manufacturer['manufacturers_url']); } } else { // no url exists for the selected language, lets use the default language then $manufacturer_query = tep_db_query("select mi.languages_id, mi.manufacturers_url from " . TABLE_MANUFACTURERS_INFO . " mi, " . TABLE_LANGUAGES . " l where mi.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and mi.languages_id = l.languages_id and l.code = '" . DEFAULT_LANGUAGE . "'"); if (tep_db_num_rows($manufacturer_query)) { $manufacturer = tep_db_fetch_array($manufacturer_query); if (tep_not_null($manufacturer['manufacturers_url'])) { tep_db_query("update " . TABLE_MANUFACTURERS_INFO . " set url_clicked = url_clicked+1, date_last_click = now() where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and languages_id = '" . (int)$manufacturer['languages_id'] . "'"); tep_redirect($manufacturer['manufacturers_url']); } } } } break; add, // VJ Links Manager v1.00 begin case 'links': require(DIR_WS_FUNCTIONS . 'links.php'); $links_query = tep_db_query("select links_url from " . TABLE_LINKS . " where links_id = '" . (int)$HTTP_GET_VARS['goto'] . "'"); if (tep_db_num_rows($links_query)) { $link = tep_db_fetch_array($links_query); tep_update_links_click_count($HTTP_GET_VARS['goto']); tep_redirect($link['links_url']); } break; // VJ Links Manager v1.00 end HTH, VJ
  3. Hello, You have probably failed to update your /catalog/admin/includes/database_tables.php file. Add this to the end, // VJ Links Manager v1.00 begin define('TABLE_LINK_CATEGORIES', 'link_categories'); define('TABLE_LINK_CATEGORIES_DESCRIPTION', 'link_categories_description'); define('TABLE_LINKS', 'links'); define('TABLE_LINKS_DESCRIPTION', 'links_description'); define('TABLE_LINKS_TO_LINK_CATEGORIES', 'links_to_link_categories'); define('TABLE_LINKS_STATUS', 'links_status'); // VJ Links Manager v1.00 end HTH, VJ
  4. Please refer to my posts (in this same thread) on Nov. 21, 23 for clues. HTH, VJ
  5. This is actually what makes the difference! The file /admin/includes/classes/upload.php (that contains the class - upload) exists in MS2, but not MS1. I think you can get around this error, by copying this file (upload.php) from an MS2 package, to your MS1 setup. You'll also have to "include" (or "require") this file. You can do this by adding the following line in admin/links_categories.php: require(DIR_WS_CLASSES . 'upload.php'); HTH, VJ
  6. I'm sure there's an option to export an Excel csv file as tab-delimited. Or, you could try to alter the following code in admin/easypopulate.php (to use a comma), and give it a shot. // **** Field Separator **** // change this if you can't use the default of tabs // Tab is the default, comma and semicolon are commonly supported by various progs // Remember, if your descriptions contain this character, you will confuse EP! global $separator; $separator = "\t"; // tab is default //$separator = ","; // comma //$separator = ";"; // semi-colon //$separator = "~"; // tilde //$separator = "-"; // dash //$separator = "*"; // splat HTH, VJ
  7. I've managed to get this mod to function, in my MS1 setup, by making a simple change. Just comment out this line in admin/easypopulate.php. require(includes/database_tables.php); I haven't tested this extensively, but it should be worth giving a try :). As for header tags, this new EP version retains the ability to handle data for Linda's Header Tag Controller, from previous versions. You just have to follow the manual and make some minor changes. HTH, VJ
  8. I just looked at the 1readmeFIRST.txt, and this is what I found: 3. For adding link to the Admin, edit file admin/includes/boxes/catalog.php by adding this line: '<a href="' . tep_href_link('easypopulate.php', '', 'NONSSL') . '" class="menuBoxContentLink">Easy Populate</a><br>'. After: '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' . By the way, which version of EP do you use? HTH, VJ
  9. This program is now available for download, as a contribution, here. Support for this program will continue in this thread. VJ
  10. Thank you. I'll give it a try again. VJ
  11. I'm afraid I get the exact same error too. I tried this on a MS2 setup. VJ
  12. I've been getting feedback from folks who have a lot of product attributes, that leads to the tab-delim file exceeding 256 columns (which is the max. column limit for most worksheet programs). I've now added an option to download only selected product attribute options. For example, if you have the options - Colour, Size, Model, you'll now be able to select any particular option(s) to download (say, Colour and Model). Look out for this configuration directive line, in easypopulate.php and make necessary changes: global $attribute_options_select; //$attribute_options_select = array('Size', 'Model'); You can download the latest easypopulate.php, here. Keep your feedback coming, and thanks to all folks who've offered ideas/feedback :-). VJ
  13. Well, it turned out to be quite easy, in the end. Just comment out this line in easypopulate.php, and it works just fine in MS1 :). require(includes/database_tables.php); // comment this line VJ
  14. Hello Don, 1. This is not really a limitation of this code, but you could try my latest code update, which has this option to handle just the product models and attributes. That would probably save a few columns. If you still have excess columns, you could try to hack the code to make it handle 1 language or 1 attrib set, at a time (just a thought!). 2. Well, attributes are not actually assigned to every single product. Attributes are assigned to a product, only if the corresponding value price cell contains a "non-empty" value. Otherwise, the attribute options/values are listed beside each product, but are not assigned to them. If you think your tab-delimited file is messed up in any way, you could email it to me (just make sure you zip or tgz it... I'm on a slow dial-up :(). HTH, VJ
  15. Yes, I'm working towards acheiving something similar... download products from MS1, and upload to MS2. I'll post my progress on this thread.... stay tuned! VJ
  16. I've now added an option to download and handle just the product model/attributes. You can download the updated easypopulate.php file, here. The code is almost out of beta stage now, and should be ready to be added in the contribs section, in a few days (just needs a bit more cleaning up and testing). Thanks for all your feedback and comments :). VJ
  17. Yes. Here's a simple example. These are the fields you would require, to add an option (Size), with 2 values (Small, Medium). 1. v_attribute_options_id_1 -> this field contains the attribute option id (make sure you don't use an id that already exists in the database) where, "1" is a count, which starts from 1 and increments by 1. 2. v_attribute_options_name_1_1 -> contains the option name (eg: Size) where, the first "1" is the corresponding options count (you would use v_attribute_options_name_2_1, for v_attribute_options_id_2) and, the second "1" is the language id 3. v_attribute_values_id_1_1 -> contains attribute option value id (again make sure you don't use an existing id) where, first "1" is the option id, this value is linked with and, second "1" is a count (starting from 1, and incrementing by 1) 4. v_attribute_values_price_1_1 -> contains price difference for option value with suffix 1_1 (this is a signed value, you may use '-' or '+' before the price value) 5. v_attribute_values_name_1_1_1 -> contains attrib option value name (eg: Small) where, first and second 1's are the corresponding option value suffixes and, third "1" is the language id So, basically this is how your table would look: v_attribute_options_id_1 => 1 v_attribute_options_name_1_1 => Size (assuming "1" is the language id for English, in your store) v_attribute_values_id_1_1 => 1 v_attribute_values_price_1_1 => -20.00 v_attribute_values_name_1_1_1 => Small v_attribute_values_id_1_2 => 2 v_attribute_values_price_1_2 => 0.00 v_attribute_values_name_1_2_1 => Medium (again, assuming "1" for English) HTH, VJ
  18. I haven't worked on a diff file for the changes, as of yet. You can try this, though.... 1. Download my easypopulate.php, here. 2. You can identify my code additions - they're all within these tags "// VJ product attribs begin" and "// VJ product attribs end" (there should be 3 sets of them). 3. Now, paste them exactly in their corresponding positions, in your already modified easypopulate.php file. Please make sure if I have replaced any existing code. And in any case, BACKUP your existing file. HTH, VJ
  19. Yes, this is something I would like to work on. I'm sure it'd make things easier to maintain, especially with these new attribute fields, getting added. Thanks so much for all your feedback and comments :). VJ
  20. Two more code fixes... 1. Now able to handle product attribute options/option values, that are not linked to any products. Earlier, only attrib options/option values that are linked to products were handled. 2. Redesigned the language specific sections of the code. Now able to handle language ids lot better. The language specific fields should now be, v_attribute_options_name_x_y, where x = options count, and y = language id (earlier, this was a count beginning from 1) v_attribute_values_name_x_y_z, where x = options count, y = option values count, and z = language_id (changes, same as above) You can download the updated code, here. If anyone has given this a try, I'd be happy to hear if this actually works! Today, I managed to test it with a set of 60 different attribute values, and it did handle it OK (the output file was huge, though) :). VJ
  21. Hello, I've added a code patch, that now enables removal of product attributes linked to a product. You can download the new code here. Currently working on testing and improving language support. I'd be glad if anyone could help me test this code. You can email me at - vj (at) vjdom (dot) com. Remember, this is experimental code, and you'd need a dev store setup give it a try. VJ
  22. 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
  23. I'm afraid I wasn't able to locate the code resembling your error snippet, in the original links.php file. Have you made any changes in the SQL queries? select count(l.links_id) as total select ld.links_title, ld.links_description, l.links_url, l.links_clicked, l.links_id from links_description ld, links l, links_to_link_categories l2lc where l.links_status = '2' and l.links_id = l2lc.links_id and ld.links_id = l2lc.links_id and ld.language_id = '1' and l2lc.link_categories_id = '4' Anyways, there's a mistake in the above query (obviously!). You might need to remove this section (right at the beginning), select count(l.links_id) as total HTH, VJ
  24. Oops, here you go... In your (original) links.php, replace the following (around line 90) - if ($number_of_categories > 0) { $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $lPath_new = 'lPath=' . $categories['link_categories_id']; $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">'; if (tep_not_null($categories['link_categories_image'])) { echo tep_links_image(DIR_WS_IMAGES . $categories['link_categories_image'], $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>'; } else { echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'style="border: 3px double black"') . '<br>'; } echo '<br><b><u>' . $categories['link_categories_name'] . '</b></u></a><br><br>' . $categories['link_categories_description'] . '</td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } } else { with, if ($number_of_categories > 0) { $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $lPath_new = 'lPath=' . $categories['link_categories_id']; $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $categories_count_query = tep_db_query("select links_id from " . TABLE_LINKS_TO_LINK_CATEGORIES . " where link_categories_id = '" . (int)$categories['link_categories_id'] . "'"); $number_of_links = tep_db_num_rows($categories_count_query); echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">'; if (tep_not_null($categories['link_categories_image'])) { echo tep_links_image(DIR_WS_IMAGES . $categories['link_categories_image'], $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>'; } else { echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'style="border: 3px double black"') . '<br>'; } echo '<br><b><u>' . $categories['link_categories_name'] . '</b></u></a> (' . $number_of_links . ')'; echo '<br><br>' . $categories['link_categories_description'] . '</td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } } else { Good luck! :) VJ
×
×
  • Create New...