Call-back icon  Sales: Call 877.832.5289 (N America)|310.295.4144 (International)

Magento

eCommerce Software for Online Growth

Magento Forum

   
Disable other shipping methods when free shipping is available
 
PitchOu
Member
 
Total Posts:  38
Joined:  2008-02-04
Villeneuve d'Ascq, France
 

Hi all !

All is in the title ... if free shipping is available for an order (price > min price configured) it’s strange to propose other shipping methods.

So how would it be possible to show only free shipping option ?

Thanks !

 
Magento Community Magento Community
Magento Community
Magento Community
 
radders
Sr. Member
 
Total Posts:  145
Joined:  2008-03-23
 

Maybe this will be possible once they implement the shopping cart rules correctly.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tweakmag
Sr. Member
 
Avatar
Total Posts:  277
Joined:  2007-08-31
London, UK
 

Hi there - I have done this with my tweakmag_shipping extension (available on connect). What it allows you to do is set a minimum and maximum order value for the shipping method to be active. This way you can chain as many shipping methods together as you like. For example:

1 Australia Post - min. 0 max 299.99
2. Free Shipping - min 300

So you can see that free shipping becomes available and Australia Post no longer shows, I will be adding more methods shortly.
Cheers
Adam

 Signature 

adam martin: internet consultant / web developer
contact | adam.martin@internetconsultants.com.au | +61 4 3331 3374 | skype adam.j.martin
http://www.tweakmag.com - Tweaking and Customizing The Magento eCommerce Platform

 
Magento Community Magento Community
Magento Community
Magento Community
 
PitchOu
Member
 
Total Posts:  38
Joined:  2008-02-04
Villeneuve d'Ascq, France
 

Finally I managed to do this changing app/design/frontend/default/default/template/checkout/cart/shipping.phtml around line 52 :

<dl class="shipment-methods">
<?php $freeOnly = False; ?>
<?php foreach ($_shippingRateGroups as $code => $_rates): ?>
<?php if ( $code == "freeshipping") {$freeOnly = True;}?>
<?php endforeach; ?>

<?php foreach ($_shippingRateGroups as $code => $_rates): ?>
<?php if (( $freeOnly == False) || ( ( $freeOnly == True ) && ( $code == "freeshipping" ) )): ?>
<dt><?php echo $this->getCarrierName($code) ?></dt>
<dd>
<ul>
<?php foreach ($_rates as $_rate): ?>
<li class="<?php if ($_rate->getErrorMessage()) echo 'error-msg';?>">
<?php if ($_rate->getErrorMessage()): ?>
<?php echo $_rate->getErrorMessage() ?>
<?php else: ?>
<input name="estimate_method" type="radio" value="<?php echo $this->htmlEscape($_rate->getCode()) ?>” id="s_method_<?php echo $_rate->getCode() ?>"<?php if( ($_rate->getCode()===$this->getAddressShippingMethod() || ($code == "freeshipping") )) echo ' checked="checked"' ?>/>
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodDescription() ?> - <strong><?php echo $_rate->getPrice() ?></strong></label>
<?php endif ?>
</li>
<?php endforeach; ?>
</ul>
</dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>

/app/design/frontend/default/default/template/checkout/onepage/shipping_method/available.phtml must be changed the same way.

Bye

 
Magento Community Magento Community
Magento Community
Magento Community
 
JoeNmass
Member
 
Avatar
Total Posts:  46
Joined:  2008-03-07
 

Thanks PitchOu

Just what I was looking for. Works great.

************UPDATE*********************
When I did a complete test I got an error message

See next thread

********************************************

 
Magento Community Magento Community
Magento Community
Magento Community
 
JoeNmass
Member
 
Avatar
Total Posts:  46
Joined:  2008-03-07
 

Looks like it’s not perfect after all. When I tried with a product to get the free shipping I get an error message saying that there is no shipping method for it.

Has anyone else get this message?

Image Attachments
error_shipping.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
PitchOu
Member
 
Total Posts:  38
Joined:  2008-02-04
Villeneuve d'Ascq, France
 

Hi JoeNmass, I’ve just got your PM.
Seems that your shipping country is not enabled for free shipping. Could you check in admin (admin/system_config/edit/section/carriers), in the free shipping tab ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
JoeNmass
Member
 
