Jump to content

Plascual

Members
  • Content count

    41
  • Joined

  • Last visited

Profile Information

  • Real Name
    Pascal
  • Location
    Canada
  • Interests
    Interactive medias
  • Website
  1. THANK YOU pixclinic!! :D You were right! Just to make sure again... v_categories_name_1_ <== I looked at the header of my file and finally see a trailing space!! I was sure it was ok... Next thing to make sure, if it is possible, is to lock the header fields in excel or filemaker... Probably someone changed it by mistake. Thanks again! I'm so happy! Plascual
  2. Thanks pixclinic! Okay, by using ECHO command, I just figured out that EP doesn't go through some part of the code: - if ( isset($v_categories_name_1)){ - if (isset($v_categories_id)){ There is a problem when it comes to use name of categories. Pascal
  3. If the problem would be the code... there would be an error, no? EP uses directly SQL commands to create products and categorie-links, not tep_functions, so there shouldn't be any problem. Anyways, when I create a product in admin, there is no problem (it creates a categorie-link). I just don't understand why EP half-executes... If it would use tep_functions, I would verify all of them... but it is not the case. If gives me no errors! Is there any technique to detect why it doesn't create categorie-links ? if (isset($v_categories_id)){ //find out if this product is listed in the category given $result_incategory = tep_db_query('SELECT '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id, '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id FROM '.TABLE_PRODUCTS_TO_CATEGORIES.' WHERE '.TABLE_PRODUCTS_TO_CATEGORIES.'.products_id='.$v_products_id.' AND '.TABLE_PRODUCTS_TO_CATEGORIES.'.categories_id='.$v_categories_id); if (tep_db_num_rows($result_incategory) == 0) { // delete link to a product from all subcategories and add to new subcategory if (EP_NO_DUPL == 'true') { $res0 = tep_db_query('DELETE FROM '.TABLE_PRODUCTS_TO_CATEGORIES.' WHERE products_id = ' . $v_products_id); $res1 = tep_db_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id) VALUES ("' . $v_products_id . '", "' . $v_categories_id . '")'); } else { // nope, this is a new category for this product $res1 = tep_db_query('INSERT INTO '.TABLE_PRODUCTS_TO_CATEGORIES.' (products_id, categories_id) VALUES ("' . $v_products_id . '", "' . $v_categories_id . '")'); } } else { // already in this category, nothing to do! } } Please any help is appreciated! Thanks, Plascual
  4. No... this way, without quotes : define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where the pages are located on the server If it doesn't work, you may use (example) : define('DIR_FS_DOCUMENT_ROOT', '/home/noname/web/'); // where the pages are located on the server Voil?! Plascual
  5. Okay, First - there is no conflict between my installed contribs for sure. Second - I have reloaded a database backup that I made couple months ago, and it still doesn't create links in products_to_categories table... Then I decided to installed EP 2.79b to see if maybe the code was the problem... but same thing: EP creates the products, with description etc..., but still doesn't create links in products_to_categories table. I'm pretty sure it is not the code - may this be a corrupted database problem? Would it be possible for me to empty database from all products and restart from scratch the import? Any ideas? Thanks Plascual
  6. I remembered I've just installed Enable/Disable Categories before EP2.76 stops working... I verified this installation, but seems okay. I searched a lot, but didn't find anything on this... Are there any conflicts between these two contributions?
  7. Yes, when I download Complete tab-delimited .txt file, I can see all the fields used in EP... and it is the same ones (minus the ones I do not use), in the same order that I use in my tabbed-file. To make sure, I uploaded this file in EP (I kept only one product), but it still doesn't show me the file size. It was working the day before... I just uploaded a file, and I wasn't able to find the products anymore. That how I realised that the products were added to the database in products, products_description but not products_to_categories. Weird! :( Plascual
  8. Yes, when I download Complete tab-delimited .txt file, I can see all the fields used in EP... and it is the same ones (minus the ones I do not use), in the same order that I use in my tabbed-file. To make sure, I uploaded this file in EP (I kept only one product), but it still doesn't show me the file size. I was working the day before... I just uploaded a file, and I wasn't able to find the products anymore. That how I realised that the products were added to the database in products, products_description but not products_to_categories. Weird! :( Plascual
  9. Thanks to reply si vite! ;) I'll continue in english... I only imported one product here... It works even if I import more products... but EP doesn't update the products_to_categories table... so my products do not show-up in the site and admin. This is wierd because it works... the file is uploaded and processed, but products aren't linked to the categories. I'm pretty sure there is no error in my tabbed-file... Any ideas? Thanks again! Plascual
  10. I noted that EP doesn't show me the file size... how can it be possible if it reads the file and create products in products table? ======================================= File uploaded. Temporary filename: /****/****/upload/phpZoUanu User filename: test2.txt Size: <=== THERE IS NO FILE SIZE! | 435832 | manufactur | Tableau gr | Permet de | | Graphing P | Present in | | 20.95 | 0.00 | | 2006-05-03 | 10000 | 0 | 0 | 1 | Spectrum | Petite enf | Math?matiq | | Bien taxab | Active Updated | | | | | | | | | | | | | | | | | | | | | | No products_model field in record. This line was not imported ======================================= Maybe it is the key why it doesn't create links in products_to_categories? Anybody to help me debug this? Thanks in advance!
  11. Hi! I installed Easy Populate v2.76c with Master products (a long time ago). There is a wierd problem that never happened before I updated my version of Register_Globals contribution (to Register Globals V 1.5 - Bug Fixes v2) with fix to get uploads working Easy Populate. Now everything works right, upload is okay, processing is ok, then products are added to products table , but not in the products_to_categories table, so I can't see my products on the website or the admin side. I verified my tabbed-file for fields order, categories names are okay... I just do as I always did. So I have to go in phpMyAdmin and make the link manually, this is very annoying. Here is the code for /admin/easypopulate.php, hoping somebody can help me : <?php // Current EP Version $curver = '2.76c-MS2'; /* $Id: easypopulate.php,v 2.75 2005/04/05 AL 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/"; /*fix by jb 20040815 set the strings to http post/request, since they don't seem to work on the new server, with register globals=off... $dltype=$_REQUEST['dltype']; $download=$_REQUEST['download']; global $HTTP_POST_FILES; foreach( $HTTP_POST_FILES as $varname => $fileinfo ){ $GLOBALS[$varname] = $fileinfo["tmp_name"]; $GLOBALS[$varname.'_name'] = $fileinfo["name"]; } // end fix jb */ //**** 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 = 12; //**** 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 =true; // **** 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 = false; // 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 // **************************************** // Froogle configuration variables // -- YOU MUST CONFIGURE THIS! IT WON'T WORK OUT OF THE BOX! // **************************************** // **** Froogle product info page path **** // We can't use the tep functions to create the link, because the links will point to the admin, since that's where we're at. // So put the entire path to your product_info.php page here global $froogle_product_info_path; $froogle_product_info_path = "http://www.stylishbydesign.com/catalog/product_info.php"; // **** Froogle product image path **** // Set this to the path to your images directory global $froogle_image_path; $froogle_image_path = "http://www.stylishbydesign.com/catalog/images/"; // **** Froogle - search engine friendly setting // if your store has SEARCH ENGINE FRIENDLY URLS set, then turn this to true // I did it this way because I'm having trouble with the code seeing the constants // that are defined in other places. global $froogle_SEF_urls; $froogle_SEF_urls = false; // **************************************** // End Froogle configuration variables // **************************************** //******************************* //******************************* // E N D // C O N F I G U R A T I O N // V A R I A B L E S //******************************* //******************************* //******************************* //******************************* // S T A R T // INITIALIZATION //******************************* //******************************* require('includes/application_top.php'); require('includes/database_tables.php'); // >>> BEGIN REGISTER_GLOBALS link_get_variable('download'); link_get_variable('dltype'); link_get_variable('split'); link_post_variable('MAX_FILE_SIZE'); link_post_variable('buttoninsert'); link_post_variable('buttonsplit'); link_post_variable('localfile'); link_files_variable('usrfl'); // <<< END REGISTER_GLOABLS //******************************* // If you are running a pre-Nov1-2002 snapshot of OSC, then we need this include line to avoid // errors like: // undefined function tep_get_uploaded_file if (!function_exists(tep_get_uploaded_file)){ include ('easypopulate_functions.php'); } //******************************* // VJ product attributes begin global $attribute_options_array; $attribute_options_array = array(); if ($products_with_attributes == true) { if (is_array($attribute_options_select) && (count($attribute_options_select) > 0)) { foreach ($attribute_options_select as $value) { $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " where products_options_name = '" . $value . "'"; $attribute_options_values = tep_db_query($attribute_options_query); if ($attribute_options = tep_db_fetch_array($attribute_options_values)){ $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']); } } } else { $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id"; $attribute_options_values = tep_db_query($attribute_options_query); while ($attribute_options = tep_db_fetch_array($attribute_options_values)){ $attribute_options_array[] = array('products_options_id' => $attribute_options['products_options_id']); } } } // VJ product attributes end global $filelayout, $filelayout_count, $filelayout_sql, $langcode, $fileheaders; // these are the fields that will be defaulted to the current values in the database if they are not found in the incoming file global $default_these; $default_these = array( 'v_products_image', #'v_products_mimage', #'v_products_bimage', #'v_products_subimage1', #'v_products_bsubimage1', #'v_products_subimage2', #'v_products_bsubimage2', #'v_products_subimage3', #'v_products_bsubimage3', 'v_categories_id', 'v_products_price', 'v_products_quantity', 'v_products_weight', 'v_products_master', 'v_products_master_status', 'v_products_listing_status', 'v_date_avail', 'v_instock', 'v_tax_class_title', 'v_manufacturers_name', 'v_manufacturers_id', 'v_products_dim_type', 'v_products_length', 'v_products_width', 'v_products_height' ); //elari check default language_id from configuration table DEFAULT_LANGUAGE $epdlanguage_query = tep_db_query("select languages_id, name from " . TABLE_LANGUAGES . " where code = '" . DEFAULT_LANGUAGE . "'"); if (tep_db_num_rows($epdlanguage_query)) { $epdlanguage = tep_db_fetch_array($epdlanguage_query); $epdlanguage_id = $epdlanguage['languages_id']; $epdlanguage_name = $epdlanguage['name']; } else { Echo 'Strange but there is no default language to work... That may not happen, just in case... '; } $langcode = ep_get_languages(); if ( $dltype != '' ){ // if dltype is set, then create the filelayout. Otherwise it gets read from the uploaded file ep_create_filelayout($dltype); // get the right filelayout for this download } //******************************* //******************************* // E N D // INITIALIZATION //******************************* //******************************* if ( $download == 'stream' or $download == 'tempfile' ){ //******************************* //******************************* // DOWNLOAD FILE //******************************* //******************************* $filestring = ""; // this holds the csv file we want to download $result = tep_db_query($filelayout_sql); $row = tep_db_fetch_array($result); // Here we need to allow for the mapping of internal field names to external field names // default to all headers named like the internal ones // the field mapping array only needs to cover those fields that need to have their name changed if ( count($fileheaders) != 0 ){ $filelayout_header = $fileheaders; // if they gave us fileheaders for the dl, then use them } else { $filelayout_header = $filelayout; // if no mapping was spec'd use the internal field names for header names } //We prepare the table heading with layout values foreach( $filelayout_header as $key => $value ){ $filestring .= $key . $separator; } // now lop off the trailing tab $filestring = substr($filestring, 0, strlen($filestring)-1); // set the type if ( $dltype == 'froogle' ){ $endofrow = "\n"; } else { // default to normal end of row $endofrow = $separator . 'EOREOR' . "\n"; } $filestring .= $endofrow; $num_of_langs = count($langcode); while ($row){ // if the filelayout says we need a products_name, get it // build the long full froogle image path $row['v_products_fullpath_image'] = $froogle_image_path . $row['v_products_image']; // Other froogle defaults go here for now $row['v_froogle_instock'] = 'Y'; $row['v_froogle_shipping'] = ''; $row['v_froogle_upc'] = ''; $row['v_froogle_color'] = ''; $row['v_froogle_size'] = ''; $row['v_froogle_quantitylevel'] = ''; $row['v_froogle_manufacturer_id'] = ''; $row['v_froogle_exp_date'] = ''; $row['v_froogle_product_type'] = 'OTHER'; $row['v_froogle_delete'] = ''; $row['v_froogle_currency'] = 'USD'; $row['v_froogle_offer_id'] = $row['v_products_model']; $row['v_froogle_product_id'] = $row['v_products_model']; // names and descriptions require that we loop thru all languages that are turned on in the store foreach ($langcode as $key => $lang){ $lid = $lang['id']; // for each language, get the description and set the vals $sql2 = "SELECT * FROM ".TABLE_PRODUCTS_DESCRIPTION." WHERE products_id = " . $row['v_products_id'] . " AND language_id = '" . $lid . "' "; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // I'm only doing this for the first language, since right now froogle is US only.. Fix later! // adding url for froogle, but it should be available no matter what if ($froogle_SEF_urls){ // if only one language if ($num_of_langs == 1){ $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '/products_id/' . $row['v_products_id']; } else { $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '/products_id/' . $row['v_products_id'] . '/language/' . $lid; } } else { if ($num_of_langs == 1){ $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '?products_id=' . $row['v_products_id']; } else { $row['v_froogle_products_url_' . $lid] = $froogle_product_info_path . '?products_id=' . $row['v_products_id'] . '&language=' . $lid; } } $row['v_products_name_' . $lid] = $row2['products_name']; $row['v_products_description_' . $lid] = $row2['products_description']; $row['v_products_url_' . $lid] = $row2['products_url']; // froogle advanced format needs the quotes around the name and desc $row['v_froogle_products_name_' . $lid] = '"' . strip_tags(str_replace('"','""',$row2['products_name'])) . '"'; $row['v_froogle_products_description_' . $lid] = '"' . strip_tags(str_replace('"','""',$row2['products_description'])) . '"'; // support for Linda's Header Controller 2.0 here if(isset($filelayout['v_products_head_title_tag_' . $lid])){ $row['v_products_head_title_tag_' . $lid] = $row2['products_head_title_tag']; $row['v_products_head_desc_tag_' . $lid] = $row2['products_head_desc_tag']; $row['v_products_head_keywords_tag_' . $lid] = $row2['products_head_keywords_tag']; } // end support for Header Controller 2.0 } // for the categories, we need to keep looping until we find the root category // start with v_categories_id // Get the category description // set the appropriate variable name // if parent_id is not null, then follow it up. // we'll populate an aray first, then decide where it goes in the $thecategory_id = $row['v_categories_id']; $fullcategory = ''; // this will have the entire category stack for froogle for( $categorylevel=1; $categorylevel<$max_categories+1; $categorylevel++){ if ($thecategory_id){ $sql2 = "SELECT categories_name FROM ".TABLE_CATEGORIES_DESCRIPTION." WHERE categories_id = " . $thecategory_id . " AND language_id = " . $epdlanguage_id; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); // only set it if we found something $temprow['v_categories_name_' . $categorylevel] = $row2['categories_name']; // now get the parent ID if there was one $sql3 = "SELECT parent_id FROM ".TABLE_CATEGORIES." WHERE categories_id = " . $thecategory_id; $result3 = tep_db_query($sql3); $row3 = tep_db_fetch_array($result3); $theparent_id = $row3['parent_id']; if ($theparent_id != ''){ // there was a parent ID, lets set thecategoryid to get the next level $thecategory_id = $theparent_id; } else { // we have found the top level category for this item, $thecategory_id = false; } //$fullcategory .= " > " . $row2['categories_name']; $fullcategory = $row2['categories_name'] . " > " . $fullcategory; } else { $temprow['v_categories_name_' . $categorylevel] = ''; } } // now trim off the last ">" from the category stack $row['v_category_fullpath'] = substr($fullcategory,0,strlen($fullcategory)-3); // temprow has the old style low to high level categories. $newlevel = 1; // let's turn them into high to low level categories for( $categorylevel=6; $categorylevel>0; $categorylevel--){ if ($temprow['v_categories_name_' . $categorylevel] != ''){ $row['v_categories_name_' . $newlevel++] = $temprow['v_categories_name_' . $categorylevel]; } } // if the filelayout says we need a manufacturers name, get it if (isset($filelayout['v_manufacturers_name'])){ if ($row['v_manufacturers_id'] != ''){ $sql2 = "SELECT manufacturers_name FROM ".TABLE_MANUFACTURERS." WHERE manufacturers_id = " . $row['v_manufacturers_id'] ; $result2 = tep_db_query($sql2); $row2 = tep_db_fetch_array($result2); $row['v_manufacturers_name'] = $row2['manufacturers_name']; } } // If you have other modules that need to be available, put them here // VJ product attribs begin if (isset($filelayout['v_attribute_options_id_1'])){ $languages = tep_get_languages(); $attribute_options_count = 1; foreach ($attribute_options_array as $attribute_options) { $row['v_attribute_options_id_' . $attribute_options_count] = $attribute_options['products_options_id']; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $lid = $languages[$i]['id']; $attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'"; $attribute_options_languages_values = tep_db_query($attribute_options_languages_query); $attribute_options_languages = tep_db_fetch_array($attribute_options_languages_values); $row['v_attribute_options_name_' . $attribute_options_count . '_' . $lid] = $attribute_options_languages['products_options_name']; } $attribute_values_query = "select products_options_values_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' order by products_options_values_id"; $attribute_values_values = tep_db_query($attribute_values_query); $attribute_values_count = 1; while ($attribute_values = tep_db_fetch_array($attribute_values_values)) { $row['v_attribute_values_id_' . $attribute_options_count . '_' . $attribute_values_count] = $attribute_values['products_options_values_id']; $attribute_values_price_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$row['v_products_id'] . "' and options_id = '" . (int)$attribute_options['products_options_id'] . "' and options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "'"; $attribute_values_price_values = tep_db_query($attribute_values_price_query); $attribute_values_price = tep_db_fetch_array($attribute_values_price_values); $row['v_attribute_values_price_' . $attribute_options_count . '_' . $attribute_values_count] = $attribute_values_price['price_prefix'] . $attribute_values_price['options_values_price']; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $lid = $languages[$i]['id']; $attribute_values_languages_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "' and language_id = '" . (int)$lid . "'"; $attribute_values_languages_values = tep_db_query($attribute_values_languages_query); $attribute_values_languages = tep_db_fetch_array($attribute_values_languages_values); $row['v_attribute_values_name_' . $attribute_options_count . '_' . $attribute_values_count . '_' . $lid] = $attribute_values_languages['products_options_values_name']; } $attribute_values_count++; } $attribute_options_count++; } } // VJ product attribs end // this is for the separate price per customer module if (isset($filelayout['v_customer_price_1'])){ $sql2 = "SELECT customers_group_price, customers_group_id FROM ".TABLE_PRODUCTS_GROUPS." WHERE products_id = " . $row['v_products_id'] . " ORDER BY customers_group_id" ; $result2 = tep_db_query($sql2); $ll = 1; $row2 = tep_db_fetch_array($result2); while( $row2 ){ $row['v_customer_group_id_' . $ll] = $row2['customers_group_id']; $row['v_customer_price_' . $ll] = $row2['customers_group_price']; $row2 = tep_db_fetch_array($result2); $ll++; } } if ($dltype == 'froogle'){ // For froogle, we check the specials prices for any applicable specials, and use that price // by grabbing the specials id descending, we always get the most recently added special price // I'm checking status because I think you can turn off specials $sql2 = "SELECT specials_new_products_price FROM ".TABLE_SPECIALS." WHERE products_id = " . $row['v_products_id'] . " and status = 1 and expires_date < CURRENT_TIMESTAMP ORDER BY specials_id DESC" ; $result2 = tep_db_query($sql2); $ll = 1; $row2 = tep_db_fetch_array($result2); if( $row2 ){ // reset the products price to our special price if there is one for this product $row['v_products_price'] = $row2['specials_new_products_price']; } } //elari - //We check the value of tax class and title instead of the id //Then we add the tax to price if $price_with_tax is set to 1 $row_tax_multiplier = tep_get_tax_class_rate($row['v_tax_class_id']); $row['v_tax_class_title'] = tep_get_tax_class_title($row['v_tax_class_id']); $row['v_products_price'] = round($row['v_products_price'] + ($price_with_tax * $row['v_products_price'] * $row_tax_multiplier / 100),2); // Now set the status to a word the user specd in the config vars if ( $row['v_status'] == '1' ){ $row['v_status'] = $active; } else { $row['v_status'] = $inactive; } // remove any bad things in the texts that could confuse EasyPopulate $therow = ''; foreach( $filelayout as $key => $value ){ //echo "The field was $key<br>"; $thetext = $row[$key]; // kill the carriage returns and tabs in the descriptions, they're killing me! $thetext = str_replace("\r",' ',$thetext); $thetext = str_replace("\n",' ',$thetext); $thetext = str_replace("\t",' ',$thetext); // and put the text into the output separated by tabs $therow .= $thetext . $separator; } // lop off the trailing tab, then append the end of row indicator $therow = substr($therow,0,strlen($therow)-1) . $endofrow; $filestring .= $therow; // grab the next row from the db $row = tep_db_fetch_array($result); } #$EXPORT_TIME=time(); $EXPORT_TIME = strftime('%Y%b%d-%H%I'); if ($dltype=="froogle"){ $EXPORT_TIME = "FroogleEP" . $EXPORT_TIME; } else { $EXPORT_TIME = "EP" . $EXPORT_TIME; } // now either stream it to them or put it in the temp directory if ($download == 'stream'){ //******************************* // STREAM FILE //******************************* header("Content-type: application/vnd.ms-excel"); header("Content-disposition: attachment; filename=$EXPORT_TIME.txt"); // Changed if using SSL, helps prevent program delay/timeout (add to backup.php also) // header("Pragma: no-cache"); if ($request_type== 'NONSSL'){ header("Pragma: no-cache"); } else { header("Pragma: "); } header("Expires: 0"); echo $filestring; die(); } else { //******************************* // PUT FILE IN TEMP DIR //******************************* $tmpfname = DIR_FS_DOCUMENT_ROOT . $tempdir . "$EXPORT_TIME.txt"; //unlink($tmpfname); $fp = fopen( $tmpfname, "w+"); fwrite($fp, $filestring); fclose($fp); echo "You can get your file in the Tools/Files under " . $tempdir . "EP" . $EXPORT_TIME . ".txt"; die(); } } // *** END *** download section ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top" height="27"> <table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <?php require(DIR_WS_INCLUDES . 'column_left.php');?> </table></td> <td class="pageHeading" valign="top"><?php echo "Easy Populate $curver - Default Language : " . $epdlanguage_name . '(' . $epdlanguage_id .')'; ?> <p class="smallText"> <?php if ($localfile or (is_uploaded_file($usrfl) && $split==0)) { //******************************* //******************************* // UPLOAD AND INSERT FILE //******************************* //******************************* if ($usrfl){ // move the file to where we can work with it $file = tep_get_uploaded_file('usrfl'); if (is_uploaded_file($file['tmp_name'])) { tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir); } echo "<p class=smallText>"; echo "File uploaded. <br>"; echo "Temporary filename: " . $usrfl . "<br>"; echo "User filename: " . $usrfl_name . "<br>"; echo "Size: " . $usrfl_size . "<br>"; // get the entire file into an array $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $usrfl_name); } if ($localfile){ // move the file to where we can work with it $file = tep_get_uploaded_file('usrfl'); $attribute_options_query = "select distinct products_options_id from " . TABLE_PRODUCTS_OPTIONS . " order by products_options_id"; $attribute_options_values = tep_db_query($attribute_options_query); $attribute_options_count = 1; //while ($attribute_options = tep_db_fetch_array($attribute_options_values)){ if (is_uploaded_file($file['tmp_name'])) { tep_copy_uploaded_file($file, DIR_FS_DOCUMENT_ROOT . $tempdir); } echo "<p class=smallText>"; echo "Filename: " . $localfile . "<br>"; // get the entire file into an array $readed = file(DIR_FS_DOCUMENT_ROOT . $tempdir . $localfile); } // now we string the entire thing together in case there were carriage returns in the data $newreaded = ""; foreach ($readed as $read){ $newreaded .= $read; } // now newreaded has the entire file together without the carriage returns. // if for some reason excel put qoutes around our EOREOR, remove them then split into rows $newreaded = str_replace('"EOREOR"', 'EOREOR', $newreaded); $readed = explode( $separator . 'EOREOR',$newreaded); // Now we'll populate the filelayout based on the header row. $theheaders_array = explode( $separator, $readed[0] ); // explode the first row, it will be our filelayout $lll = 0; $filelayout = array(); foreach( $theheaders_array as $header ){ $cleanheader = str_replace( '"', '', $header); // echo "Fileheader was $header<br><br><br>"; $filelayout[ $cleanheader ] = $lll++; // } unset($readed[0]); // we don't want to process the headers with the data // now we've got the array broken into parts by the expicit end-of-row marker. array_walk($readed, 'walk'); } if (is_uploaded_file($usrfl) && $split==1) { //******************************* &n
  12. Plascual

    How Did You Hear About Us - Support

    Hi all! I've installed V 1.4 and works great... but something's missing: multi-language support. I would be useful for each "sources_id" to have as many "sources_name" as languages... just as "categories_description" or "order_status" in database. Then, in admin section, we would enter the name, in each language available, for each Referral. The file /admin/order_status.php and /admin/referrals.php are quite similar... so maybe it would be possible to use this as reference for multi-language part. It shouldn't be too complicated to modify, but I need advices! Thanks in advance, Plascual
  13. Plascual

    Master Products - MS2

    I searched all over the net, I found many question (from 2005 and before) that are still unanswered. I finally found out by myself... and I would like to share it. I decided not to package it, because it is too much related to what each one wants to display. I think it is not complete, but it works... I hope I will help someone! First, it is to create a key in Admin Panel>Configuration>Slave Products that you can call "Display Custom Layout Column". Then you will be able to position it as you want. Here is an SQL example (be careful to change the configuration group, here 17, to suit your Slave Product configuration group) : INSERT INTO configuration VALUES ('', 'Display Custom Layout Column', 'MASTER_LIST_CUSTOM', '0', 'Do you wish to display your custom layout column (master_listing.php) ?', 17, 13, '2006-08-23 11:19:53', '2006-08-23 11:19:53', NULL, 'NULL'); In catalog/includes/modules/master_product.php look for: $slave_list = array('MASTER_LIST_MODEL' => MASTER_LIST_MODEL, Then add below: 'MASTER_LIST_CUSTOM' => MASTER_LIST_CUSTOM, In catalog/includes/modules/master_product.php look for: for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { Then add below (this is an example, you can add all search query that follow in the switch case... for my purpose I only added p.products_model, pd.products_name and pd.products_description): case 'MASTER_LIST_CUSTOM': $select_column_list .= 'p.products_model, pd.products_name, pd.products_description,'; break; In catalog/includes/modules/master_listing.php look for: switch ($column_list[$col]) { Then add below (this is an example too, modify to suit your needs): case 'MASTER_LIST_CUSTOM': $lc_align = 'left'; $lc_text = '<b>' . $listing['products_name'] . '</b> (' . $listing['products_model'] . ')<br>' . osc_trunc_string(strip_tags($listing['products_description'], '<a><b><em><font><i><s><span><strong><sub><sup><u>'), MASTER_LIST_DESCRIPTION_LENGTH); break; Then, go in your Admin Panel>Configuration>Slave Products and choose order to display the columns along with your new "custom column"... Voil?!
  14. Plascual

    Master Products - MS2

    Hi! I would like to do that too... I tried to modify master_listing.php without success. Anybody got a solution?
  15. Plascual

    Master Products - MS2

    Hello jaba321! I will try to answer your questions :) 1. I do not know Basic-design pack 1.7, but this error should be in product_listing.php ... Look at the code I pasted in question 2 and compare it to yours. Is there missing $listing['products_id'] in the link? 2. In fact, you would like to redirect the search results to product_info.php when the master's price is 0 ? So if you installed Master Products you should have this piece of code in /web/includes/modules/product_listing.php ... case 'PRODUCT_LIST_BUY_NOW': $lc_align = 'center'; /* MASTER PRODUCT REPLACE $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>?'; */ //Master Products if ($listing['products_master_status'] != '1' && $listing['products_master'] == '0') { $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>?'; } elseif ($listing['products_master'] != '0') { $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; } else { $lc_text = '?<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>?'; } //Master Products EOF break; Then you have to change the red portion of this code to suit your needs: } elseif ($listing['products_master'] != '0') { $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; You could create another button "button_show_all.gif" and place it in /catalog/includes/languages/**your_languages**/images/buttons/ Finally go in /catalog/includes/languages/**your_languages**/product_info.php and define a label for it, like IMAGE_BUTTON_SHOW_ALL... 3. Don't worry, the idea is to communicate concepts. I'm french myself. :lol: Greetings from Qu?bec/Canada! :thumbsup:
×