Jump to content

youngs_gifts

Members
  • Content count

    18
  • Joined

  • Last visited

1 Follower

About youngs_gifts

  • Birthday 07/12/1974

Profile Information

  • Real Name
    Adam Young
  • Gender
    Male
  • Location
    Madison, Maine USA
  • Website
  1. youngs_gifts

    [Contribution] Extra Fields

    Hi All I just installed this on top of a very moded shop and was getting the error : Warning: Invalid argument supplied for foreach().... in template_top.php at line 34 after about 2 hours i found this error is caused by this code: foreach ($epf as $e) { $mt = ($e['uses_list'] && !$e['multi_select'] ? ($pname[$e['field']] == 0) : !tep_not_null($pname[$e['field']])); if ($e['keyword'] && !$mt) { if ($e['uses_list']) { if ($e['multi_select']) { $values = explode('|', trim($pname[$e['field']], '|')); foreach ($values as $val) { $keywords[] = tep_output_string(tep_get_extra_field_list_value($val)); } } else { $keywords[] = tep_output_string(str_replace(' | ', ', ', tep_get_extra_field_list_value($pname[$e['field']], $e['show_chain']))); } } else { $keywords[] = tep_output_string($pname[$e['field']]); } } } This is most likely because the foreach hates it when the returned data is not an data array. so the fix to get rid of that pesky warning while page loads is to replace said code with this... if(is_array($epf)) { foreach ($epf as $e) { $mt = ($e['uses_list'] && !$e['multi_select'] ? ($pname[$e['field']] == 0) : !tep_not_null($pname[$e['field']])); if ($e['keyword'] && !$mt) { if ($e['uses_list']) { if ($e['multi_select']) { $values = explode('|', trim($pname[$e['field']], '|')); foreach ($values as $val) { $keywords[] = tep_output_string(tep_get_extra_field_list_value($val)); } } else { $keywords[] = tep_output_string(str_replace(' | ', ', ', tep_get_extra_field_list_value($pname[$e['field']], $e['show_chain']))); } } else { $keywords[] = tep_output_string($pname[$e['field']]); } } } } Now the page loads with no errors, all this did was look to see if the data is an array before it loads the loop, if not than nothing so no error... I am in hopes this post saves some one some time... Thanks Adam
  2. youngs_gifts

    Combining Admin Sort, and Search by Product Model

    Are you still looking for the answer to this question? I wanted to do the same thing and found the answer by trail and error! LOL orginal Code // -----BOF - Added code for Admin Sort by products model----- /* if (isset($HTTP_GET_VARS['search'])) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' order by pd.products_name "); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name "); } */ if (isset($HTTP_GET_VARS['search'])) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' order by p.products_model"); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by p.Products_model"); } MY CODE: //acy edit to search model also if (isset($HTTP_GET_VARS['search'])) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and (pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' or p.products_model like '%" . $HTTP_GET_VARS['search'] . "%') order by p.products_model"); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by p.Products_model"); } // end acy edits If you replace the orginal code with my code you can search by model number just fine! Adam
  3. youngs_gifts

    Easy Populate & Products Attributes

    I was having the same problem and found it was because I was running PHP version 5.. I found this FIX in this topic but not really talked about a lot it worked for me! First check to see what version of PHP 5 you are running. If you're not sure, go to admin > tools > server info ...php version # will be at the top. I suspect it's PHP5. IF THAT IS THE CASE, In your easypopulate.php file Find array_walk($readed, 'walk'); replace with this //array_walk($readed, 'walk'); foreach ($readed as $readed_record) { walk($readed_record); } If it's NOT php5, don't change anything at this point. I really can't rember who the post came from because I have been working on this site for two weeks straight with VARY little sleep! Sorry ADAM
  4. youngs_gifts

    Easy Populate & Products Attributes

    Hey is the permissons on your temp folder set to 777? Easy pop must be able to read and write to this folder for it to work. Adam
  5. youngs_gifts

    I Need a little coding help PLEASE

    Thanks Your coding worked great!!! I had tried some thing like that but dident have the quotes in the correct logical flow... Thanks Adam
  6. Hello all, I am tring to make this code work. if ['fedex_track_num'] and ['ups_track_num'] and ['usps_track_num'] are ALL null echo the text... Below is a little code snipet form the page that would print the text if one was null but I can't figure out how to make it work with three items to check? <tr> <?php if ($order->info['fedex_track_num'] == NULL) { echo TEXT_NO_TRACKING_AVAILABLE;?></tr> <?php } else{?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td> </tr> <?php } ?> Thanks Adam Young Young's gifts
  7. youngs_gifts

    coolMenu

    Mark, Thank you so much I adjusted the size of the menu in less than 15 minutes and every thing is now working fine. Adam Young's Gifts
  8. youngs_gifts

    coolMenu

    Mark, THANK YOU, I had looked at code all day yesterday and just did not think of that issue. The menu is working fine now. All I need to do now is adjust where it is on the page. :D :thumbsup: Thanks Adam
  9. youngs_gifts

    coolMenu

    Hi all, I am rather new to scripting in PHP and know nothing about java. I have installed COOL MENU, but all i am getting is a blank box? Java is not disabled in my browser and I did install the no js fix. I have disabled cool menu for now but here is the top part of my product_info.php code mabe i have done something wrong. can any please help. if i can get one page to work i can get them all to work. I have only commented out the call to coolmenu.php in column_left.php, so all the code is there if you want to check it out. Young's Gifts Thanks Adam <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ adapted for Separate Pricing Per Customer v4 2005/03/06 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_auction_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $auction_product_check = tep_db_fetch_array($product_auction_query); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); // BOF Separate Price per Customer if(!tep_session_is_registered('sppc_customer_group_id')) { $customer_group_id = '0'; } else { $customer_group_id = $sppc_customer_group_id; } // EOF Separate Price per Customer ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT> <?php // BOF: WebMakers.com Changed: Header Tag Controller v2.4.7 // Replaced by header_tags.php if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } // EOF: WebMakers.com Changed: Header Tag Controller v2.4.7 ?> <?php echo META; ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- coolMenu //--> <?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?> <!-- coolMenu_eof //--> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="<?php echo PAGE_WIDTH; ?>" cellspacing="3" cellpadding="3"> <tr>
  10. youngs_gifts

    Easy Populate upload

    Try to up load the file to the temp dir. uesing a ftp program. Then use the Import from Temp Dir (temp/) line to update your data base. make sure to include the whole file name IE: "new.txt" hope this helps
×