Jump to content

cdickson

Members
  • Content count

    67
  • Joined

  • Last visited

1 Follower

Profile Information

  1. cdickson

    JUST RELEASED! Printable Catalog

    bump? I have uninstalled and reinstalled this mod with the same results. You can view the error in action at http://www.blaineraytprs.com/catalog_produ...with_images.php.
  2. cdickson

    JUST RELEASED! Printable Catalog

    I'm having this problem too: all paginated pages show the same products. I was hoping that timidphper's easy fix would work, but unfortunately it doesn't (same versions of OSC and the mod). I can sort the products by category, price, etc. and the products do change. It is only when I use the pagination links at the bottom of the page that the same products keep appearing, so there is something in the pagination code that seems to be off. Any suggestions?
  3. cdickson

    Credit card error, please help

    I'm having the same problem except I don't get as detailed an error message. All I get is Credit Card Error!. The file in the fix you quoted looks like the file comes from a mod. If I can figure out the answer to my situation I'll post it here.
  4. cdickson

    All Customers Report

    MySQL 5 I'm doing my first install using MySQL 5 and I'm having trouble with this report. I think I almost have it - there is something in the syntax that I am not getting right. Can anyone help? The error: 1054 - Unknown column 'a.entry_zone_id' in 'on clause' SELECT c.customers_id , c.customers_default_address_id, c.customers_email_address, c.customers_fax, c.customers_telephone, a.entry_company, a.address_book_id, a.customers_id, a.entry_firstname, a.entry_lastname, a.entry_street_address, a.entry_suburb, a.entry_city, a.entry_state, a.entry_postcode, a.entry_country_id, a.entry_zone_id, z.zone_code, co.countries_name FROM (customers c) JOIN (zones z) ON a.entry_zone_id = z.zone_id JOIN (countries co) ON a.entry_country_id = co.countries_id LEFT JOIN (address_book a) ON c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id ORDER BY a.entry_lastname Original code: $customers_query_raw = "SELECT c.customers_id , c.customers_default_address_id, c.customers_email_address, c.customers_fax, c.customers_telephone, a.entry_company, a.address_book_id, a.customers_id, a.entry_firstname, a.entry_lastname, a.entry_street_address, a.entry_suburb, a.entry_city, a.entry_state, a.entry_postcode, a.entry_country_id, a.entry_zone_id, z.zone_code, co.countries_name FROM " . TABLE_CUSTOMERS . " c JOIN " . TABLE_ZONES . " z ON a.entry_zone_id = z.zone_id JOIN " . TABLE_COUNTRIES . " co ON a.entry_country_id = co.countries_id LEFT JOIN " . TABLE_ADDRESS_BOOK . " a ON c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id ORDER BY $db_orderby $sorted"; My unsuccessful attempt at modifying the code for MySQL 5: $customers_query_raw = "SELECT c.customers_id , c.customers_default_address_id, c.customers_email_address, c.customers_fax, c.customers_telephone, a.entry_company, a.address_book_id, a.customers_id, a.entry_firstname, a.entry_lastname, a.entry_street_address, a.entry_suburb, a.entry_city, a.entry_state, a.entry_postcode, a.entry_country_id, a.entry_zone_id, z.zone_code, co.countries_name FROM (" . TABLE_CUSTOMERS . " c) JOIN (" . TABLE_ZONES . " z) ON a.entry_zone_id = z.zone_id JOIN (" . TABLE_COUNTRIES . " co) ON a.entry_country_id = co.countries_id LEFT JOIN (" . TABLE_ADDRESS_BOOK . " a) ON c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id ORDER BY $db_orderby $sorted";
  5. cdickson

    Estimated Shipping Costs

    I had the same problem trying to use this with STS. Instead of re-hacking I opted to use the popup version written by Gary (potikyan) which you can find at http://www.oscommerce.com/community/contributions,3072. It works great with STS.
  6. cdickson

    Estimated Shipping Costs

    My script code reads like this: What is the & #39; in yours for? Did you customize it for something or is it an error?
  7. cdickson

    Estimated Shipping Costs

    Gary, Thanks for writing and posting this popup version. It works beautifully with the STS Template without having to go through the process of putting it in one of the columns, which I preferred not to do. :thumbsup: Cheers!
  8. cdickson

    Estimated Shipping Costs

    I'd love to have this modification as well. I'm having a difficult time getting the mod to work within STS template and this would be a perfect resolution. Thanks, Cindy
  9. I just did a new install of this feature on a new site and ran into the same situation. Using WinMerge I went through each file again and found that I had neglected to add code to checkout_process.php.
  10. Adding multiple contributions can definitely be tricky. We keep a separate list for each project and note which contributions were installed and tested on which date because it helps to determine which ones don't work together. It is known, for example, that STS Template and Search Engine Friendly URLs don't work together. We also install the most important contributions first. Our most recent installation includes the following contributions, and all of them work together just fine: STS Template State Abbreviation Fix All Customers Report v2.0 Option Type Feature v1.71 Featured Products v1.5.5 Order Editor v1.75 Custom Error Page v1.4 FedEx Direct v2.04 Product Sort v1.4 Admin DHTML Menu v2.1 Store Pick Up v1.4 Good luck, Sonia!
  11. Are you certain that you compared your files properly? I got the contribution to work very easily, although it didn't work the first time. I downloaded WinMerge (free) and I found a few very minor differences in the code. As we all know, these small variances will absolutely affect the functionality of any contribution. I have installed this several times - at least four - without issue, so if you make sure that the code is correct it will work. :thumbsup:
  12. I had a little bit of trouble with the code when I first installed this as well. I downloaded WinMerge - a terrific, free program that compares code in documents - and I found quite a few little things that I missed the first time around. After correcting my code, the mod works great! You can download WinMerge at http://winmerge.org/.
  13. This is a great mod, but I needed a way to require input for certain features that are added by this contribution. Others in this forum were trying to do the same thing, but there were no answers posted here. With some help, I found a way to do this. There is one new file to add, and there are three existing files that need to be modified. Remember: BACKUP first, and proceed at your own risk. I have this feature functioning properly on a client web site, but I offer no guarantees. Instructions - Create a .txt file ========================================= INSTRUCTIONS FOR REQUIRING AND VALIDATING DESIGNATED FIELDS FOR THE CONTRIBUTION Option Type Feature v1.71 ========================================= This was written to require two specific fields - Name & Birthdate - that I added with the Option Type Feature v1.71. You will need to do your own modifications to suit your specific fields. New file: catalog/formValidate.js Modified files: catalog/product_info.php catalog/includes/application_top.php catalog/includes/languages/english.php ========================================= 1. BACKUP - BACKUP - BACKUP ========================================= ========================================= 2. Upload formValidate.js to your catalog/ (or equivalent) directory. ========================================= ========================================= 3. Open cataolg/product_info.php ========================================= **FIND APPROX LINE 89: if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } **ADD IMMEDIATELY AFTER THE ABOVE: //SG Begin attribute validation if ($messageStack->size('product_info') > 0) { ?> <tr> <td><?php echo $messageStack->output('product_info'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } //SG End attribute validation **FIND APPROX LINE 155: $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); **ADD IMMEDIATELY AFTER THE ABOVE: //SG Begin attribute validation $tmp_html = '<input type="text" id="' . TEXT_PREFIX . $products_options_name['products_options_id'] . '" name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> <span id="inf_' . TEXT_PREFIX . $products_options_name['products_options_id'] . '"> </span>' . $products_options_name['products_options_comment']; //SG End attribute validation ========================================= 4. Open catalog/includes/application_top.php ========================================= **FIND APPROX LINE 324: // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } **ADD IMMEDIATELY AFTER THE ABOVE: //SG Begin attribute validation if (DISPLAY_CART == 'true') { $goto = FILENAME_SHOPPING_CART; $parameters = array('action', 'cPath', 'products_id', 'pid','mustselect'); } else { $goto = basename($PHP_SELF); if ($HTTP_GET_VARS['action'] == 'buy_now') { $parameters = array('action', 'pid', 'products_id','mustselect'); } else { $parameters = array('action', 'pid','mustselect'); } } //SG End attribute validation **FIND APPROX LINE 369: // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { **ADD IMMEDIATELY AFTER THE ABOVE: //SG Begin attribute validation if (is_array($HTTP_POST_VARS['id']) ) { // $messageStack->reset(); while (list($option, $value) = each($HTTP_POST_VARS['id'])) { switch ($option) { case 'txt_1': //Name $trimmedText = trim($value); if (strlen($trimmedText) < ENTRY_NAME_MIN_LENGTH) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] . '&mustselect=product_name')); break; } break; case 'txt_2': //Birthdate $strDate = $value; $isValid = false; if (ereg('^([0-9]{1,2})[/]([0-9]{1,2})[/]([0-9]{4})$', $strDate)) { $dateArr = split('[/]', $value); $m=$dateArr[0]; $d=$dateArr[1]; $y=$dateArr[2]; $isValid = checkdate($m, $d, $y); } if (!$isValid) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] . '&mustselect=product_birth')); break; } break; } } } elseif (tep_has_product_attributes($HTTP_POST_VARS['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id'])); break; } //SG End attribute validation **FIND APPROX LINE 544: // initialize the message stack for output messages require(DIR_WS_CLASSES . 'message_stack.php'); $messageStack = new messageStack; **ADD IMMEDIATELY AFTER THE ABOVE: //SG Begin attribute validation if (isset($HTTP_GET_VARS['mustselect'])){ $error = true; switch ($HTTP_GET_VARS['mustselect']) { case 'product_name' : $messageStack->add('product_info',ENTRY_NAME_ERROR); break; case 'product_birth' : $messageStack->add('product_info',ENTRY_BIRTHDATE_ERROR); break; } } //SG End attribute validation ========================================= 5. Open catalog/includes/languages/english.php ========================================= **ADD AT END OF PAGE JUST BEFORE ?>: //SG Require products_options for ski passes define ('ENTRY_NAME_ERROR', 'Full Name is Required to Purchase a Season Pass'); define ('ENTRY_NAME_MIN_LENGTH', '5'); define ('ENTRY_BIRTHDATE_ERROR', 'Birthdate is Required to Purchase a Season Pass. Please enter in format mm/dd/yyyy.'); define ('ENTRY_BIRTHDATE_MIN_LENGTH', '10'); New File - save as catalog/formValidate.js // ---------------------------------------------------------------------- // Javascript form validation routines. // Author: Stephen Poley // // Simple routines to quickly pick up obvious typos. // All validation routines return true if executed by an older browser: // in this case validation must be left to the server. // // Update Aug 2004: have tested that IE 5.0 and IE 5.5 both support DOM model // sufficiently well, so innerHTML option removed (redundant). // // Update Jun 2005: discovered that reason IE wasn't setting focus was // due to an IE timing bug. Added 0.1 sec delay to fix. // // Update Oct 2005: minor tidy-up: unused parameter removed // ---------------------------------------------------------------------- var nbsp = 160; // non-breaking space char var node_text = 3; // DOM text node-type var emptyString = /^\s*$/ var glb_vfld; // retain vfld for timer thread // ----------------------------------------- // trim // Trim leading/trailing whitespace off string // ----------------------------------------- function trim(str) { return str.replace(/^\s+|\s+$/g, '') }; // ----------------------------------------- // setfocus // Delayed focus setting to get around IE bug // ----------------------------------------- function setFocusDelayed() { glb_vfld.focus() } function setfocus(vfld) { // save vfld in global variable so value retained when routine exits glb_vfld = vfld; setTimeout( 'setFocusDelayed()', 100 ); } // ----------------------------------------- // msg // Display warn/error message in HTML element // commonCheck routine must have previously been called // ----------------------------------------- function msg(fld, // id of element to display message in msgtype, // class to give element ("warn" or "error") message) // string to display { // setting an empty string can give problems if later set to a // non-empty string, so ensure a space present. (For Mozilla and Opera one could // simply use a space, but IE demands something more, like a non-breaking space.) var dispmessage; if (emptyString.test(message)) dispmessage = String.fromCharCode(nbsp); else dispmessage = message; var elem = document.getElementById(fld); elem.firstChild.nodeValue = dispmessage; elem.className = msgtype; // set the CSS class to adjust appearance of message }; // ----------------------------------------- // commonCheck // Common code for all validation routines to: // (a) check for older / less-equipped browsers // (b) check if empty fields are required // Returns true (validation passed), // false (validation failed) or // proceed (don't know yet) // ----------------------------------------- var proceed = 2; function commonCheck (vfld, // element to be validated ifld, // id of element to receive info/error msg reqd) // true if required { if (!document.getElementById) return true; // not available on this browser - leave validation to the server var elem = document.getElementById(ifld); if (!elem.firstChild) return true; // not available on this browser if (elem.firstChild.nodeType != node_text) return true; // ifld is wrong type of node if (emptyString.test(vfld.value)) { if (reqd) { msg (ifld, "error", "ERROR: "); setfocus(vfld); return false; } else { msg (ifld, "warn", ""); // OK return true; } } return proceed; } // ----------------------------------------- // validatePresent // Validate if something has been entered // Returns true if so // ----------------------------------------- function validatePresent(vfld, // element to be validated ifld ) // id of element to receive info/error msg { var stat = commonCheck (vfld, ifld, true); if (stat != proceed) return stat; msg (ifld, "warn", ""); return true; }; function validateDate( vfld, ifld ) { var stat = commonCheck (vfld, ifld, true); if (stat != proceed) return stat; var strValue = trim(vfld.value); var objRegExp = /^\d{1,2}(\/)\d{1,2}\1\d{4}$/ //check to see if in correct format if(!objRegExp.test(strValue)) { msg (ifld, "error", "ERROR: "); setfocus(vfld); return false; //doesn't match pattern, bad date } else{ var strSeparator = strValue.substring(2,3) //find date separator var arrayDate = strValue.split(strSeparator); //split date into month, day, year //create a lookup for months not equal to Feb. var arrayLookup = { '01' : 31,'03' : 31, '04' : 30,'05' : 31,'06' : 30,'07' : 31, '08' : 31,'09' : 30,'10' : 31,'11' : 30,'12' : 31} var intDay = parseInt(arrayDate[1]); //check if month value and day value agree if(arrayLookup[arrayDate[0]] != null) { if(intDay <= arrayLookup[arrayDate[0]] && intDay != 0) return true; //found in lookup table, good date } //check for February (bugfix 20050322) var intMonth = parseInt(arrayDate[0]); if (intMonth == 2) { var intYear = parseInt(arrayDate[2]); if( ((intYear % 4 == 0 && intDay <= 29) || (intYear % 4 != 0 && intDay <=28)) && intDay !=0) return true; //Feb. had valid number of days } } msg (ifld, "error", "ERROR: "); setfocus(vfld); return false; //any other values, bad date } function validateOnSubmit() { var elem; var errs=0; // execute all element validations in reverse order, so focus gets // set to the first one in error. if (!validateDate (document.forms.cart_quantity.txt_2, 'inf_txt_2')) errs += 1; if (!validatePresent (document.forms.cart_quantity.txt_1, 'inf_txt_1')) errs += 1; if (errs>1) alert('Some fields have not been completed correctly'); if (errs==1) alert('There is a field which has not been completed correctly'); return (errs==0); }; Good luck!
  14. cdickson

    Estimated Shipping Costs

    Thanks, Howard. At least this gives me an idea of where to start. If I can come up with the answer I'll post it here so that others using STS can use it.
  15. cdickson

    Estimated Shipping Costs

    Howard - great contribution! Thanks! I must have made an error somewhere, though, because I have not been able to get the estimated shipping box into the left column. I have installed the contribution, checked it several times, then reinstalled v1.7 and still have the same problem. My site looks like this: My column_left.php code is: <?php /* $Id: column_left.php,v 1.1 2003/09/08 19:26:22 jhtalk Exp jhtalk $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ // STS: ADD $sts_block_name = 'header2columnleft'; require(STS_RESTART_CAPTURE); // STS: EOADD if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'categories.php'); } // STS: ADD $sts_block_name = 'categorybox'; require(STS_RESTART_CAPTURE); // STS: EOADD if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { include(DIR_WS_BOXES . 'manufacturers.php'); } // STS: ADD $sts_block_name = 'manufacturerbox'; require(STS_RESTART_CAPTURE); // STS: EOADD require(DIR_WS_BOXES . 'whats_new.php'); // STS: ADD $sts_block_name = 'whatsnewbox'; require(STS_RESTART_CAPTURE); // STS: EOADD require(DIR_WS_BOXES . 'search.php'); // STS: ADD $sts_block_name = 'searchbox'; require(STS_RESTART_CAPTURE); // STS: EOADD require(DIR_WS_BOXES . 'information.php'); // STS: ADD $sts_block_name = 'informationbox'; require(STS_RESTART_CAPTURE); // STS: EOADD require(DIR_WS_BOXES . 'shopping_cart.php'); // STS: ADD $sts_block_name = 'cartbox'; require(STS_RESTART_CAPTURE); // STS: EOADD if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php'); // STS: ADD $sts_block_name = 'maninfobox'; require(STS_RESTART_CAPTURE); // STS: EOADD if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php'); // STS: ADD $sts_block_name = 'orderhistorybox'; require(STS_RESTART_CAPTURE); // STS: EOADD if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'"); $check = tep_db_fetch_array($check_query); if ($check['count'] > 0) { include(DIR_WS_BOXES . 'best_sellers.php'); } else { include(DIR_WS_BOXES . 'product_notifications.php'); } } else { include(DIR_WS_BOXES . 'product_notifications.php'); } } else { include(DIR_WS_BOXES . 'best_sellers.php'); } // STS: ADD $sts_block_name = 'bestsellersbox'; require(STS_RESTART_CAPTURE); // STS: EOADD if (isset($HTTP_GET_VARS['products_id'])) { if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php'); } else { include(DIR_WS_BOXES . 'specials.php'); } // STS: ADD $sts_block_name = 'specialfriendbox'; require(STS_RESTART_CAPTURE); // STS: EOADD require(DIR_WS_BOXES . 'reviews.php'); // STS: ADD $sts_block_name = 'reviewsbox'; require(STS_RESTART_CAPTURE); // STS: EOADD if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { include(DIR_WS_BOXES . 'languages.php'); // STS: ADD $sts_block_name = 'languagebox'; require(STS_RESTART_CAPTURE); // STS: EOADD include(DIR_WS_BOXES . 'currencies.php'); // STS: ADD $sts_block_name = 'currenciesbox'; require(STS_RESTART_CAPTURE); // STS: EOADD } // BEGIN estimated shipping --> require(DIR_WS_MODULES . FILENAME_ESTIMATED_SHIPPING); // END estimated shipping --> ?> Any help would be greatly appreciated.
×