Author Topic: Do not select a Shipping Method by default  (Read 2393 times)

LeGaS

  • Guest
Do not select a Shipping Method by default
« on: July 14, 2010, 18:14:46 pm »
Hello!

My client's request is that VirtueMart should not select a shipping method by default. This functionality is working at the payment methods step and it shows an error message, if the customer didn't select one.

How can I implement this in the shipping methods too?

I am using the Standard Shipping module and also tried to comment out this code from /administrator/components/com_virtuemart/classes/shipping/standard_shipping.php:
Code: [Select]
if( ! $selected ) {
$selected = True ;
$html .= "checked=\"checked\"" ;
}
And it works but then it doesn't show an error message if I don't select something.

Please help!
Thanks!

LSmith

  • Beginner
  • *
  • Posts: 7
Re: Do not select a Shipping Method by default
« Reply #1 on: December 03, 2010, 10:05:24 am »
I am not sure how to have a shipping method is not selected by default, but I did figure out how to get other shipping methods selected by default or have the first shipping option selected.

Change the first Selected to True:

$selected = True ;

and then change the second Selected to False:

if( ! $selected ) {
   $selected = True ;
   $html .= "checked=\"checked\"" ;
}

If anyone has figured out how to get the error message to show when none of the options are selected please let me know too. Thank you. :)


mandingueiro

  • Jr. Member
  • **
  • Posts: 179
Re: Do not select a Shipping Method by default
« Reply #2 on: January 05, 2012, 17:03:19 pm »
LSmith, in which file is the code you're describing?