Al configurar nuestra tienda son muchos los que deciden activar el envío gratuito si se cumplen ciertas reglas en el carro (importe superior a una cantidad, envíos gratuitos a una zona, etc.).
El problema viene cuando el usuario ha de elegir un método de envío, y entre ellos le aparece el gratuito. El cliente piensa, ¿por qué voy a elegir otro si me da a elegir uno gratuito?. No tengo muy claro si esto es un bug, es falta de criterio o simplemente un descuido, lo que si que sé es que esto se puede solucionar de forma rápida y sencilla.
El método consiste en eliminar/ocultar el resto de métodos de envío si tenemos disponible el gratuito. Para ello, editamos el siguiente fichero:
- app/design/frontend/TEMPLATE/default/template/checkout/onepage/shipping_method/available.php
Y el código debería quedar tal que así:
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design_default
* @package Mage
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php if (!($_shippingRateGroups = $this->getShippingRates())): ?>
<strong><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></strong>
<?php else: ?>
<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>
<?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() || $freeOnly == True ) echo ' checked="checked"' ?> />
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodTitle() ?>
<strong>
<?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; ?>
</strong>
</label>
<?php endif ?>
</li>
<?php endforeach; ?>
</ul>
</dd>
<?php endif ?>
<?php endforeach; ?>
</dl>
<?php endif; ?>
La explicación de esto básicamente se reduce a realizar un bucle, mirar los métodos de envío disponibles y si aparece el método de envío gratuito desabilitamos el resto.
NOTA: este método sirve para aquellos que uséis onepage checkout.
El código original lo podéis encontrar aquí.