Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

styloa

Pioneers
  • Posts

    16
  • Joined

  • Last visited

Posts posted by styloa

  1. i´ve got some order errors lately and the problem only appears when a customer fill in his adress and when he click on something else the ajax begin to spin and it setting billig and shipping adress and so on. lets say the customer will se that he forgotten the email address and fill it in, then it wont be registered with the order.

     

    So i need to know what file wich rule this functions.

     

    More exactly i need to know what code in what file :D

     

     

    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. Hello i have installed the contrib but i am getting the follow error when clicking on customers with the admin portal

     

    Warning: require(ext/craftyclicks/crafty_html_output.php) [function.require]: failed to open stream: No such file or directory in /home/wslwing/public_html/oscommerce/admin/customers.php on line 338

     

    Fatal error: require() [function.require]: Failed opening required 'ext/craftyclicks/crafty_html_output.php' (include_path='.:/x10hosting/php1/pear') in /home/wslwing/public_html/oscommerce/admin/customers.php on line 338

     

     

    Any ideas? It works fine on the customer create and account page.

     

    Thanks

     

    Greg

     

    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.

  3. I've installed this contrib locally, but when i try it I get the following error

     

     

    Also when I go to the demo here http://www.craftyclicks.co.uk.//downloads/...ate_account.php Iget the following error (1202) An unexpected error occured, please enter your address manually.

     

    Any ideas why?

     

     

    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.

×
×
  • Create New...