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. Only thing I can suggest would be to take the entire create_account form and add autocomplete="off" to each field - if that does not work (not too sure as to the actual problem) then make each field have a default value="" I have no access to a working copy of osC right now so I cannot say how to edit the create_account file
  7. Hi - likely to be an extra closing tag or maybe an unclosed opening tag - (needle in a haystack time). The problem may also in the original page and is only visible after the extra HTML is added - if you grab the HTML for both pages you could identify the extra code added for the second dropdown and see what that shows. If you see nothing then you could try the W3C validator - that is a can of worms as it will report things that aren't really wrong - e.g. on yours double opening <body> tags but that's only because it sees the <noscript> in the <head> and tells itself that there's an opening <body> there too. Try checking the <form> and get it into a single <div> - there's something hooky with the <div></divs> around that point in the page so maybe start there. You can also try something like http://www.aliciaramirez.com/closing-tags-checker/ Good luck Mr Bond - it's the type of job I hate......
  8. Hi - if I use the original sql from the add-on and run your code in 234BS then I have to make a couple of changes - the first is simply because I do not have tep_draw_pull_down_menu_parts so I substitute tep_draw_pull_down_menu That gives me a dropdown menu 'Please select' and a list of printers, choose one, nothing happens (which is what I think you are getting) What I see in function getprintercatoptions() is that there is: if($chkbottomROW[0]>0) { $str .= $printer_category_id.","; } That's always going to fail as the preceding sql query actually only returns an array of: $chkbottomROW[count(printer_category_id)] => 0 - there is no $chkbottomROW[0] anywhere. try making the two changes below in the function function getprintercatoptions($printer_category_id="",$curprintercatid="") { $fieldid = $printer_category_id; if(isset($_REQUEST['parts_cat_'.$printer_category_id])&&($_REQUEST['parts_cat_'.$printer_category_id]!='')) { $printer_category_id = $_REQUEST['parts_cat_'.$printer_category_id]; $str = getprintercatpath($printer_category_id,""); // change thefollowing add alias of count $query1 = tep_db_query("SELECT count(printer_category_id) as count FROM " . TABLE_PRINTER_CATEGORY . " where parent_id = '".$printer_category_id."'"); $chkbottomROW = tep_db_fetch_array($query1); if($str =="") {$str = "0,";} //change here use alias if($chkbottomROW['count'] > 0) { $str .= $printer_category_id.","; } $catarr = explode(",",substr($str,0,-1)); sort($catarr); editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid); }else{ if($curprintercatid>0) { $str = getprintercatpath($curprintercatid,""); if($str =="") { $str = $curprintercatid.","; }else{ $str .= $curprintercatid.","; } }else{ $str = getprintercatpath($printer_category_id,""); if($str =="") {$str = $printer_category_id.",";} } $catarr = explode(",",substr($str,0,-1)); sort($catarr); editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid); } }
  9. Hi - could you save the entire web page including the .js files as it appears when you first get there (i.e. the one that doesn't work)? If you can then zip it and attach here. If you can't then have a look in the console of your browser and see if there's any errors - chances are there's none as the onchange sounds like it is not firing - if your on 234BS then you could revamp the js code to use jQuery
  10. 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'],
  11. 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.
  12. 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
  13. 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
  14. Bob Terveuren

    Automatically send data feed to Froogle

    Hi Try Jack's addon http://addons.oscommerce.com/info/7701 works usually - support here
  15. 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
  16. 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 ?>
  17. 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
  18. Hi - oscMax he used the contribution BTS template which split the html part of the page out to a .tpl.php file in a template folder and left most of the PHP in the 'normal' files - CReLoaded also went with BTS initially (now they do something else I think not sure). The original stuff is still there at http://addons.oscommerce.com/info/1263 There were a lot of BTS sites around with RC2.2 as some of the places like TemplateMonster sold a lot of code based around the system - I think since 2.3 BTS is dead and gone pretty much not seen one in a while. Having said that it did shift the PHP and html side of things out like you describe - the main PHP code loads up variables and sessions etc and then in comes the actual HTML file which then just echoes out the variables already manufactured, 'twas a PITA at the time though as few contributions were split out in the same manner so when installing them on a BTS site you had to sieve through the code and pop the correct bits into the correct file. Does mean you can work with the HTML without worrying about breaking the PHP and vice versa As to the spaghetti code - yup, it's there, it's everywhere - a lot of it is inherited/legacy and is getting removed but nevertheless it is in there and all muddled up - shifting it would require a fundamental change to the osC 2.x series - v 3.0 was doing something like this before it stalled. You only need to look at more modern code carts (Magento? WooCommerce?) to see how different folks have split the display/code side of things but I think that osC 2.3/2.4 has inherited all the 'weird stuff' from the past (MS2 060817 anyone?) and splitting it out now 100% would be a heck of a job. Finally - a lot of contributions/addons/plugins whatever you want to call them HAD to cut into the 'core' code as nothing else existed at the time - CCGV for example required cut and shut in quite a few places so that a store could offer coupons and so on. Once you are used to carving up osCommerce like that it becomes a habit ;-) ------------------------------------------------- OK nuff said from me (old b'stard that I am) - it's getting OT a bit - back to addon development. My 2p worth (1) get a standardised set of 'hooks' in the core code that allows developers to push in functions where needed. (e.g. checkout_process either add in a call to a payment module before_email() function or move the after_process() call to before the email - that allows a payment module developer to perform callbacks etc and abort the email/order if necessary rather than some coding nightmare like the current PayPal Standard (2) get a roadmap out for 2.4 - I keep reading about new addon 'marketplace' and so on but when? (3) A store owner will not give two figs about whether we have shifted PHP/HTML apart - all he wants to see is a simple system of uploading / testing / maybe removing a plugin that won't render his shop u/s and require him to pay somebody to fix it - that should be the main priority for 2.4 I used to work 100% with osCommerce and its offshoots but nowadays the paid work is pretty much all elsewhere - my feeling is that Burts 2.3.4BS is going a long way to pulling osC back up to date but the 'official' 2.4 needs to be out there in BS form for the public at large to grab a copy?
  19. 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)
  20. 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
  21. 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.
  22. Senior moment - welcome to my world
  23. 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.
  24. 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?
  25. 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
×