PitchOu
Total Posts: 39
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 !
Posted: April 19 2008
| top
radders
Total Posts: 162
Joined: 2008-03-23
Maybe this will be possible once they implement the shopping cart rules correctly.
Posted: April 19 2008
| top
| # 1
Tweakmag
Total Posts: 306
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@tweakmag.com
http://www.tweakmag.com - Must have developer extension available soon - please make contact if interested in testing!
Mage Stats - http://www.magestats.com - Magento, Google Analytics and Realtime Stats combined - true customer insight.
Posted: April 19 2008
| top
| # 2
PitchOu
Total Posts: 39
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
Posted: April 20 2008
| top
| # 3
JoeNmass
Total Posts: 50
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
********************************************
Posted: April 23 2008
| top
| # 4
JoeNmass
Total Posts: 50
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
Click thumbnail to see full-size image
Posted: April 24 2008
| top
| # 5
PitchOu
Total Posts: 39
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 ?
Posted: April 25 2008
| top
| # 6
JoeNmass
Total Posts: 50
Joined: 2008-03-07
I do have the shipping country enabled but I am still getting that notice.
Could I be overloooking something else?
Posted: April 25 2008
| top
| # 7
mathilda
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?
Posted: May 6 2008
| top
| # 8
portalzine
Total Posts: 9
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
Alexander
Signature
portalZINE(R) New Media Network
http://www.portalzine.de
http://www.portalzine.tv
Posted: August 28 2008
| top
| # 10
tradiArt
Total Posts: 379
Joined: 2008-04-28
Spain
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.
Best regards.
Signature
herbalife | herbalife españa | posicionamiento seo
Posted: August 28 2008
| top
| # 11
w3lly
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
Alexander
Posted: August 30 2008
| top
| # 12
Crazy Serb
Total Posts: 11
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…
Posted: September 8 2008
| top
| # 13
Leo27
Total Posts: 127
Joined: 2008-10-08
Thanks Portalzine, your adjustments worked perfectly fine!!
Thanks
L. Nunes
Posted: October 24 2008
| top
| # 14
Anjanesh
Total Posts: 136
Joined: 2008-03-15
Mumbai, India
Im trying to do a similar thing. Except - break if any of the rates is 0. But it still shows other shipping methods when Free Shipping is first.
Inserted a line at the end (commented “Inserted this Line")
template\checkout\onepage\shipping_method\available.phtml
<?php foreach ( $_shippingRateGroups as $code => $_rates ): ?> < dt > <?php echo $this -> getCarrierName ( $code ) ?> </ dt > < dd > < ul > <?php foreach ( $_rates as $_rate ): ?> < li > <?php if ( $_rate -> getErrorMessage ()): ?> < ul class= "messages" >< li class= "error-msg" >< ul >< li > <?php echo $_rate -> getErrorMessage () ?> </ li ></ ul ></ li ></ ul > <?php else: ?> < input name = "shipping_method" type = "radio" value = "<?php echo $_rate->getCode() ?>" id = "s_method_<?php echo $_rate->getCode() ?>" <?php if( $_rate -> getCode ()=== $this -> getAddressShippingMethod ()) echo ' checked="checked"' ?> /> < label for= "s_method_<?php echo $_rate->getCode() ?>" > <?php echo $_rate -> getMethodTitle () ?> <?php $_excl = $this -> getShippingPrice ( $_rate -> getPrice (), $this -> helper ( 'tax' )-> displayShippingPriceIncludingTax ()); ?> <?php $_incl = $this -> getShippingPrice ( $_rate -> getPrice (), true ); ?> <?php echo $_excl ; ?> <?php if ( $this -> helper ( 'tax' )-> displayShippingBothPrices () && $_incl != $_excl ): ?> ( <?php echo $this -> __ ( 'Incl. Tax' ); ?> <?php echo $_incl ; ?> ) <?php endif; ?> </ label > <?php endif ?> </ li > <?php if ( intval ( $_rate -> getPrice ()) == 0 ) { break; } // Inserted this Line - why isnt this breaking ?> <?php endforeach; ?> </ ul > </ dd > <?php endforeach; ?>
Posted: January 4 2009
| top
| # 15