Check Single Shipping Method in Checkout

Modules, Add-ons and custom code that's more than just a quick hack or Mod.
Post Reply
grantg
Posts: 112
Joined: Thu Oct 08, 2009 11:01 am

Check Single Shipping Method in Checkout

Post by grantg »

Hello all - thought this would be the best place to ask, seems this is where the ISC geniuses hang out...

Where only one shipping method is available, I would like to have that shipping method 'checked' (radio button 'active'). As default, the attached image shows the single shipping method - an error is shown if a customer clicks Continue, which they then have to resolve - seems a waste of time and possibly confusing.

Is this a possibility? Has anyone managed to find a fix for this? The demo image I have shown uses the Express checkout - the live site uses the standard checkout.

As a side note - we got an Incomplete order through for Australia (which we do not provide shipping quotes for) - but the order had no E-mail address used, this was a Guest checkout customer - how did the customer go through the checkout without entering an e-mail in the standard (not Express) checkout? I have noticed you can virtually enter anything and it passes the validation - shouldn't it at least check there is an @ symbol?!
Attachments
checksingleshippingmethod.JPG
Cupar Garden Centre: CS-Cart Professional 2.2.5 (Converted from ISC 6.0.14 Ultimate)
Online Garden Centre: ISC 6.0.14 Professional
Painstik
Posts: 122
Joined: Sun Jul 19, 2009 1:19 pm
Location: Croatia

Re: Check Single Shipping Method in Checkout

Post by Painstik »

Interspired made that feature allready, but seems like it doens't work...

This is peace of code you are looking for in express.checkout.js

Code: Select all

var numShippers = $('#CheckoutStepShippingProvider .ShippingProviderList').length;
		if(numShippers == 1) {
			var shippingCheck = $('#CheckoutStepShippingProvider .ShippingProviderList input[type=radio]:checked')
			var shippingMethod = shippingCheck.attr('id');
			shippingMethod = shippingMethod.replace('shippingCheck_', '')+'_'+shippingCheck.val();
			var shipperName = $('#shippingMethod_'+shippingMethod+' .ShipperName').html();
			var shipperPrice = $('#shippingMethod_'+shippingMethod+' .ShipperPrice').html();
			$('#CheckoutStepShippingProvider .ExpressCheckoutCompletedContent').html(shipperName + ' '+lang.ExpressCheckoutFor+' '+shipperPrice);
		}
Need custom coding for Interspire Shopping Cart? Contact me
grantg
Posts: 112
Joined: Thu Oct 08, 2009 11:01 am

Re: Check Single Shipping Method in Checkout

Post by grantg »

Painstik wrote:Interspired made that feature allready, but seems like it doens't work...

This is peace of code you are looking for in express.checkout.js

Code: Select all

var numShippers = $('#CheckoutStepShippingProvider .ShippingProviderList').length;
		if(numShippers == 1) {
			var shippingCheck = $('#CheckoutStepShippingProvider .ShippingProviderList input[type=radio]:checked')
			var shippingMethod = shippingCheck.attr('id');
			shippingMethod = shippingMethod.replace('shippingCheck_', '')+'_'+shippingCheck.val();
			var shipperName = $('#shippingMethod_'+shippingMethod+' .ShipperName').html();
			var shipperPrice = $('#shippingMethod_'+shippingMethod+' .ShipperPrice').html();
			$('#CheckoutStepShippingProvider .ExpressCheckoutCompletedContent').html(shipperName + ' '+lang.ExpressCheckoutFor+' '+shipperPrice);
		}
Thanks - I have located this piece of code in express.checkout.js, but thought this line:

Code: Select all

var shippingCheck = $('#CheckoutStepShippingProvider .ShippingProviderList input[type=radio]:checked')
Would 'check' the radio button if the number of shipping methods is equal to one...that's how the code reads anyway(?)
Cupar Garden Centre: CS-Cart Professional 2.2.5 (Converted from ISC 6.0.14 Ultimate)
Online Garden Centre: ISC 6.0.14 Professional
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

Re: Check Single Shipping Method in Checkout

Post by Martin »

grantg wrote:As a side note - we got an Incomplete order through for Australia (which we do not provide shipping quotes for) - but the order had no E-mail address used, this was a Guest checkout customer - how did the customer go through the checkout without entering an e-mail in the standard (not Express) checkout? I have noticed you can virtually enter anything and it passes the validation - shouldn't it at least check there is an @ symbol?!
It's something I've tried to locate numerous times in the past because I've had around a 2% email bounce rate on order notifications with ISC... Bottom line I haven't found it yet but it's such a basic sanity check that it just beggars belief that it hasn't been resolved properly.

Begs the question just how secure the code is and whether code injections are a real hazard in ISC...
Iamdbat
Posts: 66
Joined: Sun Oct 18, 2009 1:47 am

Re: Check Single Shipping Method in Checkout

Post by Iamdbat »

Semms everything is a real hazard in ISC - I just wanted a way to extend my retail day business - now I'm up at night trying to 'Webmaster' - All I wanted to do was put products for sale in - Thats what I thought it would be
Post Reply