Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

styloa

Pioneers
  • Posts

    16
  • Joined

  • Last visited

Profile Information

styloa's Achievements

  1. I was looking at the same problem when integrating our contrib with OPC (UK Postcode Address Finder) - it seems like on every onBlur event on any of the form fields the full update sequence gets triggered if all address fiels are populated. This is especially noticable in IE. I did a little tweak to checkout.js to check for change in the form data before running the update - if data is unchanged we bail out and don't do any of the ajax-y bits. No guarantee it will help you as I haven't tested extensively, but worth a try. Here is a chunk out of checkout.js, mods were done to functions processBillingAddress, processShippingAddress and setCheckoutAddress. last_processBillingAddress : '', processBillingAddress: function (skipUpdateTotals){ var hasError = false; var checkoutClass = this; $('select[name="billing_country"], input[name="billing_street_address"], input[name="billing_zipcode"], input[name="billing_city"], *[name="billing_state"]', $('#billingAddress')).each(function (){ if (checkoutClass.fieldErrorCheck($(this), false, true) == true){ hasError = true; } }); if (hasError == true){ return; } this.setBillTo(); if ($('#diffShipping').checked && this.loggedIn != true){ this.setSendTo(true); }else{ this.setSendTo(false); } if (this.last_processBillingAddress != $('*', $('#billingAddress')).serialize()) { this.last_processBillingAddress = $('*', $('#billingAddress')).serialize(); } else { return; } if(skipUpdateTotals != true) { this.updateCartView(); this.updateFinalProductListing(); this.updatePaymentMethods(true); this.updateShippingMethods(true); this.updateOrderTotals(); } }, last_processShippingAddress : '', processShippingAddress: function (skipUpdateTotals){ var hasError = false; var checkoutClass = this; $('select[name="shipping_country"], input[name="shipping_street_address"], input[name="shipping_zipcode"], input[name="shipping_city"]', $('#shippingAddress')).each(function (){ if (checkoutClass.fieldErrorCheck($(this), false, true) == true){ hasError = true; } }); if (hasError == true){ return; } if (this.last_processShippingAddress != $('*', $('#shippingAddress')).serialize()) { this.last_processShippingAddress = $('*', $('#shippingAddress')).serialize(); } else { return; } this.setSendTo(true); if (this.shippingEnabled == true && skipUpdateTotals != true){ this.updateShippingMethods(true); } if(skipUpdateTotals != true) { this.updateCartView(); this.updateFinalProductListing(); this.updatePaymentMethods(true); this.updateShippingMethods(true); this.updateOrderTotals(); } }, last_setBillTo: '', last_setSendTo: '', setCheckoutAddress: function (type, useShipping){ var checkoutClass = this; var selector = '#' + type + 'Address'; var sendMsg = 'Setting ' + (type == 'shipping' ? 'Shipping' : 'Billing') + ' Address'; var errMsg = type + ' address'; if (type == 'shipping' && useShipping == false){ selector = '#billingAddress'; sendMsg = 'Setting Shipping Address'; errMsg = 'billing address'; } if (selector == '#billingAddress') { if (this.last_setBillTo != $('*', $('#billingAddress')).serialize()) { this.last_setBillTo = $('*', $('#billingAddress')).serialize(); } else { return; } } else { if (this.last_setSendTo != $('*', $('#shippingAddress')).serialize()) { this.last_setSendTo = $('*', $('#shippingAddress')).serialize(); } else { return; } } action = 'setBillTo'; if (type == 'shipping'){ action = 'setSendTo'; } this.queueAjaxRequest({ url: this.pageLinks.checkout, beforeSendMsg: sendMsg, dataType: 'json', data: 'action=' + action + '&' + $('*', $(selector)).serialize(), type: 'post', success: function (){ }, errorMsg: 'There was an error updating your ' + errMsg + ', please inform ' + checkoutClass.storeName + ' about this error.' }); }, Cheers, Adam
  2. Check what $_SESSION['payment'] is set to.... I suspect the session is not set?
  3. Hi Greg, For some reason I'm not getting notified of new posts in this thread anymore.... if anyone else get problems with this contrib and get no response from me here - email adam at craftyclicks dot co dot uk. Most likely cause for your error is some kind of relative path issue. Try giving a full path to the require function.
  4. Hi, The error 1201 could be due to CURL not being enabled in PHP - check your php.ini to make sure extension=php_curl.dll is not commented out. Error 1202 is most interesting - what browser do you use? Send me an email to adam at craftyclicks.co.uk - I can send you a debug version of the JavaScript code that will print more verbose error messages. Cheers, Adam.
  5. Just uploaded the UK address finder contribution. I'll monitor this thread and respond to any questions. Have a look at www.craftyclicks.co.uk / downloads / samples_action / oscommerce / create_account.php - this shows a mock-up of a osC page with this contribution in action. Let me know how you get on. Cheers, Adam.
×
×
  • Create New...