PitchOu
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 !
Posted: April 19 2008
| top
radders
Total Posts: 145
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: 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
Posted: April 19 2008
| top
| # 2
PitchOu
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
Posted: April 20 2008
| top
| # 3
JoeNmass
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
********************************************
Posted: April 23 2008
| top
| # 4
JoeNmass
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
Click thumbnail to see full-size image
Posted: April 24 2008
| top
| # 5
PitchOu
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 ?
Posted: April 25 2008
| top
| # 6
JoeNmass
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?
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: 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
Alexander
Signature
portalZINE(R) New Media Network
http://www.portalzine.de
http://www.portalzine.tv
Posted: August 28 2008
| top
| # 10
XOXO
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.
Best regards.
Signature
XOXO ...Hugs and Kisses
__
I love my Magento stores!
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: 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…
Posted: September 8 2008
| top
| # 13
Leo27
Total Posts: 52
Joined: 2008-10-08
Thanks Portalzine, your adjustments worked perfectly fine!!
Thanks
L. Nunes