Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

gtilflm

Pioneers
  • Posts

    60
  • Joined

  • Last visited

Everything posted by gtilflm

  1. Ok. I've posted the new full package in the addon area. I still may end up using cron at some point, but I'll give this way another shot. I already modified things to use a different database table called "subscriptions", so I have no problem going outside the bounds of OsCommerce. Anyway, thanks for the support.
  2. There were a handful of issues and some were related to how I modified the contrib. to work in the way I wanted it to. So, I don't fully remember all of the issues that were on my end vs. inherent issues with refreshing. A couple that come to mind though are... One time I got some kind of couldn't connect to server error due to too many database connections. One time I got a connection reset error from Firefox. As for the report add-on, it's below. It will place an html file in the admin dir. and email the store owner that the report is there with a link to it. I'll update the contrib. if you think it's solid enough. Note that I've modified things a bit, so some variables might work for me, but still may not fit with the contrib. at large. Both edits are in /catalog/admins/mm_bulkmail.php 1.) BEFORE: echo "<meta http-equiv='refresh' content=$mailrate>"; ADD: //Create/update log file of sent emails. $log_file_id = tep_session_id (); //Using tep_session_id to make the file name unique to this mailing. It's unlikely that someone would send the same newsletter while still logged in with the same session_id. $email_name = $mail['first_name'] . ' ' . $mail['last_name']; $date_time = date("D, d M Y g:i a"); //Does the log file already exist? $log_file_check = tep_db_input($newsletter_id) . '_' . $log_file_id . '.html'; if (!file_exists($log_file_check)) { $log_data = ' <table> <tr> <td colspan="3"><h1>Log File of Sent Emails for Newsletter ID #' . tep_db_input($newsletter_id) . '</h1></td> </tr> <tr> <td colspan="3"><h3>Sending began on ' . $date_time . ' (server time)</h3></td> </tr> <tr> <td><h3>Name</h3></td> <td><h3>Email</h3></td> <td><h3>Date/Time</h3></td> </tr> <tr> <td>' . $email_name . '</td> <td>' . $email . '</td> <td>' . $date_time . '</td> </tr> '; } else { $log_data = ' <tr> <td>' . $email_name . '</td> <td>' . $email . '</td> <td>' . $date_time . '</td> </tr> '; } $log_file_id = tep_session_id (); $log_file = fopen(tep_db_input($newsletter_id) . '_' . $log_file_id . '.html', 'a+'); fwrite($log_file, $log_data); fclose($log_file); 2.) BEFORE: ?> <tr><td><?php echo tep_draw_separator('pixel_trans.gif', '10', '20'); ?></td></tr> <tr><td class="main"><font color="#ff0000"><b> <?php echo TEXT_FINISHED_SENDING_EMAILS; ADD: //Finish updating log file of sent emails. $date_time = date("D, d M Y g:i a"); $log_data = '</table><br><br> END OF LOG DATA FOR THIS BULK EMAIL SEND.<br><i>Ended sending on ' . $date_time . ' (server time)</i>'; $log_file_id = tep_session_id (); $log_file = fopen(tep_db_input($newsletter_id) . '_' . $log_file_id . '.html', 'a+'); fwrite($log_file, $log_data); fclose($log_file); //Email the store admin about the mailing being complete $log_file_location = tep_db_input($newsletter_id) . '_' . $log_file_id . '.html'; $log_email_subject = 'Bulkmail sending of ' . $newsletter['title'] . ' complete'; $log_email_body = 'The bulkmail sending of ' . $newsletter['title'] . ' complete. You can view the log file containing information on who was emailed and more information <a href="' . HTTP_CATALOG_SERVER . DIR_WS_ADMIN . $log_file_location . '">here</a>.'; tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $log_email_subject, $log_email_body, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); That's it!
  3. Two things. 1.) I just finished my first mass sending and there were multiple issues with the 1,700 times of refreshing the page. It was a variety of things and I feel that I may need to alter how this script works to use cron instead. I'll have to think about it. Jase, I can get you my code if I end up doing that. 2.) Jase, I did code in the reporting and it was HUGE in dealing with the issues I encountered. Do you want me to update the package with it? Post it here? Hold off until the cron method is implemented? Let me know. Thanks for the contrib., BTW.
  4. Last question (hopefully). After a sending, is there a record of the number of emails it was sent to? And maybe even a list of email addresses that did receive it? That would be a great way to ensure everything is working properly and that email per hr. server limits weren't reached.
  5. Ok. Thanks for the clarification on how the script works. Just so I understand... in my scenario of sending 1,700 emails, it would refresh the page 1,700 times? If so, maybe it would be better if the emails were sent in chunks of 20, 50, 100? I don't know if this is possible, but I'm just throwing the idea out there.
  6. Oh... right. I was calculating emails per second. Whoops! Still though, if I have about 1,700 emails to send out, wouldn't that have the script executing for a LONG time (over 3 hrs.)? Or is the bulk mail manager set up to send a chunk, then stop, then send a chunk, then stop, etc.? Thanks.
  7. Hey Jase. I'm putting this into production now and I have a question on the "mailing rate in seconds between emails" in the BulkMail Manager. My webhost only allows 500 emails per hr. So, 500 emails per hr. ÷ 3600 secs. in an hour = 0.1388888... Can a value that is less than 1 be used here? If not, any ideas on a way around this? Thanks!
  8. Ok, great. I'll take a look at those as a I delve deper into it. Thanks!
  9. Hi. I'm just beginning to get into this contrib. I'm wondering if there's a way to say, "Dear _____," in the emails. For example, PayPal always has the user's name in the emails so that you know they are authentic PayPal emails. Does this contrib. allow for that? If not, any brief suggestions on how to build that feature? Thanks!
  10. I run a math tutoring business and I'm developing "side module" where the tutors I hire can login and do various things. I've basically copy/pasted the relevant code from login.php, to the Tutor Login page, but tep_validate_password is continuously returning an error when I correctly enter a password and login. My section of code below contains the error checking lines of... echo $password . '------' . $check_tutor['password']; print_r ($check_tutor); The relevant code then is... <?php require('includes/application_top.php'); // Redirect to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started) if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN); $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) { $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); $password = tep_db_prepare_input($HTTP_POST_VARS['password']); // Check if email exists $check_tutor_query = tep_db_query("select * from tutors where tutor_email = '" . tep_db_input($email_address) . "'"); if (!tep_db_num_rows($check_tutor_query)) { $error = true; } else { $check_tutor = tep_db_fetch_array($check_tutor_query); // Check that password is good if (!tep_validate_password($password, $check_tutor['password'])) { $error = true; echo $password . '------' . $check_tutor['password']; print_r ($check_tutor); } else { if (SESSION_RECREATE == 'True') { tep_session_recreate(); } $tutors_id = $check_tutor['tutors_id']; tep_session_register('tutors_id'); //Redirect to the tutor_portal tep_redirect(tep_href_link('tutor_portal.php')); echo $tutors_id; echo $email_address; } } } ?> The crazy thing is that the echo $password . '------' . $check_tutor['password']; line shows that the plain password matches the encrypted one. Please help as this is driving me crazy! Thanks.
  11. Hello all. I have v 2.2 RC2 and the extra email feature is turned on so that I get an email notification of when an order is placed. I've been noticing that if a customer pays via PayPal and they have an unverified address, then I don't get an email. Is this just me, or is this a known issue? If it's a known issue, does it have a fix? Thanks!
  12. Hello. I would like to insert a step before shipping if the customer purchases a certain products_id. On that page, they can choose various options before proceeding to the shipping page. However, only certain parts of this page would be relevant depending on what items they purchase. So, perhaps using some kind of a check against an array of products could determine what info. shows up on the "pre-shipping" page? Does anyone know of anything out there like this already? At least the adding in a page before shipping part? Thanks.
  13. Hello all. I'm installing a modification in which I need to insert data into a table based on if the order_status is paid or not. I'm working with checkout_process.php After: // load the after_process function from the payment modules $payment_modules->after_process(); $cart->reset(true); I have: //Begin code for determining if a VBC product has been purchased and handling orders that are paid vs. orders that are to be paid later // 1.) Get order ID for order. //$insert_id This is the orders_id. // 2.) Get customer's data for entering into the bridge. Using information that's already on this page. // 3.) Use order ID to get products assoacited with that order // $order->products[$i]['id'] Contains product information for this order. // 4.) Generate the security token //BOF Security token function function new_token($length) { return substr(_new_token(), 0, $length); } function _new_token() { $rand_bits = ''; // Linux platform $fp = @fopen('/dev/urandom', 'rb'); if ($fp !== FALSE) { $rand_bits .= @fread($fp, 16); @fclose($fp); } // Windows platform if (@class_exists('COM')) { try { $CAPI_Util = new COM('CAPICOM.Utilities.1'); $rand_bits .= $CAPI_Util->GetRandom(16, 0); // 0 - base64 encoding } catch (Exception $ex) { // Fail silently; see OWASP 2007 A6 } } // If both above fail, fall back to a default method if (strlen($rand_bits) < 16) { $rand_bits .= substr(session_id(), 0, 8) . rand() . rand(); } return sha1($rand_bits); } //echo new_token(30); $token = new_token(30); //EOF Security token function // 5.) // a.) Is products_id one of the VBC products? foreach ($order->products as $product) { if (in_array($product['id'], array(85, 86, 89, 90, 91, 92, 93, 94, 95))) { if ($order->info['order_status'] == 3) { //If the status is paid... // Write necessary info. to table. $sql_data_array = array( 'token' => $token, 'orders_id' => $insert_id, 'products_id' => $product['id'], 'customer_firstname' => $order->customer['firstname'], 'customer_lastname' => $order->customer['lastname'], 'customer_email' => $order->customer['email_address'], 'date_added' => 'now()' ); tep_db_perform('VBC_table', $sql_data_array); } else { // The order hasn't been paid for yet... // Write preliminary info. to table. $sql_data_array = array( // Uncomment if the autoincrement isn't being added 'id' => 'null', 'token' => '', 'orders_id' => $insert_id, 'products_id' => $product['id'], 'customer_firstname' => $order->customer['firstname'], 'customer_lastname' => $order->customer['lastname'], 'customer_email' => $order->customer['email_address'], 'date_added' => 'now()' ); tep_db_perform('VBC_table', $sql_data_array); } } } //End code for determining if a VBC product has been purchased and handling orders that are paid vs. orders that are to be paid later (John) Currently, orders that are not yet paid for are having the preliminary data entered into the table and everything is fine. However, when paying by PayPal (with a successful payment), apparently I've done something wrong because I placed an order and an entry was not recorded in the VBC_table. It appears that the check at step 5: if ($order->info['order_status'] == 3) { is failing. Any ideas? Thanks!
  14. Actually, I think I got it working. In the order total module I changed a different function to not display the output. If it helps anyone, my code is below.... function process() { global $order, $cart, $currencies; $extra_charge_tot = $cart->get_extra_charge_total(); // The "if" and "else" statements were added by John to not display the the extra charge if the extra chrage value is 0. if ($extra_charge_tot == 0) { $order->info['total'] += $extra_charge_tot; $this->output = array(); } else { $order->info['total'] += $extra_charge_tot; $this->output[] = array('title' => MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_TITLE . ':', 'text' => $currencies->format($extra_charge_tot, true, $order->info['currency'], $order->info['currency_value']), 'value' => $extra_charge_tot); } } Thanks to all who responded to this.
  15. I did that and it's still a no go. The current code is.... class ot_extra_charge { var $code, $title, $description, $icon, $enabled, $output, $products_id; function ot_extra_charge() { $this->code = 'ot_extra_charge'; $this->title = MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_TITLE; $this->description = MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_DESCRIPTION; $this->sort_order = MODULE_ORDER_TOTAL_EXTRA_CHARGE_SORT_ORDER; $this->icon = ''; // Next two lines added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. $extra_charge_query = tep_db_query("select products_extra_charge from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $extra_charge_query_value = mysql_fetch_array($extra_charge_query); // Next three lines added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. if ($extra_charge_query_value['products_extra_charge'] == 0.0000) { $this->enabled = false; } else { $this->enabled = ((MODULE_ORDER_TOTAL_EXTRA_CHARGE_STATUS == 'true') ? true : false); // Next line added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. } $this->output = array(); } I've also tried putting "global products_id;" in there and it's still not happening. Does anyone else have other thoughts?
  16. My php skills are.... limited, so I'm not sure what you mean by "declared". Is there a way to tell the class what "products_id" is? Thanks.
  17. Jim, Thanks for the reply. I applied the changes and currently have.... class ot_extra_charge { var $code, $title, $description, $icon, $enabled, $output; function ot_extra_charge() { $this->code = 'ot_extra_charge'; $this->title = MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_TITLE; $this->description = MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_DESCRIPTION; $this->sort_order = MODULE_ORDER_TOTAL_EXTRA_CHARGE_SORT_ORDER; $this->icon = ''; // Next two lines added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. $extra_charge_query = tep_db_query("select products_extra_charge from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $extra_charge_query_value = mysql_fetch_array($extra_charge_query); // Next three lines added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. if ($extra_charge_query_value['products_extra_charge'] == 0.0000) { $this->enabled = false; } else { $this->enabled = ((MODULE_ORDER_TOTAL_EXTRA_CHARGE_STATUS == 'true') ? true : false); // Next line added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. } $this->output = array(); } It's still not working. Also, I tried the echo test again by placing the following in checkout_payment... $extra_charge_query = tep_db_query("select products_extra_charge from " . TABLE_PRODUCTS . " where products_id = '" . tep_db_input($products_id) . "'"); $extra_charge_query_value = mysql_fetch_array($extra_charge_query); echo $extra_charge_query_value['products_extra_charge']; and I'm not getting anything returned. Could the problem be with tep_db_input($products_id)? Thanks for any more ideas.
  18. Hello. I'm using the following addon: http://addons.oscommerce.com/info/5461 Basically, it let's you charge an extra fee on certain products. I would like it to not display Extra Fee: $0.00 if there's no extra fee. So, I had the idea of setting the enabled status to false if the extra fee value was 0. The relevant code is... // Next two lines added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. $extra_charge_query = tep_db_query("select products_extra_charge from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'"); $extra_charge_query_value = mysql_fetch_array($extra_charge_query); class ot_extra_charge { var $code, $title, $description, $icon, $enabled, $output; function ot_extra_charge() { $this->code = 'ot_extra_charge'; $this->title = MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_TITLE; $this->description = MODULE_ORDER_TOTAL_EXTRA_CHARGE_TEXT_DESCRIPTION; $this->sort_order = MODULE_ORDER_TOTAL_EXTRA_CHARGE_SORT_ORDER; $this->icon = ''; // Next three lines added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. if ($extra_charge_query_value == 0.0000) { $this->enabled = false; } else { $this->enabled = ((MODULE_ORDER_TOTAL_EXTRA_CHARGE_STATUS == 'true') ? true : false); // Next line added by John to see if the extra charge value is 0. If it is, then set the extra charge order total module to false. if it does not = 0, then check to see if the admin setting has it set to true or false. Not working as of June 14, 2010. } $this->output = array(); } It's not working and is always returning false. I tried doing a test of the mysql code I'm using and I can't even echo $extra_charge_query_value. Any ideas on where I've gone wrong?
  19. Hello. I have the "Customers extra fields" mod installed (http://addons.oscommerce.com/info/3737) and I'm having a situation where I've set several of the fields to required, but the customer can still submit the form if the fields are blank. Has anyone else had this? Thanks.
  20. Hi. I'm working with the Admin Comments Toolbar add-on (http://addons.oscommerce.com/info/869) I am trying to integrate this into a mod. of my own where I update comments for customers (but not order comments). I've gotten it to work, except that when I click one of the comment buttons, it updates without letting me edit the comment. Any ideas on how I can stop this from happening so I can edit the comment? Thanks!
  21. Hi. I have the "Zero weight skips shipping" mod installed (http://addons.oscommerce.com/info/3480). Everything was find until I created a product with product attributes and zero weight. When that is the only item in the cart, the customer is brought to the shipping page (shouldn't happen). When that item is in the cart with other virtual products, the shipping page is skipped (should happen). Thoughts on how to fix this? Thanks.
  22. Ok. Does anyone have any ideas for starting points? Thanks!
  23. Hello. I use OsCommerce in my math tutoring company and I wanted to find out if there was a contrib. out there that does what I'm looking for. Specifically...... * Display to customers (as a separate box?) how much tutoring time they have. * Allow admin. to easily add time to their account via the admin. interface. * Display to customers a list of tutoring sessions that have already occurred along with any notes the admin/teacher made about those sessions. * Allow admin. to easily update this list with new entries. Similar to how you can currently do with order notes. I've been playing around with using something like the gift voucher side of CCGV to make this happen, but I'm just not that good w/ PHP. Any thoughts? Thanks.
  24. Tom, Ok. Removing the semi-colons stopped the errors...... but it's not working. I set the payment status to true in admin and it does not display no matter if the customer's value is "yes" or "no". Thanks for your continued help with this. Burt, How would you suggest doing it with a session? Thanks.
×
×
  • Create New...