<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>onestic &#187; extensión</title>
	<atom:link href="http://onestic.com/tag/extension/feed/" rel="self" type="application/rss+xml" />
	<link>http://onestic.com</link>
	<description>blog de onestic</description>
	<lastBuildDate>Wed, 30 Jun 2010 10:37:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Multiple Tablerates para Magento</title>
		<link>http://onestic.com/multiplerates-magento/</link>
		<comments>http://onestic.com/multiplerates-magento/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 10:25:27 +0000</pubDate>
		<dc:creator>Sergio Baixauli</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Opinión]]></category>
		<category><![CDATA[extensión]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[métodos de envío]]></category>
		<category><![CDATA[multiplerates]]></category>
		<category><![CDATA[shipping cost]]></category>
		<category><![CDATA[tablerates]]></category>

		<guid isPermaLink="false">http://onestic.com/?p=210</guid>
		<description><![CDATA[Hoy vamos a modificar el módulo de Multiple TableRates de Magento para que haga exactamente lo que necesitamos.
El módulo de Multiple TableRates para Magento como bien sabréis sirve para configurar las tarifas de envío de nuestros pedidos.

1.- Lo primero de todo será instalar el módulo. Si todavía no lo tienes pulsa aquí.
2.- Una vez descargado [...]]]></description>
			<content:encoded><![CDATA[Hoy vamos a modificar el módulo de <a href="http://www.magentocommerce.com/extension/728/multiple-tablerates">Multiple TableRates</a> de <a href="http://www.magentocommerce.com">Magento</a> para que haga exactamente lo que necesitamos.
El módulo de <a href="http://www.magentocommerce.com/extension/728/multiple-tablerates">Multiple TableRates</a> para Magento como bien sabréis sirve para configurar las tarifas de envío de nuestros pedidos.

1.- Lo primero de todo será instalar el módulo. Si todavía no lo tienes pulsa <a href="http://www.magentocommerce.com/extension/728/multiple-tablerates">aquí</a>.
2.- Una vez descargado e instalado dirigete a Sistema -> Configuración -> Método de envío

<a href="http://onestic.com/wp-content/uploads/2009/10/table_rates_1.jpg"><img src="http://onestic.com/wp-content/uploads/2009/10/table_rates_1.jpg" alt="table_rates_1" title="table_rates_1" width="575" height="718" class="alignnone size-full wp-image-290" /></a>

3.- Habilitamos el módulo y lo personalizamos a nuestro gusto. La opción más importante es la "Condición". Vamos a seleccionar "Peso vs. Destino". 
En el cálculo de los costos de envío elegimos "Fijo". La explicación de esto es que para cada zona de envío que creemos, se sumará el peso total y se realizará un cálculo fijo.

4.- Ahora vamos a crear nuestra pequeña tabla con la configuración de los envíos. Cambiamos desde la parte superior izquierda (en el administrador) la vista de tienda (el alcance de la configuración actual). Posiblemente tuvieras seleccionada la "Configuración por defecto". Al cambiar la vista, verás que han aparecido dos nuevos botones. Importar y exportar.

<a href="http://onestic.com/wp-content/uploads/2009/10/table_rates_2.jpg"><img src="http://onestic.com/wp-content/uploads/2009/10/table_rates_2.jpg" alt="table_rates_2" title="table_rates_2" width="575" height="220" class="alignnone size-full wp-image-293" /></a>

5.- Si no hemos subido nada todavía, pulsamos exportar y tendremos un fichero .csv en "blanco" para poder completarlo. Una vez rellenado, lo importaremos.

6.- Para empezar subiremos este. 
El fichero está más o menos claro. Aquellos pedidos que no superen los 140Kg y se envien a cualquier zona (*) de España (ESP), se cobrarán a 48.6 €.

<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-3">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&amp;amp;amp;amp;quot;País&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Región/Estado&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Código postal&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Peso <span style="color:#006600; font-weight:bold;">&#40;</span>and above<span style="color:#006600; font-weight:bold;">&#41;</span>&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Precio de envío&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Method Code&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Method Name&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Method Description&amp;amp;amp;amp;quot;,&amp;amp;amp;amp;quot;Condition Type&amp;amp;amp;amp;quot;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ESP,*,*,<span style="color:#CC66CC;color:#800000;">140</span>.<span style="color:#CC66CC;color:#800000;">0000</span>,<span style="color:#CC66CC;color:#800000;">48</span>.<span style="color:#CC66CC;color:#800000;">6000</span>,bajo,Envío a planta baja: Hasta 140Kg,Envio a Bajos,value </div></li></ol></div>
</div></div><br />

7.- Si nos fijamos, en la última palabra de nuestro fichero de configuración pone "value". Esto hace referencia a la condicion que usamos antes "Cálculo de los costos".
Si hubieramos puesto "percent", en vez de calcular el precio "fijo", se calcularia en base a un porcentaje.
Bueno, hasta aquí el funcionamiento "normal" de este módulo. Ahora vamos a modificarlo para que haga lo que nosotros queremos en base a un escenario concreto.

<a href="#">Ejemplo</a>:
Queremos calcular los costes de envio para una tienda. Esta tienda realiza dos tipos de envíos, uno a plantas bajas y otro a naves industriales.
Cada uno de ellos tiene un coste diferente y se rige por unas reglas completamente distintas.

Por una parte, el envío a plantas bajas se calcula mediante la clásica tabla de pesos vs. destino, pero vamos a hacer una modificación. Queremos que una vez superado un peso, el importe no sea "fijo", sino que se multiplique por una constante. Por ejemplo, los pedidos mayores de 200Kg y menores de 500Kg, costarán 0.24€ x Kilo.

Por otra, para los envíos a Naves insdustriales, tendremos que saber primero que tipo de producto estamos enviando y luego los multiplicaremos por lo que cuesta el envío de cada uno de ellos. Por ejemplo, dos cajas de bebida (cada una cuesta 10€ de enviar) y una caja de comida (cada una cuesta 20€ de enviar). El total del envío será 30€.

Ya os adelanto que todo esto no lo hace el módulo de Multiple TableRates, así que tenemos que hacer unos cuantos cambios.
Lo primero, editar el fichero que hace todos los cálculos. Básicamente he cambiado toda la función "collectRates" que es la que hace todos los cálculos.

<div class="igBar"><span id="lphp-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div><div class="syntax_hilite"><span class="langName">PHP:</span><br /><div id="php-4">
<div class="php"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">.../Multipletablerates/Model/Carrier/Multipletablerates.php</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> collectRates<span style="color:#006600; font-weight:bold;">&#40;</span>Mage_Shipping_Model_Rate_Request <span style="color:#0000FF;">$request</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!<span style="color:#0000FF;">$this</span>-&amp;amp;amp;amp;gt;getConfigFlag<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'active'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">false</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!<span style="color:#0000FF;">$request</span>-&amp;amp;amp;amp;gt;getConditionName<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$request</span>-&amp;amp;amp;amp;gt;setConditionName<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&amp;amp;amp;amp;gt;getConfigData<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'condition_name'</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#0000FF;">$this</span>-&amp;amp;amp;amp;gt;getConfigData<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'condition_name'</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#0000FF;">$this</span>-&amp;amp;amp;amp;gt;_default_condition_name<span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$result</span> = Mage::<span style="color:#006600;">getModel</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'shipping/rate_result'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$rates</span> = <span style="color:#0000FF;">$this</span>-&amp;amp;amp;amp;gt;getRate<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$request</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rates</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp; <span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'price'</span><span style="color:#006600; font-weight:bold;">&#93;</span> &amp;amp;amp;amp;gt;= <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$method</span> = Mage::<span style="color:#006600;">getModel</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'shipping/rate_result_method'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$method</span>-&amp;amp;amp;amp;gt;setCarrier<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'multipletablerates'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$method</span>-&amp;amp;amp;amp;gt;setCarrierTitle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&amp;amp;amp;amp;gt;getConfigData<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'title'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$method</span>-&amp;amp;amp;amp;gt;setMethod<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'bestway_'</span> . <span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'pk'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$method</span>-&amp;amp;amp;amp;gt;setMethodTitle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'method_name'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$price</span> = <span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'price'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/* Onestic Si el peso es mayor o igual a 200 multiplicamos el peso total por el coeficiente*/</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'condition_value'</span><span style="color:#006600; font-weight:bold;">&#93;</span> &amp;amp;amp;amp;gt;=<span style="color:#CC66CC;color:#800000;">200</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; <span style="color:#008000;">/*Aquí podemos poner el valor que queramos*/</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$mageFilename</span> = <span style="color:#FF0000;">'app/Mage.php'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">require_once</span> <span style="color:#0000FF;">$mageFilename</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/umask"><span style="color:#000066;">umask</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mage::<span style="color:#006600;">app</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mage::<span style="color:#006600;">getSingleton</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'core/session'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'name'</span>=&amp;amp;amp;amp;gt;<span style="color:#FF0000;">'frontend'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$session</span> = Mage::<span style="color:#006600;">getSingleton</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'checkout/session'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$aux_weight</span>= <span style="color:#CC66CC;color:#800000;">0</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/* Sumamos el peso de todos los productos del carrito y lo multiplicamos por el coeficiente */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$session</span>-&amp;amp;amp;amp;gt;getQuote<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&amp;amp;amp;amp;gt;getAllItems<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$prod</span> = <span style="color:#000000; font-weight:bold;">new</span> Mage_Catalog_Model_Product<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$prod</span>= <span style="color:#0000FF;">$prod</span>-&amp;amp;amp;amp;gt;load<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$item</span>-&amp;amp;amp;amp;gt;getProduct<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&amp;amp;amp;amp;gt;getId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$aux_weight</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$item</span>-&amp;amp;amp;amp;gt;getQty<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#0000FF;">$prod</span>-&amp;amp;amp;amp;gt;getWeight<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#0000FF;">$aux_weight</span>;&nbsp; &nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$price</span> = <span style="color:#0000FF;">$aux_weight</span> * <span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'price'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/* Esto lo dejamos igual. El cálculo en porcentaje es correcto */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'condition_type'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#FF0000;">'percent'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$price</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$price</span> * <span style="color:#0000FF;">$request</span>-&amp;amp;amp;amp;gt;getData<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$request</span>-&amp;amp;amp;amp;gt;getConditionName<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> / <span style="color:#CC66CC;color:#800000;">100</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/*Onestic*/</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/* Calculamos el precio del envío, para eso cogemos el número de productos que hay en el carro, sacamos su tipo, y lo</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; multiplicamos por el coste unidad. Esto solo ocurre cuando la entrega es en un Piso, dnd el cálculo del envío se hace</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; por producto y no por peso. condition_type = product. En nuestro fichero .csv ahora podemos poner condition_type además de percent ó value el tipo product*/</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'condition_type'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#FF0000;">'product'</span><span style="color:#006600; font-weight:bold;">&#41;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$mageFilename</span> = <span style="color:#FF0000;">'app/Mage.php'</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">require_once</span> <span style="color:#0000FF;">$mageFilename</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/umask"><span style="color:#000066;">umask</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mage::<span style="color:#006600;">app</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Mage::<span style="color:#006600;">getSingleton</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'core/session'</span>, <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'name'</span>=&amp;amp;amp;amp;gt;<span style="color:#FF0000;">'frontend'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$session</span> = Mage::<span style="color:#006600;">getSingleton</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'checkout/session'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$aux_price</span> = <span style="color:#CC66CC;color:#800000;">0</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">foreach</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$session</span>-&amp;amp;amp;amp;gt;getQuote<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&amp;amp;amp;amp;gt;getAllItems<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$item</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$prod</span> = <span style="color:#000000; font-weight:bold;">new</span> Mage_Catalog_Model_Product<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$prod</span>= <span style="color:#0000FF;">$prod</span>-&amp;amp;amp;amp;gt;load<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$item</span>-&amp;amp;amp;amp;gt;getProduct<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>-&amp;amp;amp;amp;gt;getId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/* Previo a este paso, hemos creado un atributo desde el configurador de atributos, llamado 'tipo_producto'. Es un dropdown con dos valores (bebida y comida), para poder determinar que clase de producto es */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$prod</span>-&amp;amp;amp;amp;gt;getAttributeText<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'tipo_producto'</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#FF0000;">'bebida'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#0000FF;">$aux_price</span> = <span style="color:#0000FF;">$aux_price</span> + <span style="color:#0000FF;">$item</span>-&amp;amp;amp;amp;gt;getQty<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#CC66CC;color:#800000;">10</span>;&nbsp; <span style="color:#008000;">/*Multiplicamos por 10 */</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">elseif</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$prod</span>-&amp;amp;amp;amp;gt;getAttributeText<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'tipo_producto'</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#FF0000;">'comida'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#0000FF;">$aux_price</span> = <span style="color:#0000FF;">$aux_price</span> + <span style="color:#0000FF;">$item</span>-&amp;amp;amp;amp;gt;getQty<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> * <span style="color:#CC66CC;color:#800000;">20</span>;&nbsp; <span style="color:#008000;">/*Multiplicamos por 20 */</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$price</span> = <span style="color:#0000FF;">$aux_price</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#008000;">/* Fin Onestic */</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$method</span>-&amp;amp;amp;amp;gt;setPrice<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&amp;amp;amp;amp;gt;getFinalPriceWithHandlingFee<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$price</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$method</span>-&amp;amp;amp;amp;gt;setCost<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rate</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'cost'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$result</span>-&amp;amp;amp;amp;gt;append<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$method</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$result</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div></li></ol></div>
</div></div><br />

Bueno, y con esto ya está todo. Ahora el Multiple Tablerates hace exactamente lo que queremos. Quizás no sea el modo más "limpio", pero desde luego hace lo que necesitamos.
]]></content:encoded>
			<wfw:commentRss>http://onestic.com/multiplerates-magento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>