Is there a way to reinitialise the shipping method. Sometimes customers wants to back and add a product to the shopping cart, after they have already chosen a shipping method. I would like to remove the already selected shipping methode.

I'm using the following shipping methodes:

<input name="shipping_method" type="radio" value="freeshipping_freeshipping" id="s_method_freeshipping_freeshipping" class=" radio">

<input name="shipping_method" type="radio" value="tablerate_bestway" id="s_method_tablerate_bestway" class="radio">

Other usefull info:

save: function(){
    if (checkout.loadWaiting!=false) return;
    var validator = new Validation(this.form);
    if (validator.validate()) {
        var request = new Ajax.Request(
                onComplete: this.onComplete,
                onSuccess: this.onSave,
                onFailure: checkout.ajaxFailure.bind(checkout),
                parameters: Form.serialize(this.form)

resetLoadWaiting: function(transport){
nextStep: function(transport){
    if (transport && transport.responseText){
            response = eval('(' + transport.responseText + ')');
        catch (e) {
            response = {};
    if (response.error){
        if ((typeof response.message) == 'string') {
        } else {
            if (window.shippingRegionUpdater) {

        return false;


     var updater = new Ajax.Updater(
     {method:'get', onSuccess: checkout.setShipping.bind(checkout)}

// shipping method
var ShippingMethod = Class.create();
ShippingMethod.prototype = {
    initialize: function(form, saveUrl){
        this.form = form;
        if ($(this.form)) {
            $(this.form).observe('submit', function(event){this.save();Event.stop(event);}.bind(this));
        this.saveUrl = saveUrl;
        this.validator = new Validation(this.form);
        this.onSave = this.nextStep.bindAsEventListener(this);
        this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);

    validate: function() {
        var methods = document.getElementsByName('shipping_method');
        if (methods.length==0) {
            alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
            return false;

        if(!this.validator.validate()) {
            return false;

        for (var i=0; i<methods.length; i++) {
            if (methods[i].checked) {
                return true;
        alert(Translator.translate('Please specify shipping method.').stripTags());
        return false;

Can you also provide the file that I need to modify? I'm quit new to magento and not sure of what I need to modify. I did some research and found YourModule/etc/config.xml in the section and YourModule/Model/Observer.php.


Use checkout_cart_update_items_before event:


In the observer -> updateMethod() write following code :

$quote = Mage::helper('checkout/cart')->getCart()->getQuote(); 
$shippingMethod = $quote->getShippingAddress()->getShippingMethod();
    $quote->getShippingAddress()->setShippingMethod(null);  //setting method to null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.