Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ryanf

Archived
  • Posts

    551
  • Joined

  • Last visited

Everything posted by ryanf

  1. Problem solved, I went to an old txt file and used that and it worked so I just copy pasted all my new items into the olf text file and they all update fine, very wierd but I don't really care for an explaination as long as it works :) Ryan
  2. Ok, after putting in a lot of echos the part above is not working for me. when I put echo $v_products_name . '<br />'; Before the first if statement it doesn't print anything so it will never enter the if statement which it needs to. So anyone know why it would lose that variable?
  3. This is the code that I dont think is running: // the following is common in both the updating an existing product and creating a new product if ( isset($v_products_name)){ foreach( $v_products_name as $key => $name){ if ($name!=''){ $sql = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE products_id = $v_products_id AND language_id = " . $key; $result = tep_db_query($sql); if (tep_db_num_rows($result) == 0) { // nope, this is a new product description $result = tep_db_query($sql); $sql = "INSERT INTO ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url) VALUES ( '" . $v_products_id . "', " . $key . ", '" . $name . "', '". $v_products_description[$key] . "', '". $v_products_url[$key] . "' )"; // support for Linda's Header Controller 2.0 if (isset($v_products_head_title_tag)){ // override the sql if we're using Linda's contrib $sql = "INSERT INTO ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag) VALUES ( '" . $v_products_id . "', " . $key . ", '" . $name . "', '". $v_products_description[$key] . "', '". $v_products_url[$key] . "', '". $v_products_head_title_tag[$key] . "', '". $v_products_head_desc_tag[$key] . "', '". $v_products_head_keywords_tag[$key] . "')"; } // end support for Linda's Header Controller 2.0 $result = tep_db_query($sql); } else { // already in the description, let's just update it $sql = "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET products_name='$name', products_description='".$v_products_description[$key] . "', products_url='" . $v_products_url[$key] . "' WHERE products_id = '$v_products_id' AND language_id = '$key'"; // support for Lindas Header Controller 2.0 if (isset($v_products_head_title_tag)){ // override the sql if we're using Linda's contrib $sql = "UPDATE ".TABLE_PRODUCTS_DESCRIPTION." SET products_name = '$name', products_description = '".$v_products_description[$key] . "', products_url = '" . $v_products_url[$key] ."', products_head_title_tag = '" . $v_products_head_title_tag[$key] ."', products_head_desc_tag = '" . $v_products_head_desc_tag[$key] ."', products_head_keywords_tag = '" . $v_products_head_keywords_tag[$key] ."' WHERE products_id = '$v_products_id' AND language_id = '$key'"; } // end support for Linda's Header Controller 2.0 $result = tep_db_query($sql); } } } } products_description is the only table not getting changed for me. I just downloaded a new copy of easypopulate so I know its nothing that I may have changed. How is this part different than the insert into table products? Ryan
  4. It gives me an internal 500 error when trying to download the complete file to edit. I can upload a txt file no problem, it says that the products are updated and finds new ones if they are there. But then it doens't insert them into the products_description table and I can't find them on the website. They are in other tables like the products table.
  5. Here is the stuff from the beginning of the EP file. <?php // Current EP Version $curver = '2.72-MS2'; /* $Id: easypopulate.php,v 2.72 2003/12/28 VJ Exp $ */ // //******************************* //******************************* // C O N F I G U R A T I O N // V A R I A B L E S //******************************* //******************************* // **** 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/"; //**** File Splitting Configuration **** // we attempt to set the timeout limit longer for this script to avoid having to split the files // NOTE: If your server is running in safe mode, this setting cannot override the timeout set in php.ini // uncomment this if you are not on a safe mode server and you are getting timeouts // set_time_limit(330); // if you are splitting files, this will set the maximum number of records to put in each file. // if you set your php.ini to a long time, you can make this number bigger global $maxrecs; $maxrecs = 300; // default, seems to work for most people. Reduce if you hit timeouts //$maxrecs = 4; // for testing //**** Image Defaulting **** global $default_images, $default_image_manufacturer, $default_image_product, $default_image_category; // set them to your own default "We don't have any picture" gif //$default_image_manufacturer = 'no_image_manufacturer.gif'; //$default_image_product = 'no_image_product.gif'; //$default_image_category = 'no_image_category.gif'; // or let them get set to nothing $default_image_manufacturer = ''; $default_image_product = ''; $default_image_category = ''; //**** Status Field Setting **** // Set the v_status field to "Inactive" if you want the status=0 in the system // Set the v_status field to "Delete" if you want to remove the item from the system <- THIS IS NOT WORKING YET! // If zero_qty_inactive is true, then items with zero qty will automatically be inactive in the store. global $active, $inactive, $zero_qty_inactive, $deleteit; $active = 'Active'; $inactive = 'Inactive'; //$deleteit = 'Delete'; // not functional yet $zero_qty_inactive = true; //**** Size of products_model in products table **** // set this to the size of your model number field in the db. We check to make sure all models are no longer than this value. // this prevents the database from getting fubared. Just making this number bigger won't help your database! They must match! global $modelsize; $modelsize = 25; //**** Price includes tax? **** // Set the v_price_with_tax to // 0 if you want the price without the tax included // 1 if you want the price to be defined for import & export including tax. global $price_with_tax; $price_with_tax =false; // **** Quote -> Escape character conversion **** // If you have extensive html in your descriptions and it's getting mangled on upload, turn this off // set to 1 = replace quotes with escape characters // set to 0 = no quote replacement global $replace_quotes; $replace_quotes = true; // **** 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 // **** Max Category Levels **** // change this if you need more or fewer categories global $max_categories; $max_categories = 3; // 7 is default // VJ product attributes begin // **** Product Attributes **** // change this to false, if do not want to download product attributes global $products_with_attributes; $products_with_attributes = true; // change this if you want to download selected product options // this might be handy, if you have a lot of product options, and your output file exceeds 256 columns (which is the max. limit MS Excel is able to handle) global $attribute_options_select; //$attribute_options_select = array('Size', 'Model'); // uncomment and fill with product options name you wish to download // comment this line, if you wish to download all product options // VJ product attributes end my store is www.abdulky.com Ryan
  6. anyone have any ideas on why this won't work with php 4.38? Go to this page to see all my php info. I need to know what to change so I can get this to work, I have a lot of products to add. Ryan
  7. just noticed that the changes to the database don't effect table products description the new products dont appear there or neither do any changes.
  8. no, when I try to create a text file it gives me an 500 internal server error. It uploads and splits the file ok, the dump even shows that it adds the new product and I can see it in phpmyadmin but it won't show up in the catalog which is very weird. Changes to old products dont show up either though.
  9. sergio have you run the sql file?
  10. Hey, I had easy populate working fine then today I tried to upload stuff and it says it works but when I try to find the product in the catalog, its not there. I can find it in the database using phpmyadmin and I cant figure out why it says product not found. I also just tested more and found that the old products wont update either. the only thing that has changed was that my host upgraded there php. Does anyone else know of easy populate not working with php5? I know that another script I was using that I made stopped working also and I had to rewrite it. Ryan
  11. so the different sizes are all different products? Whats to do? Put it in the product description/name/model number/whatever so you know which is which (and so do your customers) then just add the slaves and your all set. Ryan
  12. Whoops, sorry, got the names crossed up. Colin down where it calls master listing: <td> <?php ?include(DIR_WS_MODULES . FILENAME_MASTER_PRODUCTS); ?></td> Change it to: <td><?php ? ?if ($cPath == x) { ? ?include(DIR_WS_MODULES . FILENAME_MASTER_PRODUCTSX); ?} elseif ($cPath == y ) { ? ?include(DIR_WS_MODULES . FILENAME_MASTER_PRODUCTSY); ?} else { ? ?include(DIR_WS_MODULES . FILENAME_MASTER_PRODUCTS); ?} ?> </td> You'll have to remember to put FILENAME_MASTER_PRODUCTS1, 2, & 3 (or however many you have) in includes/filenames.php. application_top.php gathers the $cPath so you don't have to worry about getting that. Goodluck, Ryan
  13. colin - why do you have to have a 1 in the quantity box? If not, that would solve your problem easy. Otherwise, I don't really know how to fix application_top for yeah. Ryan
  14. it's adding them both since they both have a quantity as one as a default. If you *have* to have one instead of 0 for the default quantity to will have to change around application top so that it looks for the value of the submit button and not qty. Ryan
  15. to get the attribute sorted you should be able to do this: In master listing change the line: $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); to $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.products_options_name"); That will sort them alphabetically. If you want them sorted in another order, just add a new field "sortorder" to the products_options table and in phpmyadmin, assign a value for each one (lowest will go first) then use the code: $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.sortorder, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "' order by popt.sortorder"); And of course if you don't know this all goes under case 'MASTER_LIST_OPTIONS': in master_listing.php Backup first, since I havn't tested this at all. Ryan
  16. Brian and I just answered this 2 or 3 pages back. Ryan
  17. Adding a hidden field takes no effort. I have one in mine to add the description as an attribute so it shows up in the cart. I create a new case and add it in it's own column (you cant see it, but its there) but I think you could just add it to a column that you know will always be there. Use this code $lc_text .= tep_draw_hidden_field('Qty_ProdId_' . $listing['products_id'], "1"); It should go after the $lc_text for the original part since the .= adds the text to the string. That should work, you may need to change the 1 part, just view the source and see whats appearing in the value field. Ryan
  18. you have to add the attributes to the slaves NOT the master product to get it to work with product attributes. Ryan
  19. Richard, another way that you can still have the master products price listed and not have the quantity box appear is to use this code in product_info.php: <?php $master_query2 = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master = ?'" . (int)$HTTP_GET_VARS['products_id'] . " '"); $results2 = tep_db_fetch_array($master_query2); if ($results2['products_id'] == null) { ?> ? ? <tr> ? ? ? ?<td align="right" class="main"> <?php ? ? ? ? ?echo TEXT_QUANTITY . ' ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); ? ? ?} ?> ? ? ? ?</td> ? ? ?</tr> ? ?<tr> ? ? ? ? <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> ? ? ?</tr> <?php I use it on my site and it works fine. Put it in where the box gets drawn, right under the url part. It checks to see how many products are slaves to the master, if there are none, it creates the quatity menu, if there are some, then it doesn't. This will allow you to give the master products a price (I use the lowest slave price) and have the price show up in the catalog and also not have the product be buyable. Ryan
  20. master list options is only for inserting attributes into the slaves. I think your problem is with application_top, redo that part of the installation and if it still doesn't work, post just the add_slave part of application_top Ryan
  21. If you follow the posts between brian and myself starting about 7 pages back or so, you can figure out how to get attributes working on your site.
  22. In the readme there is a step that you must do to the database with phpmyadmin after you create a text attribute in the admin section, follow those directions.
  23. so there is no difference between the cost of a medium, small or adult tub? I don't think this contrib will count qty. You will have to code that one yourself if there is no contrib already for it.
  24. joe, I think why the regular products with attributes is not working is because they have a call something like id[ while the mods that brian and I have made have a call like id_ try changing the ones in product_info to the same as in master_listings with the id_ and that should work. I think I had to do that also. Radders: I think you would almost need another field in the database to keep track of that one. Ryan
  25. Joe I think that error is coming from the sql command order by limit. You have to have something there to order by such as: order by products_name limit 0, 12 Try that. Ryan
×
×
  • Create New...