Jump to content

Bob Terveuren

Members
  • Content count

    496
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Bob Terveuren

  1. Bob Terveuren

    zipcode shipping module

    Hi - OK had that rethink - this one can be tricky to setup and you can often end up with the situation you are seeing if there's a glitch in the admin. When it cannot correctly calculate a value it should display: Postcode Shipping No delivery/shipping available to the selected Postcode. But if you have not set the weights correctly then you can get: Postcode Shipping The delivery/shipping fee cannot be determined at this time $0.00 The trick is to set a big final weight in each zone - something like 10000:10000 - e.g. 4:7,10:10,99:13.50, 10000:10000 If that still does not fix it then here's a code hack that will disable the module if it sees a zero value returned // class constructor function zipship() { global $order; $this->code = 'zipship'; $this->title = MODULE_SHIPPING_ZIPSHIP_TEXT_TITLE; $this->description = MODULE_SHIPPING_ZIPSHIP_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_ZIPSHIP_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_ZIPSHIP_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_ZIPSHIP_STATUS == 'True') ? true : false); // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED!!! $this->num_zones = 6; if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ZIPSHIP_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ZIPSHIP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } // check for a zero shipping price if ($this->quote()['methods'][0]['cost'] <= 0){ $this->enabled = false; } } // class methods
  2. Bob Terveuren

    zipcode shipping module

    nope - having a rethink........
  3. Hi - just dropped by and spotted this - thanks for the kind words from people - few disparate thoughts on PayPal follow...... I'm in the middle of coding up a module for a non-oSC cart (that is also PHP/MySQL) trying to use the PayPal REST APi. Two weeks ago I fell over an undocumented problem with that APi and, so far, PayPal have maintained a resolute silence to my requests for advice. (I really suspect that they no longer have anybody in support who knows how their legacy stuff works [legacy means more than three years old???]). In addition I found that they will return a response of 'Completed' even if the payment method is an eCheck (unusual here in the UK but for a US merchant that eCheck should clear before despatch). I've also found a great difference between the Sandbox and Live versions of PayPal - so much so that it entails testing in both taking twice the time and effort to do so (and also ballsing up personal PayPal accounts in the process). I'm currently trying to decide if I should just cut my losses and drop out of the contract - it is that bad trying to work with them. Bluntly? My advice would be to have a good, hard look at why you want to use PayPal. Buy an SSL and use Stripe (certainly if you are USD/UK/CAN/AUD) - they will 'sit' on your money for seven days but do not come with the baggage of PayPal. If not then find a payments processor that provides their own code and supports it! Finally - the 'new' oSC PayPal App was probably written with due regard to the published/documented PayPal info by HPDL and his team - I have learned recently that the documentation is, frankly? Pish (as they say where I grew up). As a payments developer, PayPal customer and PayPal merchant (albeit UK based)? PayPal are failing to defend their previous market lead as a third party, online payments processor - look elsewhere, you may get cheaper rates and you will not have to suffer their 'buyer protection' policy that will feck over merchants continually. Cynical? Moi? Yup!
  4. Bob Terveuren

    View Counter

    Hi - can you rename it on your local computer as a .txt, upload and then rename on the server to a .bin?
  5. Bob Terveuren

    Auto Update Currencies

    Hi Peper - dirty trick? Moi? :D
  6. Hi If you are using a recent version of osC then the includes/classes/order.php file will not record anything in those fields - e.g. 2.3.4 and 2.3.4BS have these at line 218/221 'cc_type' => '', 'cc_owner' => '', 'cc_number' => '', 'cc_expires' => '', so you'll always get empty data. If you change those lines to this you'll get a record 'cc_type' => $_POST['cc_type'], 'cc_owner' => $_POST['cc_owner'], 'cc_number' => $_POST['cc_number'], 'cc_expires' => $_POST['cc_expires'], However that could land you in a world of pain as storing the cc_number in its entirety is most likely a hanging offence in most of the Western World nowadays so you should obfuscate that in some manner e.g. I think this should get you a card number like 4111XXXXXXXX1234 for storage but best check 'cc_type' => $_POST['cc_type'], 'cc_owner' => $_POST['cc_owner'], 'cc_number' => substr($_POST['cc_number'], 0, 4) . str_repeat('X', (strlen($_POST['cc_number']) - 8)) . substr($_POST['cc_number'], -4); 'cc_expires' => $_POST['cc_expires'],
  7. No - it is not a mismatch - what you are seeing is down to the difference between the catalog/includes/classes/currencies.php file and admin/includes/classes/currencies.php files - as pointed out to you the latter is missing: function get_decimal_places($code) { return $this->currencies[$code]['decimal_places']; } if you add that into admin/includes/classes/currencies.php then the order editor add on should work. You may also have to cast the value at line 29 to an integer: 'decimal_places' => (int)$currencies['decimal_places'], Shipping modules were never designed to be pulled into the admin side of things - when they are then you also need to have all the catalog operations available to them so, in this case the error lies in a combination or order editor and the stock code - not the shipping module. This has always been the case with osCommerce (at least since 2006) - that get_decimal_places is missing from the admin class.
  8. Bob Terveuren

    Cron Simulator

    Mr_a - the code may be correct but the error message is telling you that it is being called more than once probably because it looks as though both compatability.php files (admin / catalog) are being called someplace in the code Idealy you'd weed through the code and work out what/where/when/why but that may take sometime - here's a very hacky suggestion that may fix the problem but not screw up anything else.... Actually, having looked at the file at: /home/user/public_html/includes/functions/compatibility.php the 'hacky' stuff is in there but not for that function - go to that file and it will have the code as you posted: function do_magic_quotes_gpc(&$ar) { if (!is_array($ar)) return false; reset($ar); while (list($key, $value) = each($ar)) { if (is_array($ar[$key])) { do_magic_quotes_gpc($ar[$key]); } else { $ar[$key] = addslashes($value); } } reset($ar); } Now wrap that in a if (!function_exists('blah de blah')) {} : if (!function_exists('do_magic_quotes_gpc')) { //---------------------------- function do_magic_quotes_gpc(&$ar) { if (!is_array($ar)) return false; reset($ar); while (list($key, $value) = each($ar)) { if (is_array($ar[$key])) { do_magic_quotes_gpc($ar[$key]); } else { $ar[$key] = addslashes($value); } } reset($ar); } //------------------------------- } If you look further into the file you'll see similar wraps
  9. Bob Terveuren

    Phone not including

    Hi there I'm guessing that this is not possible in that function - do you want it in the later one at line 621 function doExpressCheckoutPayment($parameters) ??? If so then try this - go up to the before_process() function and add the lines as shown after $params['PAYMENTREQUEST_0_SHIPTOZIP'] = $order->delivery['postcode']; on or about line 232 $params['PAYMENTREQUEST_0_SHIPTOZIP'] = $order->delivery['postcode']; //phone $params['PAYMENTREQUEST_0_SHIPTOPHONENUM'] = $order->customer['telephone'];// changed your _n_ to _0_ //end
  10. Bob Terveuren

    Automatically send data feed to Froogle

    Hi Try Jack's addon http://addons.oscommerce.com/info/7701 works usually - support here
  11. Bob Terveuren

    Automatically send data feed to Froogle

    Hi chaps Cron is a total PITA from server to server - what works on one fails on another (every dang time) If you are not troubled by the feeder file getting relocated to the /catalog/ folder then you could try running it under cron using wget (so long as wget id in the PHP install) - I've resorted to that a few times when a Cron syntax reduces me to tears. It does mean the cron file is exposed to the web in the /catalog/ folder but you could install some basic security check if you were troubled 0 * * * * wget -O /dev/null http://www.example.com/googlefeeder.php?user=MyUserName&pass=MyPassWord
  12. Bob Terveuren

    Automatically send data feed to Froogle

    Hi Jack & Mr A. Looks like the includes folder is not being found by application_top? You could try coding in the path to the includes file so it would maybe something like: set_include_path('/home/user/public_html/admin/includes/') at the top of the googlefeeder file (maybe remove the admin/ bit depending where chdir ../ is in the code) I've had a couple of sites where running the cronjob on an /admin/ file fails every time - some needed the cron file to actually be in the catalog folder (old stuff - PHP 5.3 and less) on some more recent ones with osC 2.3.4 I've used a chopped down application_top file - /admin/includes/application_top_cron.php (code below) - that may run without the chdir command but I think Mr A server is the culprit as cron jobs vary so much from server to server <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ // Start the clock for the page parse time log define('PAGE_PARSE_START_TIME', microtime()); // Set the level of error reporting error_reporting(E_ALL & ~E_NOTICE); // check support for register_globals if (function_exists('ini_get') && (ini_get('register_globals') == false) && (PHP_VERSION < 4.3) ) { exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory. Please use PHP 4.3+ if register_globals cannot be enabled on the server.'); } // load server configuration parameters if (file_exists('includes/local/configure.php')) { // for developers include('includes/local/configure.php'); } else { include('includes/configure.php'); } // Define the project version --- obsolete, now retrieved with tep_get_version() define('PROJECT_VERSION', 'osCommerce Online Merchant v2.3'); // some code to solve compatibility issues require_once(DIR_WS_FUNCTIONS . 'compatibility.php'); // set the type of request (secure or not) $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL'; // set php_self in the local scope $req = parse_url($HTTP_SERVER_VARS['SCRIPT_NAME']); $PHP_SELF = substr($req['path'], ($request_type == 'SSL') ? strlen(DIR_WS_HTTPS_ADMIN) : strlen(DIR_WS_ADMIN)); // Used in the "Backup Manager" to compress backups define('LOCAL_EXE_GZIP', 'gzip'); define('LOCAL_EXE_GUNZIP', 'gunzip'); define('LOCAL_EXE_ZIP', 'zip'); define('LOCAL_EXE_UNZIP', 'unzip'); // include the list of project filenames require(DIR_WS_INCLUDES . 'filenames.php'); // include the list of project database tables require(DIR_WS_INCLUDES . 'database_tables.php'); // Define how do we update currency exchange rates // Possible values are 'oanda' 'xe' or '' define('CURRENCY_SERVER_PRIMARY', 'oanda'); define('CURRENCY_SERVER_BACKUP', 'xe'); // include the database functions require(DIR_WS_FUNCTIONS . 'database.php'); // make a connection to the database... now tep_db_connect() or die('Unable to connect to database server!'); // set application wide parameters $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION); while ($configuration = tep_db_fetch_array($configuration_query)) { define($configuration['cfgKey'], $configuration['cfgValue']); } // define our general functions used application-wide require(DIR_WS_FUNCTIONS . 'general.php'); require(DIR_WS_FUNCTIONS . 'html_output.php'); // initialize the logger class require(DIR_WS_CLASSES . 'logger.php'); // include shopping cart class require(DIR_WS_CLASSES . 'shopping_cart.php'); // define our localization functions require(DIR_WS_FUNCTIONS . 'localization.php'); // Include validation functions (right now only email address) require(DIR_WS_FUNCTIONS . 'validations.php'); // setup our boxes require(DIR_WS_CLASSES . 'table_block.php'); require(DIR_WS_CLASSES . 'box.php'); //define chaset if(!defined(CHARSET)){ define('CHARSET', 'utf-8'); } // split-page-results require(DIR_WS_CLASSES . 'split_page_results.php'); // entry/item info classes require(DIR_WS_CLASSES . 'object_info.php'); // email classes require(DIR_WS_CLASSES . 'mime.php'); require(DIR_WS_CLASSES . 'email.php'); // file uploading class require(DIR_WS_CLASSES . 'upload.php'); // calculate category path if (isset($HTTP_GET_VARS['cPath'])) { $cPath = $HTTP_GET_VARS['cPath']; } else { $cPath = ''; } if (tep_not_null($cPath)) { $cPath_array = tep_parse_category_path($cPath); $cPath = implode('_', $cPath_array); $current_category_id = $cPath_array[(sizeof($cPath_array)-1)]; } else { $current_category_id = 0; } // initialize configuration modules if(class_exists(DIR_WS_CLASSES . 'cfg_modules.php')){ require(DIR_WS_CLASSES . 'cfg_modules.php'); $cfgModules = new cfg_modules(); // the following cache blocks are used in the Tools->Cache section // ('language' in the filename is automatically replaced by available languages) $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true), array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true) ); } // define low stock report ?>
  13. Bob Terveuren

    One page checkout & PayPal

    Hi - which OPC are you using? It sounds like when you have only one gateway available that it should be getting autoselected but the OPC is not doing that - what happens though if you just fill in all the details then click the button? Does it say 'you must select a payment option'? If so then the autoselect is bust
  14. Bob Terveuren

    Skrill (Moneybookers) Module

    Hi If I read this correctly - try changing all the instances of mysql_real_escape_string to mysqli_real_escape_string or do you mean you want it osC style? Something like: tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_group_id, date_added,configuration_description) values ($title, $key, $value, '6', now(),$description)"); (or something like that)
  15. Bob Terveuren

    Shipping in cart

    Hi - as far as I can see the tax code is in there - can you double check that you have a tax rate applied to the shipping module and that the store is set to display prices with tax - in a default store if I have those set and then enlarge the 7% default sales tax to cover all countries and all zones then I get the 7% tax added. If I then restrict it back to (say) just the USA then that works too. Note that it only works on country wide taxes so if, for example, you use the default Florida only 7% tax then you cannot narrow it down that far so if you select USA in the counties dropdown it will not generate a tax value until your into the checkout stream and set shipping address
  16. Bob Terveuren

    PayPal Express redirect issue.

    Hi Wild guess - domestic address is getting a 'authorised' at payPal, sends you back to checkout_confirmation where you 'confirm' the purchase and PayPal gets send a 'capture'. On international the first visit to PayPal is generating 'auth and capture' in one go sp -> checkout_success that'd be my best bet but as for why? No idea if it is a PayPal setting or a store one.
  17. Bob Terveuren

    PayPal App v4.039 - double stock decrement

    Hi if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) { $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty']; } else { $stock_left = $stock_values['products_quantity']; } // tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . (int)$stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) { // tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } Looking at the payment module file - apply the two // comments to the two lines in before_process() - that will skip the changes to the product table but do all the other customer 'stuff' like comments/emails etc etc Lines 134 - 138 in the ipn listener also handle quantity so your stock will reconcile Where you have a decent IPN system (like PayPal) that will keep trying to ping your IPN listener then I'd use that every time to update the order/send the emails etc and just send the customer browser return to either checkout_success or checkout_payment(failed) as you can always guarantee that if there's a way of screwing the system then an innocent customer will find it (the old 'hey! What does this Big Red Button do? type of fella) Of course if the PayPal IPn fails then your stock will not decrement - I'd suggest peeking at the IPN history in your Paypal account from time to time to see if there's any disasters in there (but then I'm a paranoid type of guy) but, on the whole, IPN from Paypal these days is pretty sound.
  18. Bob Terveuren

    PayPal App v4.039 - double stock decrement

    Hi - the PayPal Standard will delete an order: function selection() { global $cart_PayPal_Standard_ID; if (tep_session_is_registered('cart_PayPal_Standard_ID')) { $order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1); $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); if (tep_db_num_rows($check_query) < 1) { tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); tep_session_unregister('cart_PayPal_Standard_ID'); } } and function confirmation() { global $cartID, $cart_PayPal_Standard_ID, $customer_id, $languages_id, $order, $order_total_modules; if (tep_session_is_registered('cartID')) { $insert_order = false; if (tep_session_is_registered('cart_PayPal_Standard_ID')) { $order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1); $curr_check = tep_db_query("select currency from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); $curr = tep_db_fetch_array($curr_check); if ( ($curr['currency'] != $order->info['currency']) || ($cartID != substr($cart_PayPal_Standard_ID, 0, strlen($cartID))) ) { $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); if (tep_db_num_rows($check_query) < 1) { tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); } $insert_order = true; } } else { $insert_order = true; } So if the customer ends up on checkout_payment or checkout_confirmation with that session in place then the order gets zapped. In checkout_confirmation another order then gets created - so you have a missing order number (slap on wrist if you get your accounts audited), sounds like your guy managed to get back to the store with the session intact somehow. You could try a little tweak and, instead of deleting the order change it to a status of 'Paypal cancelled' or something - ideally that'd be done by way of another admin configuration entry but here's a quick and dirty idea: Go to the admin create a new order status 'PayPal - cancelled' set that to viewable by the admin, invisible to the customer and no emails. Now you'll need to grab the id from the database and use it something like this: //comment out all the delete queries // tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); // tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); // tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); // tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); // tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); // tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); //now update the order status to 'hide' it from the customer $sql_data_array = array('orders_id' => $order_id, 'orders_status_id' => X,//where X=teh cancelled status id 'date_added' => 'now()', 'customer_notified' => (SEND_EMAILS == 'true') ? '1' : '0', 'comments' => 'PayPal pre order now cancelled'); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); tep_db_query("update " . TABLE_ORDERS . " set orders_status = 'X', last_modified = now() where orders_id = '" . (int)$order_id . "'"); That should leave the order in a state that you can see it - it should not decrement inventory as that is handled elsewhere. It will screw up your order /tax amounts if you don't do any sort of filtering so, if you want to zero the totals for this order try something like: //give the order total a value of 0.00 // zap all the existing orders_total tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . $order_id. "'"); // zero the orders_products tep_db_query("update " . TABLE_ORDERS_PRODUCTS . " set products_quantity = '0' where orders_id = '" . $order_id . "'"); // now give an ot_total of zero tep_db_query("insert into " . TABLE_ORDERS_TOTAL. " (orders_id, title, text, value, class, sort_order) values ('" . $order_id . "', 'Total', '0.00', '0','ot_total', '99')"); That last chunk of code comes from an osC spinoff so there may be some tweaks needed and/or some other tables that you can zero so that the admin reports are not skewed. e.g. I'm not sure where this module updates the 'products_ordered' column in the products table so you'd need to check that out. One other idea on your other post about the double decrement in quantities - you could just rely on the IPN callback to handle the quantities and comment out the code for the customer return?
  19. Bob Terveuren

    authorize.net changes causing problems

    Hi Rich You have that right - try renaming the .crt file to something lime .crtxxx and test - the new key that was published on Github by auth.net - https://github.com/AuthorizeNet/sdk-php/blob/master/lib/ssl/cert.pem in response to the thread https://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/Authorize-Net-Begins-Infrastructure-and-SHA-2-Certificate/ba-p/49615 is held within the .pem file (or at least it is in the latest osCommerce) - that may do the trick for you
  20. Bob Terveuren

    authorize.net changes causing problems

    https://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/Authorize-Net-Begins-Infrastructure-and-SHA-2-Certificate/ba-p/49615
  21. Bob Terveuren

    Is There An Addon I Can Use To Let People Offer A Price?

    Hi I've not used it myself but how about : http://addons.oscommerce.com/info/8486
  22. Bob Terveuren

    authorize.net changes causing problems

    Hi - can you provide a working link to where they are listing the changes? Thanks
  23. Bob Terveuren

    formatting the customer_telephone

    Hi - you should pop that function into includes/functions/general.php and admin/includes/functions/general.php which would allow you to use it anywhere in the site (you'd also need to remove it from invoice.php) An anternative would be to use a jQuery mask on the create_account/account_edit pages so that the number input would hit the database in your desired format or run your function on the database input from create_account (but that kind of assumes that you only ever,ever,ever get US customers and would screw up existing ones - OK so that's a maybe for a new store :-(( )
  24. Bob Terveuren

    Select Product Image Directory

    Hi $t is not setup so you get the error - you should have a line of code someplace that looks like $t = new upload($key); or $t = new classname();
  25. Bob Terveuren

    Icepay payment module with osCommerce 2.3.4

    Hi there have a look at something like: http://stackoverflow.com/questions/17549584/how-to-efficiently-use-try-catch-blocks-in-php there's some try{} catch{}examples there - if you use the icepay logger function within the catch block (I have no idea how the logger is utilised/activated but it looks like there's something in the code that logs someplace) then you may be able to throw up the problem. (Each try{} and catch{} set needs to be independent - you can't nest them) I can't see anything in 2.3.4 that should break that file - if there's nothing in the PHP error log then see if you cannot get the logger thing running and scatter calls to it in the code - something like this: // Set ICEPAY class require(DIR_WS_CLASSES . "payment.php"); $payment_modules = new payment("icepay"); $payment_module = $GLOBALS[$payment_modules->selected_module]; $payment_module->setMerchant(); // try logging $payment_module->doLogging("Got to line 52"); //end logging //assuming the logger is working - if nothing gets logged then the error lies above line 52 //line 49 possible //Check IP if (!$payment_module->ipCheck($_SERVER['REMOTE_ADDR'])) { $payment_module->doLogging("IP not in range"); die("IP not in range"); } //Check postback if (!$payment_module->OnPostback()) die("Invalid postback data"); try{ $paymentIDs = $_POST['StatusCode'] . " ( ". "OrderID:". $referenceOrderID. ", Reference:". $_POST['Reference']. ", TransactionID:". $_POST['TransactionID']. ", PaymentID:". $_POST['PaymentID']. " )"; $orderInfo = $referenceOrderID. " ( Reference:". $_POST['Reference']. ", TransactionID:". $_POST['TransactionID']. ", PaymentID:". $_POST['PaymentID']. " )"; define(ICEPAY_EMAIL_TEXT_PM, $_POST['PaymentMethod']); define(ICEPAY_EMAIL_TEXT_ORDER, $orderInfo); $payment_module->doLogging("Try block 1 OK"); } catch (Exception $e) { $payment_module->doLogging("Try block 1 failed". $e); }
×