Avatar
Total Posts:  46
Joined:  2008-03-07
 

I do have the shipping country enabled but I am still getting that notice.
Could I be overloooking something else?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mathilda
Jr. Member
 
Total Posts:  15
Joined:  2008-04-04
Frankfurt / Main
 

I´m also very interested in a solution here. I also get a (slightly different) error message. I copied Pitchous code in the according part of both files, available.phtml and shipping.phtml (in my new theme folder, but according to the original folder structure). Was that right ? Maybe some adjustments would have been necessary for available.phtml?

Shipping country is enabled.

Does anyone have come any further with this problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
medlington
Member
 
Total Posts:  72
Joined:  2008-04-30
 

Hi,

I have tried to implement that hack but nothing happens, no errors and still have all the shipping options available with none checked.

anyone got any further with this?

 Signature 

the worlds most portable football goals - 3d animation sheffield - Product design and prototype development - Kenya tourist information - Fable Films - Video Production Sheffield

 
Magento Community Magento Community
Magento Community
Magento Community
 
portalzine
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2008-05-15
Germany
 

Hi,

Just check for the free shipping carrier

in template\checkout\onepage\shipping_method\available.phtml

before:

<dt><?php echo $this->getCarrierName($code?></dt>

after:

<dt><?php $carrier =$this->getCarrierName($code) ; echo $carrier ?></dt>

Than break the loops at the right points:

before:

<?php endif ?>
                
</li>                
            
<?php endforeach; ?>
after:
<?php endif ?>
                
</li>
                
<?php if( $carrier == 'freeshipping'){break;}?>
            <?php 
endforeach; ?>

before:

</ul>
        </
dd>
    
<?php endforeach; ?>
after:
</ul>
        </
dd>
        
<?php if( $carrier == 'freeshipping'){break;}?>
    <?php 
endforeach; ?>

You will have to replace freeshipping with your carrier name smile

Alexander

 Signature 

portalZINE(R) New Media Network
http://www.portalzine.de
http://www.portalzine.tv

 
Magento Community Magento Community
Magento Community
Magento Community
 
XOXO
Sr. Member
 
Avatar
Total Posts:  123
Joined:  2008-04-28
 

It’s a bit confusing to let the customer choose between free shipping and another shipping method.

portalzine thank you very much for your solution but… will be the file overwritten when an update is done?

Will be nice to have this solved in 1.1.4.  surprised

Best regards.

 Signature 

XOXO ...Hugs and Kisses
__
I love my Magento stores! grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
w3lly
Jr. Member
 
Total Posts:  4
Joined:  2008-08-19
 

this works great and nice howto! must be implement into 1.1.4!

portalzine - 28 August 2008 05:21 AM

Hi,

Just check for the free shipping carrier

in template\checkout\onepage\shipping_method\available.phtml

before:

<dt><?php echo $this->getCarrierName($code?></dt>

after:
<dt><?php $carrier =$this->getCarrierName($code) ; echo $carrier ?></dt>

Than break the loops at the right points:

before:
<?php endif ?>
                
</li>                
            
<?php endforeach; ?>
after:
<?php endif ?>
                
</li>
                
<?php if( $carrier == 'freeshipping'){break;}?>
            <?php 
endforeach; ?>

before:
</ul>
        </
dd>
    
<?php endforeach; ?>
after:
</ul>
        </
dd>
        
<?php if( $carrier == 'freeshipping'){break;}?>
    <?php 
endforeach; ?>

You will have to replace freeshipping with your carrier name smile

Alexander

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crazy Serb
Jr. Member
 
Total Posts:  10
Joined:  2008-07-23
 

can this be fixed in core, for the upcoming releases?

just because this fix doesn’t work for me as it is…

and having both free and paid shipping options on the cart is just dumb…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Leo27
Member
 
Total Posts:  52
Joined:  2008-10-08
 

Thanks Portalzine, your adjustments worked perfectly fine!!

Thanks

L. Nunes

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 877.832.5289 (North America) 310.295.4144 (International)
© Copyright 2008 Varien. Magento, eCommerce software, is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
53161 users|625 users currently online|107167 forum posts